| | 30 | } |
| | 31 | |
| | 32 | /** |
| | 33 | * Set system locale. |
| | 34 | * |
| | 35 | * The problem is that every platform has its own way to designate a locale, |
| | 36 | * so for German you could have 'de', 'de_DE', 'de_DE.UTF-8', 'de_DE.UTF-8@euro' |
| | 37 | * (Linux) or 'DEU' (Windows), etc. |
| | 38 | * |
| | 39 | * @todo: This setting should probably be stored in the language files. |
| | 40 | * |
| | 41 | * @param string... $locale The locale(s) to set. They will be tried in order. |
| | 42 | * @return string the locale that was picked, or FALSE if an error occurred |
| | 43 | */ |
| | 44 | public static function set_system_locale() |
| | 45 | { |
| | 46 | if ( func_num_args() == 0 ) return; |
| | 47 | $args= func_get_args(); |
| | 48 | array_unshift( $args, LC_ALL ); |
| | 49 | |
| | 50 | return call_user_func_array( 'setlocale', $args ); |