If anyone is looking for a solution, here is a way (probably not the better one) to achieve it:
add_filter('widget_text', 'filtering_form_labels');
function filtering_form_labels($html) {
if ( ICL_LANGUAGE_CODE=='en' ) {/*ICL_LANGUAGE_CODE used in WPML to know the active language*/
$esp = array('Nombre', 'Apellidos', 'Suscribirse'); /*Array with words to be replaced*/
$eng = array('First Name', 'Last Name', 'Subscribe'); /*Array with new words*/
ob_start();
$html = str_replace($esp, $eng, $html);
ob_end_clean();
}
return $html;
}
Related Posts:
- How to get a translated string from a language other than the current one?
- How to get a localized version of WordPress from a repository?
- Working with l10n contexts (_x etc)
- How to escape the single quote character in i18n translation strings?
- How to escape single and plural i18n text strings?
- What are the most used WordPress localization?
- Difference between 2 internationalization (i18n) functions __() & _e()
- Localization works but still get “This plugin is not properly prepared for localization” msg in directory
- How to load theme textdomain from plugin?
- get_the_date() for translating date format
- Should i use _n for pronouns in translation?
- POEdit with Custom mu-plugins code
- How does WordPress choose which translation file to use?
- Proper way to create / manage gettext (.po, .pot) files?
- Should I include colon in my msgid in PO file?
- _e() function get text_string from function
- Translations not returning translated strings
- Force translated language on front
- Translating dynamic strings
- WordPress translation loading english file
- Easy export/import of data for Translation
- WordPress Theme .mo-file won’t load
- How to become a translator on wordpress.org?
- Translation from .mo file not working in theme
- Localization, escape html elements mid-sentence
- WordPress localization – gettext and git
- Can I set WordPress to display languages based on system language without a plugin?
- /languages/ folder missing in default themes
- How to translate functions.php?
- WordPress Translations
- Post types translation
- Translate arguments of a user added custom code [closed]
- Internationalize plugin so strings can be translated in WPML [closed]
- localization of theme and plugins to English (originally in another language)
- Interface translation without plugins
- Plugin localization persistance (woocommerce)
- WordPress Localization error within return value
- Custom theme .mo translation file not working
- Plugin translation not displaying
- WordPress translation
- Tweak the loop for translation
- Website Language/Locale Switching
- .po file is loaded but changes are not appearing
- Translate a plugin using .po .mo files
- Override default WordPress core translation
- How to print translation supported text with HTML URL
- How to integrate get_post_time with date_i18n function?
- How to debug failed load_theme_textdomain()?
- How to provide translations for a WordPress TinyMCE plugin?
- How do translated, escaped strings (esc_attr) in Themes work?
- How do I translate: “2 hours and 15 minutes”?
- Best pratice to make taxonomy terms translatable without changing slugs?
- List of Default Translated Phrases
- How to extract translatable (double underscores and _e) strings?
- Translate content, not instance, per-post
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Localization / textdomain is slow and chaotic
- Change language of comments template
- Make theme translatable for WPML
- What is the way to ship read-me strings like plugin-strings for internationalization?
- Use WordPress default text domain for translating labels
- Override plugin text domain in child theme
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- Replacing strings within posts with the translatable string
- Change template copy with po/mo files
- Action hook load_textdomain $domain variable
- Can’t generate pot file using wp cli
- How to avoid override string by child theme mo files when the string is empty?
- How to translate timestamp?
- Should I change text-domain of TGM library inside theme?
- Add a string to file .pot using Poedit
- Use the wp-admin translations on the front end
- How can I change the language of automated Mails?
- How to translate get_intermediate_image_sizes?
- Localization: I want the backend: english and frontend in defined language
- How to translate a string that contains a WordPress sitename
- Does the textdomain have to be the theme’s name?
- WordPress Translation Issue
- How to translate “$before” with get text in get_the_term_list?
- Plugin language always shows WP site language, not profile language
- Found a translation function that is missing a text-domain. Function _n
- Trying to localize a Underscores starter theme [duplicate]
- mo / po translation files does not seem to work
- Use localized plugin name and description even when the plugin is disabled
- Making WP theme / plugin multii-lingual without plugins
- Issue with translation – Gutenberg
- WooCommerce does not translate every string
- WordPress does not translate
- Debug WordPress gettext function
- translate_user_role doesn’t work
- Translate Plugin with french as base language
- Translation not working in sprinf variable
- GlotPress – WordPress integration
- WordPress NavXT plugin localization
- Archive widget numbers translation?
- Does WPML translate numbers automatically, or do I have to do the string translation? [closed]
- Can’t load text domain in a mu-plugin
- multisite same language different translation
- Save translation file of third party plugin in a custom plugin?
- Translate via URL parameter working only in localhost