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?
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.