Well I will guarantee that the filter remains but this might not be the way we choose to handle it longer term. We are actually thinking of maybe giving it a little admin UI to make things easier. But this will work now.
The first file to edit is – by default –
wp-content/sp-resources/forum-plugins/user-selection/template-tags/sp-user-selection-tags.php
Locate the block of code that looks like this (in the languages section):
foreach ($langs as $lang) {
$lang = str_replace('sp-', '', trim($lang));
$selected = (isset($_COOKIE['language']) && $lang == $_COOKIE['language']) ? ' selected="selected" ' : '';
$out.= '<option'.$selected.' value="'.esc_attr($lang).'">'.esc_html($lang).'</option>';
}
and replace it with the following, Note there is one new line of code and one other has been modified:
foreach ($langs as $lang) {
$lang = str_replace('sp-', '', trim($lang));
$display = apply_filters('sph_LanguageDisplay', $lang);
$selected = (isset($_COOKIE['language']) && $lang == $_COOKIE['language']) ? ' selected="selected" ' : '';
$out.= '<option'.$selected.' value="'.esc_attr($lang).'">'.esc_html($display).'</option>';
}
Then finally you need to define a filter function in the spFunctions.php file of your Simple:Press theme. This will be in the /templates folder. This should look something like this:
add_filter('sph_LanguageDisplay', 'my_Lang_Names');
function my_Lang_Names($lang) {
if($lang == 'it') {
$lang = 'Italian';
} elseif ($lang == 'fr') {
$lang = 'French';
} elseif ($lang == 'de') {
$lang = 'German';
return $lang;
}
Of course you will need to supply the language codes that you are actually using and the country names you prefer to use. Define as few or as many as you need but this gives you a coding template to work with.
I am afraid this will not remove the English entry. That will have to come later I am afraid.