You can add your own CSS rules to customize the language button. Weglot automatically adds a button in your page, that is either a dropdown or a list and will look like this:
You can use these classes to add your own rules. For example adding this in "Override CSS" to make the language name uppercase. :
.country-selector a {
text-transform: uppercase;
}
Override CSS on the WordPress back office
You can add your custom CSS rules directly on your WordPress back office. To do that, connect you on your WordPress and go to: Weglot > Language button design (Optional) > Override CSS
Override CSS using WordPress Hook
This filter allows you to add custom CSS style by default without going through the settings.
By default, the Weglot plugin loads the stylesheet /wp-content/plugins/weglot/dist/css/front-css.css. If you would prefer not to load the Weglot stylesheet, you can use the WordPress wp_enqueue_scripts filter as such:
If you use the language selector in a menu with the "dropdown" option activated, then the title of the selector in the menu will be "Choose your language" in English. To change this text, you can edit the plugin's translation files, or use the following hook:
<?php
add_filter( 'weglot_menu_parent_menu_item_title', 'custom_weglot_menu_parent_menu_item_title' );
function custom_weglot_menu_parent_menu_item_title( $title ) {
switch ( weglot_get_current_language() ) {
case 'en':
$title = 'Choose your language please';
break;
case 'fr':
$title = 'Choisissez votre langue s\'il vous plaît';
break;
}
return $title;
}
Add class current-menu-item for language selector in menu
If you use the language selector in a menu and you want the class "current-menu-item" to be present on the link of the current page in the selector, you must use the "weglot_active_current_menu_item" filter as follows:
If you use the auto-redirect option, you've to add replace no_lredirect with wg-choose-original in the code. If you don't do this you can't be enable to reach your original language.