Getting started – cannot find templates
-
Hi,
First of all, thank you for what seems to be a great plugin, and thank you for your great support too!! Before I ask, let me make sure I understand how the entire flow goes. I have read a lot about it in the last few days, but I am new to this and still a bit confused. If you want to write something like that in a sticky thread, I believe it would be very helpful for a lot of users.
So the steps for best practices are:
1. The theme/plugin developer needs to write the php code placing user-viewable string inside __(‘Hello World’) and _e(‘How are you’) functions.
2. An application (such as Loco Translate) scans all the files and collects all those strings into a .pot file.
3. The user decides to translate those strings to a different language. So they create a, say, pt_BR.po file that retrieves all the strings from the .pot file and work on the translations within the .po file. This can also be done in Loco Translate.
4. When they save the .po file, the application (such as Loco Translate) will automatically generate a corresponding .mo file, and that is the file ultimately used by wordpress.
So if all those steps are correct, my questions are:
a. The theme I am trying to translate is written using __() and _e(), but they do not provide me a .pot file. Does Loco Translate create that file for me? I can’t find where. The “new template” link only shows for themes/plugins that have no templates already. The one I’m working on has three templates (one of them is a .mo file) and none of them have all the strings that are in the code.
b. Can I also use Loco Translate to translate strings created by the WordPress code? It is not in the package list.
c. There is a thread in which you say that in order to prevent updates from overwriting translations, we must save the .po and .mo files in the global languages directory. But I can’t find in the plugin where to “Save as”. And is that directory not erased when WordPress itself is updated?
Thanks again!
- The topic ‘Getting started – cannot find templates’ is closed to new replies.