I'm using setlocale to display dates in Russian.
setlocale(LC_TIME, 'ru_RU');
My question is, will ru_RU be enough or is it safer to provide a number of alternative language params?
Well, you want dates in Russian, you've set the locale for time-related functions to ru_RU
, so that's basically it.
I'd advise you to set the current locale as a secondary choice for LC_TIME
, in case ru_RU
is not available :
setlocale(LC_TIME, 'ru_RU', setlocale(LC_TIME, '0'));
// setlocale() with '0' will return the current settings without applying changes.
The current locale setting was set by the system administrator, and it is very unlikely to go unavailable.
setlocale() affects a lot of things you should answer yourself if these things covers your needs.
It has two params setlocale ( int $category , array $locale )
$ategory
can be(from manual) set to one of these constants:
Also look at this quote from manual:
Returns the new current locale, or FALSE if the locale functionality is not implemented on your platform, the specified locale does not exist or the category name is invalid.