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

Ambiguity issue of 'zh-CN' vs 'zh' for chinese chars. #44

Open
sagarjunnarkar opened this issue Jul 27, 2018 · 2 comments
Open

Ambiguity issue of 'zh-CN' vs 'zh' for chinese chars. #44

sagarjunnarkar opened this issue Jul 27, 2018 · 2 comments

Comments

@sagarjunnarkar
Copy link

Issue ->
EasyTranslate.translations_available.include?(EasyTranslate.detect('简体中文')) => false

Reason ->
EasyTranslate.translations_available returns array with language codes. For Chinese it returns 'zh'

EasyTranslate.detect('简体中文') => 'zh-CN'

But EasyTranslate::LANGUAGES.include?('zh-CN') => true

Why like this? and what is solution?

@seejohnrun
Copy link
Owner

Hello @sagarjunnarkar !

I'm a bit confused about what the issue is here - can you describe a bit more in detail please?

@SagarJunnarkar-Edmodo
Copy link

@seejohnrun

Chinese translation have 2 codes - zh-CN and zh. This makes confusion.
.detect method returns zh-CN for Chinese language.
But this code(zh-CN) is not present in list of .translations_available.
The .translations_available method have zh code for chinese translation.

I think .translations_available this should have zh-CN too.

OR
.detect method should return zh so that below statement will return true.
EasyTranslate.translations_available.include?(EasyTranslate.detect('简体中文')) => false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants