Translate
Introduction
What you need to know
Core Translation Files
Addon Translation Files
Translation process
Translating with PoEdit
Resources
Introduction
Wordpress and UsersWP both are configured with English by default, but can easily be translated into other languages. In this document we will introduce the how translated strings are stored, edited, and loaded to a site to display a new translation.
The goal of this guide is not just to help you become familiar with translation. Once the new translations are setup, you can edit and update your translation files any time. Once you start translating, and even changing the default text, you will probably find many ways to make the text ‘speak’ to your community of users.
What you need to know
- .po and .mo files are the standard method for storing “translated strings”.
- .po files are for doing translations.
- .mo files are for showing translations on your site.
- .po files can be edited with PoEdit, the free cross-platform desktop translation app.
- When you edit a .po file in PoEdit, and then save the file, PoEdit will also create/update a matching .mo file.
- Store BOTH the .po and the .mo files in the the proper site folder.
- UsersWP Core Translations are maintained at https://translate.wordpress.org/projects/wp-plugins/userswp, so go there if you want to download existing translations of UsersWP core.
- UsersWP Addon Translations are available in the default English within the addon folder.
- Finished translation files for plugins are stored in wp-content/languages/plugins/
- Finished translations for themes are stored in wp-content/languages/themes/
Core Translation Files
UsersWP Core plugin translations are maintained at https://translate.wordpress.org/projects/wp-plugins/userswp. If you are looking for existing translations of the UsersWP Core plugin in additional languages, you can go there to see which languages are available.
If your language is not currently available or at less than “100%” then consider joining the UsersWP translation team where members work together to make excellent, accurate translations available in every language. Visit the Translators Handbook to find out more.
UsersWP Core Languages Folder Location
Once you have completed your translation of UsersWP core plugin into a new language, the .po and .mo files must be transferred to your site, usually by FTP. On your site, the translation files for UsersWP core are stored in “wp-content/languages/plugins/”.
Use the following table to “check your work”. The most common reasons that a translation file won’t load is because it is named incorrectly or because it is stored in an improper folder.
Name | .po/.mo folder path and file name (text domain) |
---|---|
UsersWP Core | /wp-content/languages/plugins/userswp-en_US.mo |
Addon Translation Files
UsersWP Addon English language translations are available inside the addon language folder.
UsersWP Addons Languages Folder Location
Translated files for UsersWP Addons are stored in “wp-content/languages/plugins/”. Use the following table to “check your work”. The most common reasons that a translation file won’t load is because it is incorrectly named or because it is stored in an improper folder.
Addon name | .po/.mo folder path (text domain) |
---|---|
Messaging | /wp-content/languages/plugins/uwp_messaging-en_US.mo |
Restrict Users | /wp-content/languages/plugins/uwp_restrict-en_US.mo |
Job Manager Integration | /wp-content/languages/plugins/uwp_wpjob-en_US.mo |
BBPress Integration | /wp-content/languages/plugins/uwp_bbpress-en_US.mo |
Friends | /wp-content/languages/plugins/uwp_friends-en_US.mo |
User Moderation | /wp-content/languages/plugins/uwp_moderation-en_US.mo |
MyCRED Integration | /wp-content/languages/plugins/uwp_mycred-en_US.mo |
User Search | /wp-content/languages/plugins/uwp_search-en_US.mo |
Verified Users | /wp-content/languages/plugins/uwp_verified-en_US.mo |
WooCommerce Integration | /wp-content/languages/plugins/uwp_woocommerce-en_US.mo |
Mailchimp Integration | /wp-content/languages/plugins/uwp_mailchimp-en_US.mo |
Online Users | /wp-content/languages/plugins/uwp_online-en_US.mo |
Followers | /wp-content/languages/plugins/uwp_followers-en_US.mo |
Multisite Creator | /wp-content/languages/plugins/uwp-multisite-en_US.mo |
User Roles | /wp-content/languages/plugins/uwp_roles-en_US.mo |
Easy Digital Downloads | /wp-content/languages/plugins/uwp_edd-en_US.mo |
Social Login | /wp-content/languages/plugins/uwp_social-en_US.mo |
User Activity | /wp-content/languages/plugins/uwp-activity-en_US.mo |
Profile Progress | /wp-content/languages/plugins/uwp_progress-en_US.mo |
Frontend Post | /wp-content/languages/plugins/uwp-frontend-post-en_US.mo |
Translation Process
Setup New Language Translation Files on the Site
First, the translations need to be setup on the site. Here is the overview of that process:
- Download an existing translation or create a new file. In either case, save the translation .po file to the desktop.
- Open the file with PoEdit and select the new language.
- Save the file with PoEdit on to the desktop with the new locale.
- Find the .po and .mo files on the desktop.
- Transfer the .mo and .po files via FTP to the proper site folder.
Edit an existing language translation
Once your translation files are setup, then you can edit them any time you want with this process:
- Login to the site with FTP and navigate to the appropriate languages folder.
- Download the appropriate .po file from the site folder, and save a backup copy in another location.
- Open with PoEdit, Translate with PoEdit, Save with PoEdit.
- Identify the new .po and .mo files in your local save location.
- Transfer the .mo and .po files via FTP to the proper site folder.
Translating with PoEdit
This example is for translation of the core plugin. The process is the same for any plugin or theme, with the notable exception that the files are stored in the site in different folders.
- Download POedit and install the free program.
- Download the default translation. Each plugin or theme comes with English language .po and .mo files. Use FTP or cPanel to download the default language .po file to your local machine. You only need the .po file. PoEdit will create a new .mo file upon save.
- Open Poedit and select Create new translation:
- Navigate to the .po file and open it:
- Select the new language:
- Make sure to select exactly the same language you have at WP > Settings > General:
- Now save the file:
- Poedit will give you the correct extension, in our example that will be nl_BE.po.
- Make sure the filename matches the default translation filename. Example: userswp-nl_BE.po.
- PoEdit saves the .po and the .mo files: userswp-nl_BE.po and userswp-nl_BE.mo
- transfer BOTH the .po and the .mo files via FTP to the proper folder on the site.
- Save a backup of the files on your desktop and in your personal cloud, just in case of emergency.
- Translate the remaining strings. Now that the workflow is setup, you can Now translate any language string you want, and save the file once finished:
- When you are ready, upload both the .mo and .po file to the /wp-content/languages/plugins/ folder on the server.
Create the folder if it does not exist yet:
- Go to your website and refresh to see your changes 🙂
Resources
- UsersWP Core Translations on WordPress.org
- UsersWP Addons Translations on WPUsersWP.com
- PoEdit
- Translator’s Handbook