Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yii\i18n\PhpMessageSource::loadMessages #7883

Closed
endachao opened this issue Mar 26, 2015 · 8 comments
Closed

yii\i18n\PhpMessageSource::loadMessages #7883

endachao opened this issue Mar 26, 2015 · 8 comments
Assignees
Labels

Comments

@endachao
Copy link

log:

The message file for category 'yii' does not exist: /Applications/MAMP/htdocs/phpcto/trunk/application/admin/vendor/yiisoft/yii2/messages/zh/yii.php
web.php 
    'language' => 'zh_CN',

What reason is this error?

PhpMessageSource 

:72 line
protected function loadMessages($category, $language) 

// Why the truncation
$fallbackLanguage = substr($language, 0, 2);

zh_CN => zh 

message /  
zh 
 This folder is not useful

@samdark
Copy link
Member

samdark commented Mar 26, 2015

It tries zh_CN then if it doesn't exist it tries to fallback to zh. Same for all languages: en_US -> en, en_AU => en etc. It's strange that it goes to fallback for you. Probably messages for zh_CN are a bit outdated.

@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Mar 26, 2015
@samdark samdark self-assigned this Mar 26, 2015
@samdark samdark added this to the 2.0.x milestone Mar 26, 2015
@endachao
Copy link
Author

zh_CN This file is present

@lynicidn
Copy link
Contributor

what is sourceLanguage u have? also zh?

@cebe
Copy link
Member

cebe commented Mar 26, 2015

Note that the file in yii2\messages is zh-CN not zh_CN, maybe thats a problem? Guess we need a normalization for the locale. Same fix might need to be applied here: https://github.com/yiisoft/yii2-jui/blob/master/DatePicker.php#L152

@endachao
Copy link
Author

@cebe yes good !

@samdark
Copy link
Member

samdark commented Apr 9, 2015

@cebe ICU locale could be quite precise such as fr@collation=phonebook;calendar=islamic-civil. Any suggestion on where to put method extracting language from it?

@cebe
Copy link
Member

cebe commented Apr 11, 2015

yii\i18n\I18N would be a good place imo.

@ghost
Copy link

ghost commented Sep 23, 2018

This issue was moved by samdark to yiisoft/yii-core#36.

@ghost ghost deleted a comment from samdark Sep 23, 2018
@ghost ghost closed this as completed Sep 23, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants