Enter your keyword

How to change languages via po/mo file?

Very few developers develop their plugins and themes in a language different from English so you will have to translate the phrase in theme and plugins into many different languages by yourself, and I’ll explain to you how. There are two ways to do it.

– Directly within WordPress by using a localization plugin (such as Loco Translate plugin – that’s free and most of my customers used successfully). You can also consult our guide on How to Translate using LOCO Translate plugin
– On your PC/Mac, using Poedit. To change the value field of the theme via language file, you can do follow one of 2 methods below.

Method 1.

Edit .po/pot file(in directory languages) as the image below(root is my theme):

– Rename file corresponding with your Locale here: https://make.wordpress.org/polyglots/teams/
(In this article I will get an example: change en_US.po to it_IT.po). View image:

– Then download & install Gettext Translations Editor software(free) at https://poedit.net/wordpress
– Edit new file(it_IT.po) with software just installed.
– Change/add value as you want, then convert .po to mo file via http://po2mo.net/.
+Open http://po2mo.net/ choose .po file, click ‘Convert‘ button.

   + Then download MO file after convert.

The file downloaded has the name look like: abcdedg_it_IT.mo, change file name downloaded to “your_local.mo” file. Example: changed to it_IT.mo

Method 2.

Download and install software Gettext Translations Editor at https://poedit.net/wordpress then open/edit file .po/pot on the path as the image above(method 1).
After changed content/value, click Save:
– If exist po/mo files language as you want => it will override current.
– If not exist, do follow:

After all, you will get file name look like: it_IT.mo

Last step for both mothed: 
Copy/upload .mo file up to languages directory(in my theme) on your server.

Note: to active your local language, you must go to Settings >> General menu, do follow: