Cool, let me know if you have any questions.
-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/

On Tue, Oct 13, 2009 at 7:46 PM, Miles J <[email protected]> wrote:

>
> Well see now a lot of it makes sense. The guide is pretty vague on
> i18n/l10n and how it works / is used.
>
> Will give this a try.
>
> On Oct 13, 5:39 pm, "Larry E. Masters aka PhpNut" <[email protected]>
> wrote:
> > Incorrect, the file that is created using the i18n extract creates a .pot
> > file which is a template file and can be opened in any po editor or text
> > editor. The template is not language specific. There is no reason to
> create
> > these files by hand. Write your code and output using the sentences you
> > would normally use just wrap the string in __() function. Run the
> extractor
> > and you are done.
> > Easiest tool to edit translations I have recently found is
> poedit.www.poedit.net
> >
> > I uploaded current core extracted pot file.
> >
> > http://cake-php.googlegroups.com/web/default.pot
> >
> > Download it and open in poedit.
> >
> > The nice thing about these pot file is you can create a new version with
> > changes in your application, reopen the template in poedit, and it will
> > merge changes highlighting the strings that have changed.
> >
> > Not sure if you are aware how the other translation functions work in the
> > core, but when it comes to handling plurals in a sentence, your slugs
> will
> > become more confusing.
> >
> > for($number = 0; $i < 100; $number++) {
> > sprintf(__n('There is %d apple in the fruit bowl', 'There are %d apples
> in
> > the fruit bowl', $number), $number);
> >
> > }
> >
> > msgid "There is %d apple in the fruit bowl"
> > msgid_plural "There are %d apples in the fruit bowl"
> > msgstr[0] ""
> > msgstr[1] ""
> > msgstr[2] ""
> > msgstr[3] ""
> > msgstr[4] ""
> > msgstr[5] ""
> > msgstr[6] ""
> >
> > There are 16 plural rules that range from 1 form of plural to 6 forms of
> > plural depending on the value of $number. It all depends and the language
> > the content is being translated to. The above example be based on the
> header
> > in the po file, which poedit allows you to set based on the language you
> are
> > using.
> >
> > Only 1 form of plural.
> > "Plural-Forms: nplurals=1; plural=0;\n"
> >
> > 6 forms of plural.
> > "Plural-Forms: nplurals=4; plural=n==1 ? 0 : n==2 ? 1 : n==0 || (n>=3 &&
> > n<=10) ? 2 : 3;\n"
> >
> > 14 other forms or plural are available. These will be added to the
> > translation site I had online for the project before. This will be coming
> > back online in the next few weeks. They will also be added to the book,
> with
> > corrections on the proper use of these functions soon. If you need the
> > correct plural form before then, let me know and I can reply with it.
> >
> > --
> > /**
> > * @author Larry E. Masters
> > * @var string $userName
> > * @param string $realName
> > * @returns string aka PhpNut
> > * @access  public
> > */
> >
> > On Tue, Oct 13, 2009 at 6:50 PM, Miles J <[email protected]>
> wrote:
> >
> > > But you would need to make the english po file anyways if you are
> > > going to distribute it and have it translated.
> >
> > > On Oct 13, 12:58 pm, "Larry E. Masters aka PhpNut" <[email protected]>
> > > wrote:
> > > > So you are basically using these as "defines"?
> > > > --
> > > > /**
> > > > * @author Larry E. Masters
> > > > * @var string $userName
> > > > * @param string $realName
> > > > * @returns string aka PhpNut
> > > > * @access  public
> > > > */
> >
> > > > On Tue, Oct 13, 2009 at 2:19 PM, euromark (munich) <
> >
> > > > [email protected]> wrote:
> >
> > > > > i agree with miles
> >
> > > > > they should be slugged, short and precise
> > > > > and explained in both the english and foreign .po file
> >
> > > > > like
> >
> > > > > "regMessageSuccess"
> > > > > and
> > > > > "You have been successfully registered"
> > > > > "Sie sind nun erfolgreich angemeldet"
> >
> > > > > or
> > > > > "valErrorRecordNameExists"
> > > > > for
> > > > > "A record with this name already exists"
> >
> > > > > this way you can easily change the "original" language text (here:
> > > > > english) without having to change all the x places in the script as
> > > > > well
> >
> > > > > maybe it is now supposed to be
> > > > > "You cannot have two records with the same name"
> >
> > > > > but the short slugged term has still the same basic meaning and
> > > > > therefore remains the same
> >
> > > > > On 13 Okt., 18:12, Miles J <[email protected]> wrote:
> > > > > > I am personal extremely against naming your ids the full
> sentence,
> > > > > > what purpose does that serve? Its longer in both the .po and .ctp
> > > file
> > > > > > and its a lot easier to reference slugs. To each his own I guess.
> >
> > > > > > On Oct 13, 7:42 am, "Larry E. Masters aka PhpNut" <
> [email protected]>
> > > > > > wrote:
> >
> > > > > > > Another thing I forgot to mention. You should be using full
> strings
> > > you
> > > > > want
> > > > > > > translated for the msgid.Example:
> >
> > > > > > > msgid "By registering on this web site you are..."
> >
> > > > > > > This is the way the core was designed to handle translations.
> You
> > > will
> > > > > also
> > > > > > > find it much easier for people to translate your application if
> > > they
> > > > > have
> > > > > > > everything they need in the 1 .po file vs looking for the text
> > > related
> > > > > to a
> > > > > > > place holder.
> >
> > > > > > > --
> > > > > > > /**
> > > > > > > * @author Larry E. Masters
> > > > > > > * @var string $userName
> > > > > > > * @param string $realName
> > > > > > > * @returns string aka PhpNut
> > > > > > > * @access  public
> > > > > > > */
> >
> > > > > > > On Tue, Oct 13, 2009 at 9:13 AM, Rob <[email protected]>
> wrote:
> >
> > > > > > > > Any1 thought about creating little snippet which could speed
> up
> > > > > > > > hardcoded localization process.
> > > > > > > > Here is the simple scenerio:
> > > > > > > > 1) find strings within __('...') __('...',true) string
> patterns
> > > in /
> > > > > > > > app folder
> > > > > > > > 2) build arrays from default locale *.po files containing
> locale
> > > keys
> > > > > > > > 3) append to end of these files missing id keys in form:
> > > > > > > > msgid "_register_disclaimer"
> > > > > > > > msgstr "TOODOO"
> >
> > > > > > > > i create many multilang apps and i believe it could be major
> > > speed
> > > > > > > > boost for ppl like me.
> > > > > > > > we dont need to update these files manually every time we use
> > > __().
> > > > > we
> > > > > > > > just run script when app is ready or changed and just update
> > > TOODOO
> > > > > > > > strings or send them to translators.
> >
> > > > > > > > If some1 came up with idea how this could be easly done i
> would
> > > > > > > > apreciate this.
> >
> > > > > > > > regular expressions? if so, how to build fault free one?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to