_e() will translate the text passed as a argument to the language your site is currently set up to use (if the translation exists).
Anyway, don’t do that. Use it for text visible on the website, not for IDs/classes etc. To create context based css rules, simply add the WPML language ID as a body class:
add_filter('body_class', 'wpml_body_class');
function wpml_body_class($classes){
return array_push($classes, ICL_LANGUAGE_CODE);
}
then style the elements you need to using something like:
.en .menu-top{
...
}
It’s faster, and you keep your code easy to maintain.
Related Posts:
- Best WordPress Multi-language Plugin? [closed]
- WPML: getting page title in different language
- Checking current language in a function
- Insights into WordPress Multi-Site, Domain Mapped, and Multilanguage site using WPML [closed]
- Why isn’t WMPL correctly redirecting users based on browser language? [closed]
- WordPress multilingual site using page-id.php files
- Country switcher, then option to choose language for that country [closed]
- Specific content by country in multiple languages
- WPML customizing language selector [closed]
- WPML language tags (Qtranslate feature) [closed]
- WordPress Translation to french, at -> à not working
- Is there a way to ensure browser automatically translates page content to another language (via Google Translate)?
- Theme isn’t multilanguage ready. How can i still add a second language to the site?
- Translate placeholder text in search field
- HTML inside __() or _e() language translation string
- Setting WPLANG from a plugin
- Best WordPress Localization Plugin? [closed]
- Titles in my sidebar widget appear in all languages – with qtranslate
- Having two different versions of the same post?
- WordPress | Sub-domain switching
- Does changing ‘WPLANG’ in wp-config.php just effect the admin language or does it have other consequences?
- WPML Get url without outputting
- Is there a way to localize role labels?
- How to add just one page in Arabic
- One of the messages in .po file doesn’t show up
- Translations does not work with .pot file
- Put an extra check box on “Page Attributes” widget
- How to change language file used by _e function
- Qtranslate + Advanced Custom Fields: how to have a multilanguage wysiwyg editor? [closed]
- Get Polylang available languages on admin page of my plugin [closed]
- Polylang get non-current language/s
- WordPress For Urdu Language
- How to find a language direction?
- How to have english digits in some posts with an rtl WordPress theme
- Getting translated string through a variable
- Two different domains for two different languages
- How to change the language of the ‘Reset Password’ page
- How to set up WPLANG in wp-config.php for 4 languages?
- Were the language toggles removed from WP recently?
- make a mulitingual wordpress website Arabic-english
- conditional (theme) language selection at ‘runtime’
- Simple Multilanguage Switcher
- A simple method for disabling WPML language switcher when meeting specific circumstances [closed]
- How to force change Network site multi language subdirectory base URL?
- Custom rewrite rules not working with WPML
- How to make a wordpress site multilingual by uploading a translated CSV file that has the traslations?
- WPML language switcher for custom rewrite rules
- can’t change a few lines of text to another language
- WordPress Multilinigual
- how to remove language selection option from wordpress?
- Get the ID of the default language equivalent page in Polylang [closed]
- Where to modify translation files by _e()
- Multilingual website without third-party plugin
- I display messages using code snippets but how can I use the right language?
- language_attributes for two languages?
- How to set a dual language site in wordpress?
- Website in multiple Language
- qtranslate arabic shortcode?
- Can I set is_rtl() to true?
- WordPress in 3 languages
- ACF Content with WPML not saving [closed]
- Transposh Japanese language transaltion not showing up
- WordPress Relative Path
- WordPress page with non-English text
- WP-e-commerce (getshopped) Hebrew language files – where can I get them? [closed]
- Redirection plugin and Chinese URLs
- Wrong WordPress language?
- WP E-commerce wpml translation or multilingual
- For multiple languages, two wordpress instances on subdomains or a plugin?
- Structure of multilingual and multiregional directory listing website for translation
- I cant test my .po file for Turkish Language
- different domains disabled in polylang
- How to enqueue 2 rtl css
- where to add this filter? in which file should be added?
- Change WooCommerce currency programmatically on AJAX request
- how to change fonrs for Indian reqgional language?
- Language setting for Specific WordPress Page
- How to add language tags like “” in just some certain pages?
- 2 languages, 3 domains
- how to remember specific action/event for current user?
- phantom language switcher
- Polylang plugin translation problems
- Multi Language and Multi Theme WordPress
- Create a custom page to use in all the sites, A multisite question
- How to use get_post_type_archive_link for a given language?
- Site doesn’t work when updating to SSL using nginx
- How to load rtl.css file without changing lanuage to persian in wordpress?
- Reuse links in a post across different languages
- Which language files are loaded?
- Having a two language website
- What are the downsides to uploading filenames in different languages?
- Setting WPLANG from a plugin
- Translation not working in sprinf variable
- Set language from url?
- get_categories only getting categories in the main language
- WPML : how to pick a featured image only once for different languages?
- How to translate the blog date in the Avada theme [closed]
- site with two diffrent menus for difftent pages?
- white space appears when switch to rtl
- How to make WP in two languages (e.g. English & Bengali) without plugins