Translate Using Loco Translate Plugin

TRANSLATION GUIDES

WPLMS Version 4 guide for translating Members Area :

————-


VERSION 3 Translation guide.

    *INDEX*

  1. Download 100% Translated files of Buddypress, Woocommerce and buddydrive.
  2. Start Editing our provided translation files with the theme and it’s plugins the correct way.
  3. Creating your own Translation files.
  4. Backup translations for safely updating plugins and theme.
  5. Synchronising your POT, PO and MO files after Update to add the new strings that are added to the source code into the translation files. 
  6. Important notes and fixes.

WE RECOMMEND OUR USERS TO USE LOCO TRANSLATOR FOR TRANSLATING THE THEME AND PLUGINS : https://wordpress.org/plugins/loco-translate/

*********************************************************************************************

1. Download and setup 100% Translated files of Buddypress, Woocommerce and buddydrive.

https://vibethemes.com/documentation/wplms/knowledge-base/buddy-press-translation-using-loco-translator/

*********************************************************************************************

2. Start Editing our provided translation files with the theme and it’s plugins the correct way.

1. Go to WP Admin -> Plugins -> Add New
2. Search for plugin “Loco Translate”

3. Install and Activate the plugin.
4. After Activation locate WP Admin -> Loco Translate

loco_translate_1

5. Click on Loco Translate.

6. Choose the plugin/theme which provides the text that you want to translate.

screenshot_2

screenshot_4

screenshot_3

7. Click on that plugin/theme. Some settings will appear.

8. Now click on edit template.

9. After clicking on EDIT TEMPLATE , Now a page will open. Click on sync and save  to syncronise the pot file.

10. Now go back to wp-admin->loco translator->plugins->select that plugin.

11. Now click on COPY on the language that you want to edit that is provided by us with the plugin.

12. Some Settings will appear.

13. Now choose the exact language that you selected in the previous step.

Choose system language and copy translations from XX.

Click on start translating, it will create a copy of the translation file in the global folder.

14. Click on sync and save.

screenshot_7

15. Now you can simply add your translation strings and then save them.

All that translation that you make in this global file will retain even after updaing the theme and the plugin.

16. Now go back to that wp-admin->loco translator->plugins->select that plugin again

Since you have created a global translation file, now you can delete the local translation file.

DONE.

NOW YOU CAN SUCCESSFULLY EDIT AND RETAIN THE TRANSLATION FILES PROVIDED BY US.

*********************************************************************************************

3. Creating your own Translation files.

WPLMS highly recommends using LOCO Translator for translation.1. Go to WP Admin -> Plugins -> Add New
2. Search for plugin “Loco Translate”3. Install and Activate the plugin.
4. After Activation locate WP Admin -> Loco Translate

loco_translate_1

5. Click on Loco Translate.

6. Choose the plugin/theme which provides the text that you want to translate.

screenshot_2

screenshot_4

screenshot_3

7. Click on that plugin/theme. Some settings will appear.

8. Now click on edit template if template is already created.

Otherwise you will have to create a template.

                                               OR

9. After clicking on EDIT TEMPLATE , Now a page will open. Click on sync and save  to syncronise the pot file.

10. Now Select the language translation file or create a new language translation file.

11. Click on new language to add the language. Some settings will appear.

screenshot_6

12. Choose your language and always select the system location

13. Click on start Translating.

14. Now a whole new set of settings will appear.

15. Click on the Sync button.

16. Search for the text that you want to translate.

17. select the text.

screenshot_9

screenshot_10

screenshot_7

18. Write the translation text  then click on save.

19. You can download the PO and MO files from here.

screenshot_8

20. If you are translating any string with Variables like %s, %d

Then You need to follow this guide.

https://developer.wordpress.org/themes/functionality/internationalization/#variables

 FINALLY CHECK THE FRONTEND TO SEE YOUR TRANSLATED TEXT. #CHEERS.

*********************************************************************************************

4. Backup Translations to safely update.

If you want to add your own po/mo files or your custom translation then it is strongly advised that you put set the location as GLOBAL.

PO and MO Global translation files Location

For Themes : “wp-content\languages\themes\”

For plugins : “wp-content\languages\plugins\”

It is advised so because after each update we replace the po/mo files located in the local folders. So if you have added any translation of your own it will get replaced.

Also the priority of translation files is :

1. Global  2. Local

So always choose Global for your own custom translations.

That way your custom translation will be retained even after the update.

GUIDE TO SAFELY BACKUP TRANSLATION FILES BEFORE UPDATING 

1. Make a backup of all the po/mo files located in the local folders of your plugins and theme.

PO and MO local translation files Location

For Themes : “wp-content\themes\wplms\languages”

For plugins : “wp-content\plugins\pluginname\languages”

PO and MO Global translation files Location

For Themes : “wp-content\languages\themes”

For plugins : “wp-content\languages\plugins”

  • The Global translation files are not changed when you update any plugin or theme.
  • Only Local Translation files are changed.

2. You can Also Download the po and mo files of one by one.

Go to wp-admin->loco translator->choose the theme or plugin->choose the language.

Now You can download the po/mo files of that plugin/theme

*********************************************************************************************

5. Synchronising your POT, PO and MO files after Update to add the new strings that are added to the source code into the translation files. 

AFTER UPDATING PLUGIN/THEME

Some strings maybe added, removed or changed after the update.

1. Go to wp-admin

loco_translate_1

2.. Click on Loco Translate.

3. Choose the plugin/theme which provides the text that you want to translate.

screenshot_2

screenshot_4

screenshot_3

4. Click on that plugin/theme. Some settings will appear.

5.. Now click on edit template

6. After clicking on EDIT TEMPLATE , Now a page will open. Click on sync and save  to syncronise the pot file.

7. Now go back to the wp-admin-> loco translator->the plugin or theme you want to translate.

8. Now Select the language translation file

9. Click on the Sync button.

10. Click on save.

IT maybe possible that some strings still wont appear.In that case please try increasing Skip PHP files larger than . refer : link

YOUR POT FILE, PO FILE AND THE MO FILES ARE SYNCHRONISED WITH THE SOURCE CODE.

*********************************************************************************************

6.  IMPORTANT NOTES  AND FIXES 

1. WordPress changed the way how it manages the translation files in 4.6 Update. Prior to 4.6 version of wordpress style of naming the translation files was  “xx_XX.po/mo” but now they have changed it to “text_domain-xx_XX.po/mo”. So, we also had to change the way how we do it in our theme update “WPLMS 2.3″to make it compatible with wordpress 4.6 and up.

 Please note the Code Styling won’t work for wordpress 4.6 and above.

You can Download This plugin from here: https://wordpress.org/plugins/loco-translate/

 

2. If you are translating any string with Variables like %s, %d, Then You need to follow this guide.

https://developer.wordpress.org/themes/functionality/internationalization/#variables

 

3. Location Priority of translation files in our themes.

     I. Global Folder : Our theme loads the Translation files located in the global folder.

System : wp-content/languages/plugins/’textdomain’-xx_XX.po

System : wp-content/languages/themes/’textdomain’-xx_XX.po

     II. Local Folder : Our theme loads the Translation files located in the local foder.

Author : wp-content/themes/themename/languages/’textdomain’-xx_XX.po mo

Author : wp-content/plugins/pluginname/languages/’textdomain’-xx_XX.po mo

4. If translation Still Doesn’t work Then try doing this : 

VIA FTP

Theme translation file location

Move the vibe-xx_XX.po/mo  located in the “../wp-content/themes/wplms/languages/” folder  to  “../wp-content/languages/themes” folder.

Plugin translation file location

Move the ‘abcd’-xx_XX.po/mo  located in the “../wp-content/plugins/’pluginname’/languages/” folder  to  “../wp-content/languages/plugins” folder.


IF TRANSLATION NOT WORKING THEN : 

when Editing the template if you found that some strings are lost then make sure you have increased the file size from here:

https://prnt.sc/21jy4pq

https://prnt.sc/21jydo6

Leave a Reply

Your email address will not be published. Required fields are marked *