unitracer/country-to-locale

This package is abandoned and no longer maintained. No replacement package was suggested.

Converts country code to locale code.

v1.1.0 2021-01-12 09:00 UTC

This package is not auto-updated.

Last update: 2021-04-08 07:45:15 UTC


README

Based on peterkahl/country-to-locale, but that repository disappeared. Determine locale from 2-letter country code. (Can be used as language code.)

Usage

use UniTracer\Locale\Locale;

echo Locale::countryToLocale('DE'); # 'de_DE'

echo Locale::countryToLocale('CN'); # 'zh_CN'