How To Translate Or Localize UsersWP
UsersWP, by default, comes in English. (en_US)
Our users fully translated UsersWP into several languages. If yours is incomplete or you want to edit a language, you can by following the steps in this document.
There are 2 options, creating a translation file or using an existing translation file.
- Create a translation file.
- Using an existing translation file
- Change WordPress language From your WordPress dashboard go to Settings > General > Site Language. Change it to your language. WordPress and UsersWP will start using the translation files for your language.
Download and install POEdit. Launch it to open this file:
userswp/languages/userswp-en_US.po<br>
Add your translations and once you finish, click File > Compile to MO...
Change the file name to reflect your Locale (the Locale is a unique code for each language). For example, if your translation is to Italian, the locale is it_IT.
The file name should be:
userswp-it_IT.mo<br>
Here you can find the full list of Locale codes.
Inside the wp-content folder, create the folder /languages/
Inside the languages folder, create the folder /plugins/
Transfer the .mo file via FTP into the newly created folder:
The complete path should look like this:
wp-content/languages/plugins/userswp-it_IT.mo<br>
Download the desired language file from the UsersWP GlotPress page.
You can download the file as .po file and modify it following point 1 of this doc or download it directly as .mo file, skip editing with POEdit / compiling the mo file, and follow the steps from here.
If you save the translation file in the wp-content/plugins/userswp/languages/ folder, you will lose your translation with each plugin update.
Translating Add-ons
to translate the add-ons the procedure is identical. Only the location of the translation files changes:
They can be downloaded from our website and not from wordpress.org.
The URL is https://userswp.io/translate/projects/.
Once you are ready to load your translation file, the path for example for the Location Manager should look like this:
/wp-content/languages/plugins/userswp-en_US.mo
Let's take another example. For the Advanced search add-on the path should look like this:
/wp-content/languages/plugins/uwp-search-en_US.mo
Updating Translations
Sometimes a new release comes out with new features and in some cases, these new features require new text strings.
When this happens, you'll need to merge your translated PO file with the new language file provided with the update.
To do so, you need to have both files on your desktop. For example:
userswp-it_IT.po (your translated PO file) & userswp-en_US.po (the new translation file shipped with the plugin update)
Open the first file (userswp-it_IT.po) with POEdit
From the PoEdit menu, click Catalogue and then Update from POT fileā¦