_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
- Change language by clicking a button
- Setting WPLANG from a plugin
- Best WordPress Localization Plugin? [closed]
- qTranslate get content by language [closed]
- How to determine current active language in qtranslate 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
- detect the language a post is written in
- 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
- Making a theme multilingual by adding a custom taxonomy to posts and pages called “Languages”?
- One of the messages in .po file doesn’t show up
- Multi-language module in WordPress or Google sites
- Translations does not work with .pot file
- Put an extra check box on “Page Attributes” widget
- Trigger language change in WordPress
- 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]
- How to change language?
- 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
- What is the correct way for multi-domain and multi-language website?
- How to change the language of the ‘Reset Password’ page
- How to reload wordpress textdomains at runtime
- Two language versions for each article
- How can I make a site viewable in multiple languages?
- How to set up WPLANG in wp-config.php for 4 languages?
- Using categories as multilingual mechanism
- ‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page
- Were the language toggles removed from WP recently?
- WPML Default Language User Meta [closed]
- Is it possible to temporarily override the language setting?
- make a mulitingual wordpress website Arabic-english
- How to use language files in plugins?
- How to find when qtranslate plugin’s language changes? [closed]
- 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 have multiple site (UI) languages?
- How to make a wordpress site multilingual by uploading a translated CSV file that has the traslations?
- How to translate WordPress Emails?
- 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?
- Hook in to add new post link wp admin?
- Get the ID of the default language equivalent page in Polylang [closed]
- Switch site language to en_ZA
- 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?
- WPML – 404 Error when I try to pass GET parameters in my “different languages in directories” installation
- Translating my custom theme, always translated version?
- WordPress and Localization
- Website in multiple Language
- qtranslate arabic shortcode?
- Problems character encoding for pages in multiple languages
- Can I set is_rtl() to true?
- WordPress in 3 languages
- ACF Content with WPML not saving [closed]
- Changing interface language without multisite
- 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?
- How to create posts or pages with the names in wordpress?
- 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