jenssegers / date

🗓 A library to help you work with dates in multiple languages, based on Carbon.
https://jenssegers.com
MIT License
1.81k stars 244 forks source link

[QUESTION] What is the language name of each file? #301

Closed hAbd0u closed 4 years ago

hAbd0u commented 6 years ago

Hello, This is not an issue or some thing like that, I just need those days translation but unfortunately for some files I am confused of what is the language of each file. Can you please add at the top file the language name?

kylekatarnls commented 6 years ago

It's an ISO norm: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

kylekatarnls commented 5 years ago

Now with Carbon 2, you can get many informations about a locale (language name, native name, region, etc.) via the Language class:

echo (new \Carbon\Language('zh_CN'))->getIsoName();
hAbd0u commented 5 years ago

@kylekatarnls Can I query for the available languages supported using this class?

kylekatarnls commented 5 years ago
var_dump(Carbon::getAvailableLocalesInfo()); // Array of Language+region instances with translations in Carbon
var_dump(Carbon::getAvailableLocales()); // Array of string with translations in Carbon
var_dump(Language::all()); // Array of Language instances all languages in ISO 639-2

https://carbon.nesbot.com/docs/#translator-details