In Java, you can call Locale.getAvailableLocales()
to get the list of available locales.
I was expecting an equivalent from the PHP Locale class, but co
you normally need only locales that compatible with UTF-8 to use it in html
thus, the ResourceBundle is useless, but you still can call it like this
\ResourceBundle::getLocales('')
to be sure how useless it is.
So, you need to get a list of what supported by your Ubuntu (because Ubuntu is what you need)
$string = shell_exec("locale -a|grep .utf8");
$array = explode('.utf8' . "\n", $string);
you will get things like en_US
, ru_RU
, zh_CN
- whatever you installed on your ubuntu. Now take one and use it like so
$locale = $array[0].'.UTF-8';
setlocale(LC_MONETARY, $locale);
but you can install more locales
on your Ubuntu