Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Uplift › WPML selector languages
New Landing › How can we help? › Themeforest Theme Support › Uplift › WPML selector languages
- This topic has 5 replies, 2 voices, and was last updated 8 years by Mohammad – SUPPORT.
-
Posted in: Uplift
-
July 19, 2016 at 4:59 pm #282399
Hi,
I’m using WPML with the language selector native of the theme.
Is it possible to have the name of language exactly translated into the native language?
(view attachment)Thank you very much
Attachments:
You must be logged in to view attached files.July 20, 2016 at 8:54 am #282531Hi,
I see your language switcher different from screenshot image. Have you managed to resolve the issue? Just check the attachment.
Thanks
MohammadAttachments:
You must be logged in to view attached files.July 20, 2016 at 12:03 pm #282615Hi Mohammad,
unfortunately I have not solved.Maybe you did not understand my problem… and maybe I have not explained (my english is bad ๐
Currently if the Web site is displayed in Italian, the languages selector displays:
– Italiano
– Spagnolo
– IngleseCurrently if the Web site is displayed in English, the languages selector displays:
– Italian
– Spanish
– EnglishCurrently if the Web site is displayed in Spanish, the languages selector displays:
– Italiano
– Espanol
– InglesI would that the language selector always displays in native languages. As below:
– Italiano
– Espanol
– EnglishThank you
MarcoJuly 20, 2016 at 6:12 pm #282734Hi,
Please paste this code at functions.php of child theme.function sf_language_flags() { $language_output = ""; if ( function_exists( 'pll_the_languages' ) ) { $languages = pll_the_languages(array('raw' =>1 )); if ( !empty( $languages ) ) { foreach( $languages as $l ) { $language_output .= '<li>'; if ( $l['flag'] ) { if ( !$l['current_lang'] ) { $language_output .= '<a href="'.$l['url'].'"><img src="'.$l['flag'].'" height="12" alt="'.$l['slug'].'" width="18" /><span class="language name">'.$l['name'].'</span></a>'."\n"; } else { $language_output .= '<div class="current-language"><img src="'.$l['flag'].'" height="12" alt="'.$l['slug'].'" width="18" /><span class="language name">'.$l['name'].'</span></div>'."\n"; } } $language_output .= '</li>'; } } } else if ( function_exists( 'icl_get_languages' ) ) { $languages = icl_get_languages( 'skip_missing=0&orderby=code' ); if ( ! empty( $languages ) ) { foreach ( $languages as $l ) { $language_output .= '<li>'; if ( $l['country_flag_url'] ) { if ( ! $l['active'] ) { $language_output .= '<a href="' . $l['url'] . '"><img src="' . $l['country_flag_url'] . '" height="12" alt="' . $l['language_code'] . '" width="18" /><span class="language name">' . $l['native_name'] . '</span></a>' . "\n"; } else { $language_output .= '<div class="current-language"><img src="' . $l['country_flag_url'] . '" height="12" alt="' . $l['language_code'] . '" width="18" /><span class="language name">' . $l['native_name'] . '</span></div>' . "\n"; } } $language_output .= '</li>'; } } } else { //echo '<li><div>No languages set.</div></li>'; $flags_url = get_template_directory_uri() . '/images/flags'; $language_output .= '<li><a href="#">DEMO - EXAMPLE PURPOSES</a></li><li><a href="#"><span class="language name">German</span></a></li><li><div class="current-language"><span class="language name">English</span></div></li><li><a href="#"><span class="language name">Spanish</span></a></li><li><a href="#"><span class="language name">French</span></a></li>' . "\n"; } return $language_output; }
Thanks
MohammadJuly 21, 2016 at 11:25 am #282920Hi Mohammad,
it’s all OK!Thank you very much
๐July 21, 2016 at 1:22 pm #282977Hi,
Glad ๐ to help you.
Thanks
Mohammad -
Posted in: Uplift
You must be logged in and have valid license to reply to this topic.