Yii Framework Forum: fallback when searching for translations - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

fallback when searching for translations Rate Topic: -----

#1 User is offline   sidewinder 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 218
  • Joined: 08-July 09
  • Location:Poland

Posted 18 November 2011 - 07:35 AM

Hi,
I would like to see some kind of fallback mechanism when translation messages and views are searched for. According to documentation and function comments we are encouraged to use canonical ll_RR format (l - language, R-region). That's great, because we can benefit from CLDR localization data. However, one may want to use exactly the same translation for 2 or more different regions and in such case we have to create either copies of the same files or symlinks.
For example pl_pl, sk_sk, en_gb, en_nz and en_us locales may be used by application. Now I have to create views folders like this:
pl_pl
sk_sk
en
en_gb->en (symlink)
en_nz->en (symlink)
en_us->en (symlink)

so I can benefit from both i18n and l10n. It would be much easier if in case when canonical folder/file name is not found, language only code is looked for. In such case I could set only en, pl and sk directories without creating symlink for every region given language is spoken in.
Also in case when we do have different translations for different locales fallback mechanism would help a lot, because there are always some common parts, which can land in language code only directory, and rest in their own canonical form named folders...
---------------------------------------------------------------------
"Never memorize what you can look up in books."
Albert Einstein
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users