On Apr 18, 10:19 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> 2008/4/17 robert123 <[EMAIL PROTECTED]>:
> >  Hi, I want to develop website using cakephp in Chinese and English
> >  using utf8 encoding  I am trying to use cakephp 1.2 version, I have
> >  been searching around the web on the docs on i18n, but it is rather
> >  scatter, below are a few problems where I have difficulties, hopefully
> >  anyone can help me, thank you
>
> >  1." .po files should be encoded using ISO-8859-1", this is a nightmare
> >  maintenance for Chinese character, reason being once it is in
> >  iso-8859-1 format, if you want to change any messages, the messages
> >  cannot be seen easily, example 我 is me in chinese, but if you store it
> >  in  ISO-8859-1 encoding it is \u6211, hence it becomes very hard to
> >  hunt down the words in message file, but it will be different if it is
> >  store in UTF8 encoding, as the Chinese character can be store, edit,
> >  view naturally as it is, anyone can highlight any solution to this ?
> >  like A good editor to convert these eastern characters to the correct
> >  encoding, or making cakephp read utf8 encoding po file?

    There is no such restriction; you can use utf8. po/mo based i18n
solution is hectic for client projects; every clients prefer to edit
the language contents. Apparently i18n in Cake has more miles to go,
IM*H*O.

> >  2. Another problem , take an example a product table that has
> >  id, title and description field
> >  there is a product in english and chinese, how do you with the chosen
> >  language pick up the correct product in database in that language,
> >  other than using another lookup table.
>
> Have a look at this implementation by ros (Rostislav):
>
> http://www.palivoda.eu/2008/04/i18n-in-cakephp-12-database-content-tr...
>
> In a nutshell, you create multiple columns per language. So, instead
> of "name" you'd have "name_eng" & ("name_" + whichever code you need
> for your Chinese).

   I second this solution. But, I'd want to avoid the unnecessary lang
code suffix on default field.

> Actually, that should really be "name_en" for English, but CakePHP
> goes against the ISO spec on this.

    ISO spec has lot of revisions and versions
http://www.loc.gov/standards/iso639-2/php/code_list.php

> Anyway, this looks like a better implementation than the default,
> which is to dump everything, regardless of the model, into a single
> "i18n" table.

     I strongly believe that no one would use default implementation

> >  3. Lastly is the error message for validation of users inputs, I
> >  search the  new Forms built in helper, doesnt seem to tell us how to
> >  show the different language depending on the user locale

     http://groups.google.com/group/cake-php/web/faq

> >  4. I am thinking also does caching actually works with i18n, reason
> >  being you execute
>
> >  $this->L10n = new L10n();
> >  $this->L10n->get("en");
> >   Configure::write('Config.language', "en");
> >  , but let say you have the webpage cache seperately english and
> >  chinese, how does it recognize which one to pickup?
>
> I hope you find the answer to this. I've asked the same question here
> without a response. There's a mechanism, apparently, to prefix the
> cache filename but I could not get it to play nice.

     Look for the second param in $this->element()--when used, it
might be sufficient (though not reserved for that purpose).

--
  <?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com    Blog: http://rajeshanbiah.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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