March 30, 2016 at 2:18 pm #2481Planetshine SupportKeymaster
Frequently asked question – how to translate theme? Our theme can be translated using the same tools and methods as the rest of WordPress – using POT language files.
How to prepare for translation
- Activate child theme;
- Choose POT language file managing tool (we suggest free WordPress plugin called Loco Translate or translation editor called Poedit).
How to translate with Loco Translate
1. Install Loco Translate plugin;
2. Activate installed plugin;
3. Make sure your server has correct write permissions;
4. In wp-admin go to “Loco Translate -> Themes”;
5. Under column “Bundle name” locate your theme’s child theme (screenshot);
6. In theme’s overview page press “New language” (screenshot);
NOTE: If you see warning “Template missing” you have to create template (screenshot)!
7a. If you want to add translation choose language from list or add it manually in format “xx_XX” (where “xx” corresponds to language codes and “XX” corresponds to country codes, for example “en_US”);
7b. If you want to edit Theme’s text outputs you need to select current site language (can be checked in “Settings -> General -> Site Language”), for “English (United States)” choose “English”;
8. As a translation location we suggest to use “languages/themes/” directory;
9. Press “Start Translating” (screenshot for steps 7, 8, 9);
10. Add translations and click “Save” (screenshot);
NOTE: If you can’t find text you are looking for, most likely some plugin provides this text output. In this case you need translate plugin’s text outputs under “Loco Translate -> Plugins”.
11. If you followed step 7a, go to “Settings -> General -> Site Language” and make sure that correct language is selected.
How to translate with Poedit
1. Download and install “Poedit”;
2. Open “Poedit”;
3. Click on “File -> New from POT/PO file”;
4. Open child theme’s “default.pot” file located in “[wordpress-install-folder]/wp-content/themes/[theme-name]-child/languages/”;
5a. If you want to add translation choose language from list you prefer;
5b. If you want to edit Theme’s text outputs you need to select current site language (can be checked in “Settings -> General -> Site Language”);
6. Add translations;
7. Click on “File -> Save” and save the “xx_XX.po” file in the same folder where child theme’s “default.pot” is located;
8. If you followed step 5a, got to “Settings -> General -> Site Language” and make sure that correct language is selected.