cakephp / localized

I18n and L10n related CakePHP code
Other
214 stars 179 forks source link

Ukrainian language code uk #198

Closed yarkm13 closed 4 years ago

yarkm13 commented 4 years ago

I just realized that CakePHP itself (cakephp/localized) uses 'ua' for Ukrainian and it is impossible to use both plugin's and cakephp/localized localization in case localization for plugin correctly uses uk for Ukrainian because it's impossible to set more than one defaultLocale.

Code uk for Ukrainian language is correct because all this locale stuff goes back to gettext that relies to ISO 639 two-letter language code

My suggestion is rename resources/locales/ua to resources/locales/uk but keep UaValidation.php as refers to Ukraine as country which code is UA according to gettext appendix ISO 3166 two-letter country code and also keep for a while UkValidation.php linked to GbValidation.php as @deprecated which is current state. And UaValidation.php is still usable as far as defaultLocale indiferrent and used manually

$validator->setProvider('ua', 'Cake\Localized\Validation\UaValidation');

It's also possible to use resources/locales/uk_UA to minimize disambiguation with that Uk->Gb part. uk_UA is correct either and will work for both defaultLocale setting uk or uk_UA