easy_translate
easy_translate copied to clipboard
Ambiguity issue of 'zh-CN' vs 'zh' for chinese chars.
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?
Hello @sagarjunnarkar !
I'm a bit confused about what the issue is here - can you describe a bit more in detail please?
@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
.