Open maity-kgz opened 8 years ago
@maity-kgz This bundles uses symfony/intl
which uses ISO 639-1. Not sure how to deal with this issue though.
there seem to be other issues with the data symfony/intl is using: https://github.com/symfony/symfony/issues/12583
no idea however if things could be customized/extended/overridden to work around this, or how the root cause could be solved, sorry.
Symfony is merely a consumer of data provided by ICU. According to ICU, kg
is a language code for Kongo, while ky
is a language code for Kyrgyz. These are ISO-639-1 codes used by Symfony:
The "value" for each locale is either the two letter ISO 639-1 language code (e.g. fr), or the language code followed by an underscore (_), then the ISO 3166-1 alpha-2 country code (e.g. fr_FR for French/France).
@maity-kgz by using kg
you're telling Symfony to use Kongo language. You should either use ky
or ky_KG
. It appears to be a valid locale for Kyrgyztan. Locale for Kayman Islands is en_KY
.
@jakzal all you said is valid for Symfony2 forms but not to this issue. Thing is that using ky_KG is not solve the issue. Because LocalBundle is not support that type of code.
What do you mean it's not supported?
The following code returns Kyrgyz (Kyrgyzstan)
:
echo \Symfony\Component\Intl\Intl::getLocaleBundle()->getLocaleName('ky_KG');
Just realised you were talking about LocaleBundle from this repository. I never used it and perhaps it needs fixing (maybe it confuses the country code with locale). I only explained there's nothing wrong with Symfony's components (as this issue was linked to the Symfony's issue).
thanks @jakzal
@maity-kgz if you have time to dig though this with the pointers jakub gave, i am glad to help reviewing a pull request to fix this. if we do any duplication in here where we could use the symfony intl component, we should go for symfony intl...
If I configure locales in Symfony CMF app/config/parameters.yml with "kg" country code which stands for Kyrgyzstan according to ISO 3166-1 alpha-2 standard than in LocaleBundle switcher i get Congo country which is totally wrong, but in admin panel SonataTranslationBundle shows correct flag of Kyrgyzstan.
I figured out that LocaleBundle uses "ky" code for Kyrgyzstan but according to ISO 3166-1 alpha-2 standard this code is for Cayman Islands. If I use "ky" locale in app/config/parametes.yml than LocaleBundles switcher shows correct Kyrgyzstan but in admin SonataTranslationBundle shows me Cayman Islands flag.
used default params for LocaleBundle: