开发者

[cakephp][l10n] merge language file (.po) in cakephp

开发者 https://www.devze.com 2023-03-11 05:15 出处:网络
i am using cakephp 1.2, i have 2 language file, english and chinese, english is default language. i h开发者_JS百科ave a problem here, if the message id not exist in chinese language, it will display o

i am using cakephp 1.2, i have 2 language file, english and chinese, english is default language. i h开发者_JS百科ave a problem here, if the message id not exist in chinese language, it will display out the message id. Is it possible i get from default language if message id not exist in the current language po file?


The common paradigm is to use the default language as the language file keys like:

<h2>__('Posts')</h2>

Where the English language file may not define any translations, and the Chinese could define them all, or none. If the system doesn't find a matching key in the current language po file, it will simply use the key passed to the __() method. So in the above case, if no language file had a Posts key then it would simply output Posts.

0

精彩评论

暂无评论...
验证码 换一张
取 消