Here’s a guide to translating the CatFolders Document Gallery plugin’s UI text:
1. Preparation
You should choose one of these translation tools: Either WP-CLI or Loco Translate plugin.
2. Generating translation files
Using WP-CLI:
- Open a terminal and navigate to the plugin’s directory:
catfolders-document-gallery
→languages
. - Run
wp i18n make-pot .
to create a POT file (template for translations). - For each language, run
wp i18n make-json <language_code> .
(e.g.,wp i18n make-json fr_FR .
for French). - Place JSON files in
catfolders-document-gallery
/languages/<language_code>/
.
Using Loco Translate:
- Install and activate the Loco Translate plugin.
- Go to “Loco Translate” in your WordPress admin panel.
- Select the plugin and click “New language”.
- Choose a language and Loco Translate will automatically create the JSON file.
Note: Please be sure to select the file location as shown in the screenshot below.
3. Translating text
- Open the generated JSON file in a text editor or Loco Translate’s interface.
- Translate each text string, ensuring accuracy and cultural relevance.
- Save the translated JSON file.
4. Loading translations
- WP-CLI: Translations are automatically loaded if files are in the correct directory, which is
catfolders-document-gallery
→languages
. - Loco Translate: Translations are automatically loaded by the plugin.
Becoming a Translation Contributor (optional)
If you want to contribute to our public repository, you can publish your translations by visiting https://translate.wordpress.org/projects/wp-plugins/catfolders-document-gallery/ and add the translations of your locale(s).
Then, we will post a PTE request on https://make.wordpress.org/polyglots/ to get you approved as a translation editor on WordPress.org.
Approved translators can create language-specific files and submit them back to us for inclusion in the plugin.