Reputation: 4747
I'm trying to translate texts in a WordPress template file:
_e('Sport Events Organizing', 'theme-text-domain');
I've setup the translation for spanish on WPML String Translation. Checked "Finished Translation" and clicked "Save". Then I browse my site and change the language to "Spanish". But the text still appears in english. URL shows the ?lang=es parameter.
To get WPML to make the translations for this text available I had to register it with:
icl_register_string('theme-text-domain', 'Sports', 'Sport Events Organizing')
Why is the spanish translation not showing? Is there a way to debug this?
Upvotes: 0
Views: 1666
Reputation: 64496
First you have to translate the strings from the admin panel , the strings wrapped in __()
or _e()
will appear in the wpadmin panel under the String translation module if you haven't install this plugin then first install this wpml plugin below is the snapshot in which you can see the list of strings need to be translated and from there you can edit the translations from default language to other languages
When ever you add new strings in your theme you have to refresh the translation module to get the new strings in the translation module see below attached snaps
And in same module you will see the plugins and there strings you can rescan them and they appear in string translation module
Hope it makes a good sense for the cycle of translation
Upvotes: 3