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?

I'm unaware of any such limitation. But I'm dealing with chars that
are mostly in 8859-1 so it's not something I would have necessarily
noticed.

>  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-translation-part-2/

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).

This is similar to something I've already been doing but is far more robust.

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

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


>  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

Please search this group for that. It's been brought up a few times
very recently.

>  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.

--~--~---------~--~----~------------~-------~--~----~
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