I’m using WP 3.5 and Polylang 0.9.8 plugin to make translations to different languages.
All is good, and the plugin works fine, but now I’m facing a problem — I need to translate custom strings, for example, strings inside widgets.
What can you recommend me to solve this problem?
ADDED:
For example (I’m taling about text in widgets, but not header), can I add some string constants or so and write them from php-code into my page — and got them to translate on String translation page of Polylang?
Use this
pll_register_string()
on functions.php
Use it like this:
So:
pll_register_string(‘Header Title’, ‘The title you want to appear’);
Then on dashboard config, on languages, you are going to find a tap called “strings”.
There you’re going to have this new created string, and an input text to fill the translation text for every active language on your site.
Write translations, and then use the funcions:
pll_e() to directly echo, or pll__() to manually echo it.
Your’ge going to use it like:
That’s it! 🙂