Laravel-Lang / lang

List of 126 languages for Laravel Framework, Laravel Jetstream, Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova, Laravel Spark and Laravel UI.
https://laravel-lang.com/packages-lang.html
MIT License
7.49k stars 3.04k forks source link

ISO 15897 format of country specific locales #1269

Closed bjoerne2 closed 4 years ago

bjoerne2 commented 4 years ago

On https://laravel.com/docs/7.x/localization it says:

For languages that differ by territory, you should name the language directories according to the ISO 15897. For example, "en_GB" should be used for British English rather than "en-gb".

Wouldn't it be better to rename the country specific folders, e.g. de-CH -> de_CH?

caouecs commented 4 years ago

Good idea, we need to do a new major version ( v7 ), because we brake directory names...

Can you do a pull request ?

bjoerne2 commented 4 years ago

I created a PR: https://github.com/caouecs/Laravel-lang/pull/1276

caouecs commented 4 years ago

Can I have references for language names ? As sr_Cyrl

caouecs commented 4 years ago

My problem is for sr_Cyrl, sr_Latn, uz_Cyrl and uz_Latn.

andrey-helldar commented 4 years ago

Either I read the technical documentation poorly, or in the description of the ISO 15897:1998 standard there is no mention of the rules for naming language localizations. Standard ISO 15897:2011 is paid ($168...) 😐

I may be wrong, but I want to propose to call it this way:

de_CH
pt_BR
...
sr_Cyrillic
sr_Latin
uz_Cyrillic
uz_Latin
caouecs commented 4 years ago

done

Thank you

milose commented 3 years ago

If you list the php Intl locales, we have a specific list of locales and the naming should be followed.

 collect(ResourceBundle::getLocales(''))->filter(fn($i) => Str::startsWith($i, 'sr'))
=> Illuminate\Support\Collection {#3268
     all: [
       672 => "sr",
       673 => "sr_Cyrl",
       674 => "sr_Cyrl_BA",
       675 => "sr_Cyrl_ME",
       676 => "sr_Cyrl_RS",
       677 => "sr_Cyrl_XK",
       678 => "sr_Latn",
       679 => "sr_Latn_BA",
       680 => "sr_Latn_ME",
       681 => "sr_Latn_RS",
       682 => "sr_Latn_XK",
     ],
   }

Meaning that sr_Latin, me, etc; locale folders you have are invalid.

Note, I am from Montenegro and I use sr_Latn_ME nomenclature, when I develop.

andrey-helldar commented 3 years ago

@caouecs, Since the ISO 15897:2011 standard does not regulate the naming of these localizations, I think @milose's proposal is reasonable.

caouecs commented 3 years ago

no problem for me

andrey-helldar commented 3 years ago

no problem for me

I created a PR https://github.com/Laravel-Lang/lang/pull/1453, but @LukaLatkovic must review, since he is referent for the sr_* languages.

LukaLatkovic commented 3 years ago

So, that means that me folder should be renamed to sr_Latn_ME

LukaLatkovic commented 3 years ago

@caouecs, Since the ISO 15897:2011 standard does not regulate the naming of these localizations, I think @milose's proposal is reasonable.

This proposal is done by Unicode standard(International Components for Unicode), so maybe we can do locales based on that standard List of all locales by Unicode, Simple search since Php Intl is based on that @caouecs, @andrey-helldar what do you think?

milose commented 3 years ago

We are web developers here and this is a Laravel oriented package. With this I mean to say that the directory of the locale should be named in a way so it can be consumed app()->getLocale() method.

Laravel workflow is:

  1. you set the 'locale' in app.php
  2. you use the <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> to set the language contained in your HTML output (important for search engines, automatic translations, screen readers etc.
  3. you consume other packages with the correct locales like Carbon (their Lang folder) with ease.

Introducing other names, that are not standardised on the web means we need to "translate" locale names for other packages, html attributes etc. This is not ideal and the correct nomenclature should be used.

BTW, the translation for Montenegrin language is atrocious. I will make a pull request for the correct translation after this is resolved.

andrey-helldar commented 3 years ago

@caouecs, Since the ISO 15897:2011 standard does not regulate the naming of these localizations, I think @milose's proposal is reasonable.

This proposal is done by Unicode standard(International Components for Unicode), so maybe we can do locales based on that standard List of all locales by Unicode, Simple search since Php Intl is based on that @caouecs, @andrey-helldar what do you think?

Taylor introduced the ISO 15897:2011 standard into the framework and I think we don't need to violate it.

If proposals for adjustments do not contradict him, then they can be considered.

milose commented 3 years ago

Taylor introduced the ISO 15897:2011 standard into the framework and I think we don't need to violate it.

Sauce, please? @andrey-helldar

andrey-helldar commented 3 years ago

Taylor introduced the ISO 15897:2011 standard into the framework and I think we don't need to violate it.

Sauce, please? @andrey-helldar

You mean proof?

image

And my PR: https://github.com/Laravel-Lang/lang/pull/1453

milose commented 3 years ago

Thanks @andrey-helldar I missed that.

andrey-helldar commented 3 years ago

@milose, a few days ago, we released a new major version of the package taking into account these changes. You can independently monitor the update of files in your project or use a manager. For example, this one.

caouecs commented 3 years ago

@milose, a few days ago, we released a new major version of the package taking into account these changes. You can independently monitor the update of files in your project or use a manager. For example, this one.

for example... ;)