This method should work even with non-standard locales:
$locale="someWeirdLocale";
putenv('LC_MESSAGES=' . $locale);
bindtextdomain('domain', './locale');
textdomain('domain');
Enjoy!
More Related Contents:
- PHP Localization Best Practices? gettext?
- PHP function to make slug (URL string)
- List of All Locales and Their Short Codes?
- Whether to use “SET NAMES”
- Storing and displaying unicode string (हिन्दी) using PHP and MySQL
- Best practice multi language website
- Using the PHP HTTP_ACCEPT_LANGUAGE server variable
- PHP: Locale aware number format
- How to clear php’s gettext cache without restart Apache nor change domain?
- Is there a way to get the list of available locales in PHP?
- Internationalization in PHP
- Send emails with international accent and special characters
- PHP Localization Question
- Yii2 translation does not work
- Best way to internationalize simple PHP website
- HTML Table parsing in PHP Error
- PHP random string generator
- MySQL query to get column names?
- How do I access this object property with an illegal name?
- Insert/update helper function using PDO
- PHP string concatenation [duplicate]
- How do I sort a multidimensional array by one of the fields of the inner array in PHP? [duplicate]
- How do I add exif data to an image?
- Populate another select dropdown from database based on dropdown selection
- Display float value w/o scientific notation
- make switch use === comparison not == comparison In PHP
- PHP GET Request, sending headers
- MATLAB executable is too slow
- Implementing a simple lookup array
- Allow users to download files outside webroot