Banners: Translation & Languages

You can easily translate the entire WordPress Banners plugin with all its words and phrases into your own preferred language.

Current Languages

Translation Instructions

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.

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.

Open/Create Catalog File

The WordPress Banners plugin is distributed with a default, English catalog file named ‘wp-banners-en_US.po’ inside ‘wp-banners’. 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.

Alternatively, you can create a new catalog file though by choosing ‘File’ > ‘New Catalog…’ inside the poEdit application.

click to enlarge

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.

click to enlarge

Under the ‘Paths’ tab, you’ll need to fill in “.” as the base path and under the paths, you’ll need to create a new path and also fill in “../”. 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.

click to enlarge

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-banners-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-checkout/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.

click to enlarge

Once you save the catalog file, poEdit will start scanning the PHP files recursively in the upper/parent directory (the ‘wp-checkout’ folder) for words/phrases encapsulated by __() or _e() so that they can be translated.

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 Banners 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.

click to enlarge

Set your WPLANG locale

Open up your WordPress configuration file named ‘wp-config.php’ and fill in your locale as the value for the WPLANG defined constant. 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-banners-xx_XX’ inside ‘wp-banners’ where the “xx_XX” part in the filename should be replaced by your locale which you also define here in the configuration file.

Website & Email Hosting

Get the best website & email hosting for speed, security, and peace of mind. No restrictions. Freedom to do what you need in order to run your business.

Host Now

Pin It on Pinterest