Obtain a list of available translations

You can get a list of available languages with get_available_languages( $dir ). It returns an array with all .mo files where the names does not start with 'continents-cities', 'ms-' or admin-.

To get a readable name for the file use format_code_lang( $code ).

If you scan a directory for language files and get an array like array( 'de_DE', 'tr_TR' ) this function will build translated names for the languages: German and Turkish.

Leave a Comment