设置区域设置 - 俄语

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:

  • LC_ALL for all of the below
  • LC_COLLATE for string comparison, see strcoll()
  • LC_CTYPE for character classification and conversion, for example strtoupper()
  • LC_MONETARY for localeconv()
  • LC_NUMERIC for decimal separator (See also localeconv())
  • LC_TIME for date and time formatting with strftime()
  • LC_MESSAGES for system responses (available if PHP was compiled with libintl)

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.