Newsletters: Languages & Translation
You can easily translate the entire WordPress Newsletter plugin with all its words and phrases into your own preferred language.
See all the current translations/languages in our Github repository.
In the repository, you will also find instructions on how to host the language file outside of the actual plugin’s folder so that your language file is not overwritten when you upgrade the plugin.
Remember, you have to set the WPLANG constant in your WordPress configuration file in order for a translation to be loaded. See Step 4 below for guidance.
You can follow the technical steps below, using poEdit to translate but alternatively you can use a WordPress plugin called Codestyling Localization with a visual interface and a more user-friendly experience.
1. Open poEdit
Before you can get started, you’ll need to open the poEdit application on your computer. If you don’t have poEdit, you can download and install it for your platform.
2. Open/Create Catalog File
The WordPress Newsletters plugin is distributed with a default, English catalog file named ‘wp-mailinglist-en_US.po‘ inside ‘wp-mailinglist/languages‘.
You may open this file with poEdit and save a copy so that you can start translating immediately. If you open the existing catalog file, all the strings will be available for translation immediately.
2.1. Create Catalog File
Alternatively, you can create a new catalog file though by choosing ‘File‘ > ‘New Catalog…‘ inside the poEdit application.
2.2. Project Info
Fill in the project information such as the plugin name, your team name, your preferred language, your country, charset, etc. These values under the ‘Project Info‘ tab can be anything you wish them to be.
Under the ‘Paths‘ tab, you’ll need to fill in “.” (dot) as the base path and under the paths, you’ll need to create a new path and also fill in “..” (two dots). This indicates that the PHP files are in the upper/parent directory (one directory up) of the one the language file will be located in.
Create 2 keywords under the ‘Keywords‘ tab. The one is 2 underscores “__” and the other one is underscore and the letter ‘e’ which makes “_e”. These will always remain the same since they are inside the code.
2.5. Save Catalog File
With that done, click the ‘Ok‘ button so that poEdit can allow you to save the catalog file. Save the file with the filename ‘wp-mailinglist-xx_XX.po‘ where the “xx_XX” part should be replaced with your language code, followed by an underscore and then your country/region code, such as en_US (US English), en_UK (UK English), nl_NL (Dutch), zh_TW (Traditional Chinese for Taiwan), es_ES (Spanish), se_SE (Swedish), etc.
Save it inside the ‘wp-mailinglist/languages‘ directory/folder of the plugin. You will notice that it immediately saves a .MO file (which is the actual language file) as well. The .PO file is just the catalog file and it is not used by the plugin through WordPress. Be sure to keep the .PO catalog file for future changes though.
Once you save the catalog file, poEdit will start scanning the PHP files recursively in the upper/parent directory (the ‘wp-mailinglist‘ folder) for words/phrases encapsulated by __() or _e() so that they can be translated.
3. Translate Words/Phrases
Whether you chose to open the existing catalog file or create a new one in Step 2, the words and phrases inside the WordPress Newsletter plugin should now be in front of you, ready to be translated. You’ll need to type the translated string (in your language) in the box below the box which shows the English string.
4. Set your WPLANG locale
The locale will be your language code, followed by an underscore “_” and then your country/region code such as en_US (US English), en_UK (UK English), de_DE (German in Germany), nl_NL (Dutch in the Netherlands), zh_TW (Traditional Chinese for Taiwan), es_ES (Spanish), se_SE (Swedish), etc.
Be sure that you saved your catalog file (.PO) and your language file (.MO) as ‘wp-mailinglist-xx_XX‘ inside ‘wp-mailinglist/languages/‘ where the “xx_XX” part in the filename should be replaced by your locale which you also define here in the configuration file.
4.1. Single WordPress Site
Open up your WordPress configuration file named ‘wp-config.php‘ and fill in your locale as the value for the WPLANG defined constant.
4.2. WordPress Multi-Site Network
When running a multi-site network, the WPLANG constant has to be set for each site individually on the network.
Go to ‘Network Admin‘ then go to ‘Sites‘ where you manage all your network sites and under the specific site for which you want to set the locale, click the ‘Edit‘ link.
Navigate to the ‘Settings‘ tab while editing the specific site and you’ll see a very long list of configuration settings. Find the ‘WPLANG‘ setting where you will fill in your locale and then save the settings again.
WordPress Premium Plugins
Start selling products and sending newsletters through your own WordPress Website using our Premium Plugins