How to make custom strings translatable with Poedit?
-
Hi,
Please show me how to make my custom strings translatable in Poedit.I’m using Pho theme which is translatable.
For example in 404.php file there is a line:<p><?php _e( 'It looks like nothing was found at this location. Maybe try search?', 'pho' ); ?></p>
And in pho.pot there is a line:
It looks like nothing was found at this location. Maybe try search?
which I can translate into whatever language I need to. For example if I want to translate it into Slovene I create sl_SI.po and sl_Si.mo files. So far so good. It all works fine. I am able to translate a theme!
But what about if I want to add my own string into the code. For example at some point in my code I need to write
Published by
and make it translatable.I thought that if I simply write
<p><?php _e( 'Published by:', 'pho' ); ?></p>
that then
Published by
will appear in pho-pot from where I will be to translate it. But it does not.So how do I get my custom sentences in .pot file? Is there some special trick? I thought that WordPress automatically scans all the code, detects _e() function and places strings in .pot file. But in my case it does not.
So what should I do?
- The topic ‘How to make custom strings translatable with Poedit?’ is closed to new replies.