By default all Templatic directory themes are in English. If you need them in your own language you’ll have to translate them. Translation is accomplished by manipulating PO and MO files. PO files are used for the actual translation while MO files are essentially machine files containing the translations displayed by WordPress. To edit PO files and generate MO files you will need Poedit, a free piece of software available for both Windows and OS X. Details on using Poedit will be available later in the guide.

If you want to translate your site into just one language you don’t have to generate any new files, the existing English PO and MO files will work fine. The instructions below are also applicable for small text changes. You don’t have to translate the whole file if you don’t want to.

  • To get started connect to your server and locate the English PO file (en_US.po). It will be located into your themes “Language” folder.  (For example \wp-content\themes\Directory\languages,  \wp-content\themes\CityGuide\languages etc…)
  • Now here is a slight catch which we need to keep in mind, If you have kept a different language for your WordPress configuration,(we can change it directly from wp-admin >> Settings >> General settings) then we also need to rename existing .PO/.MO files accordingly.
  • If we are keeping site language selection as Español(Spanish), then sites front end will fetch file name as po/es_ES.mo for Arabic, it will be ar_AR.po/ar_AR.mo and so on. Your WordPress backend dashboard will populate notification similar as “Your corresponding translation file is en_US.mo” You need to keep this file naming for your language files.
  • You can get all those language code from the link “https://codex.wordpress.org/Codex:Multilingual#Codex_in_other_Languages“ (but if you are not changing the language, keep the default file naming as en_US.po/ en_US.mo)
  • Start translating the file. Here’s a quick image of the Poedit interface…

Poedit - Directory themes

  • Once you finish translating it just hit the save button (CTRL/CMD + S). Poedit will create a en_US.mo file in the same folder where the PO you were editing was located. In case the MO wasn’t created go to File ⇨ Preferences ⇨ Editor (tab). Check the “Automatically compile .mo on save” option.
  • Upload both your PO and MO files back to the server. Make sure to upload them in the same folder from where you got the PO file.