WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #21691, comment 4


Ignore:
Timestamp:
08/27/2012 09:45:49 PM (6 years ago)
Author:
wonderboymusic
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21691, comment 4

    initial v1  
    1 In {{{sanitize_option()}}}:
     1In {{{sanitize_option()}}} - here's the problem:
    22
    33{{{
     
    99}}}
    1010
    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?
     11The value should be IN the array, not excluded - attached patch