| 11 | | In {{{get_available_languages()}}}: |
| 12 | | |
| 13 | | {{{ |
| 14 | | /** |
| 15 | | * Get all available languages based on the presence of *.mo files in a given directory. The default directory is WP_LANG_DIR. |
| 16 | | * |
| 17 | | * @since 3.0.0 |
| 18 | | * |
| 19 | | * @param string $dir A directory in which to search for language files. The default directory is WP_LANG_DIR. |
| 20 | | * @return array Array of language codes or an empty array if no languages are present. Language codes are formed by stripping the .mo extension from the language file names. |
| 21 | | */ |
| 22 | | function get_available_languages( $dir = null ) { |
| 23 | | $languages = array(); |
| 24 | | |
| 25 | | foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) { |
| 26 | | $lang_file = basename($lang_file, '.mo'); |
| 27 | | if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) && |
| 28 | | 0 !== strpos( $lang_file, 'admin-' )) |
| 29 | | $languages[] = $lang_file; |
| 30 | | } |
| 31 | | |
| 32 | | return $languages; |
| 33 | | } |
| 34 | | }}} |
| 35 | | |
| 36 | | Do you have proper {{{*.mo}}} files for the languages you want? |
| 37 | | Are they being loaded properly? |
| | 11 | The value should be IN the array, not excluded - attached patch |