I’m not completely sure whether this is what you want, but if the option page is in one language you can simply put the gettext call in the custom field itself to avoid using variables. For the admin you force the translation to spanish:
function wpse227983_force_language ( $locale ) {
if ( is_admin() ) {
return 'es_ES';
}
return $locale;
}
add_filter( 'locale', 'wpse227983_force_language' );
On the frontend the messages will then be translated in the normal way, supposing that you have a system in place that determines what the language of the page is. If the author sets a custom field for the language, you can use the above filter with a different if
to force the translation.
Related Posts:
- HTML inside __() or _e() language translation string
- Change language by clicking a button
- Setting WPLANG from a plugin
- Titles in my sidebar widget appear in all languages – with qtranslate
- Translations does not work with .pot file
- WordPress For Urdu Language
- ‘Trick’ a plugin (WP-Members) to think the blog language has changed for a single page
- Translating my custom theme, always translated version?
- Website in multiple Language
- WPML language tags (Qtranslate feature) [closed]
- WordPress Translation to french, at -> à not working
- Transposh Japanese language transaltion not showing up
- Setting WPLANG from a plugin
- Translation not working in sprinf variable
- Translate placeholder text in search field
- Best WordPress Multi-language Plugin? [closed]
- How to debug failed load_theme_textdomain()?
- why is translation not working on theme?
- Changing the language of a single page
- WPML: getting page title in different language
- Having two different versions of the same post?
- What is better for wordpress performace?
- Make a custom theme translate-ready
- 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?
- One of the messages in .po file doesn’t show up
- Qtranslate + Advanced Custom Fields: how to have a multilanguage wysiwyg editor? [closed]
- Insights into WordPress Multi-Site, Domain Mapped, and Multilanguage site using WPML [closed]
- Get Polylang available languages on admin page of my plugin [closed]
- How to tell a theme to use different .mo and .po files?
- Polylang get non-current language/s
- Why isn’t WMPL correctly redirecting users based on browser language? [closed]
- How to find a language direction?
- How to have english digits in some posts with an rtl WordPress theme
- Two different domains for two different languages
- Prepare plugin options for multi-lingual support
- How to set up WPLANG in wp-config.php for 4 languages?
- Were the language toggles removed from WP recently?
- WordPress Multilingual Theme using Multisite
- How to add LTR to a custom theme which in RTL by default
- make a mulitingual wordpress website Arabic-english
- conditional (theme) language selection at ‘runtime’
- Simple Multilanguage Switcher
- How to make a wordpress site multilingual by uploading a translated CSV file that has the traslations?
- can’t change a few lines of text to another language
- Country switcher, then option to choose language for that country [closed]
- Specific content by country in multiple languages
- WordPress Multilinigual
- how to remove language selection option from wordpress?
- Localization: I want the backend: english and frontend in defined language
- 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?
- WPML customizing language selector [closed]
- qtranslate arabic shortcode?
- Can I set is_rtl() to true?
- WordPress in 3 languages
- Can the qTranslateX-Plugin translate non-article text? [closed]
- How to translate wordpress backend to another language
- Translate a theme with a PO file
- 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
- Translation for a text that is not printed on the screen
- 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?
- how to change fonrs for Indian reqgional language?
- Load custom translation in custom plugin fails
- Qtranslate-X get raw post title value
- Language setting for Specific WordPress Page
- How to add language tags like “” in just some certain pages?
- 2 languages, 3 domains
- phantom language switcher
- Interface translation without plugins
- Polylang plugin translation problems
- Is there a way to ensure browser automatically translates page content to another language (via Google Translate)?
- 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?
- How to load rtl.css file without changing lanuage to persian in wordpress?
- Theme isn’t multilanguage ready. How can i still add a second language to the site?
- Which language files are loaded?
- Having a two language website
- What are the downsides to uploading filenames in different languages?
- Set language from url?
- get_categories only getting categories in the main language
- 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
- Website Language/Locale Switching
- How to make WP in two languages (e.g. English & Bengali) without plugins