We will use Poedit tool as the illustration for this part.
After installing the Poedit tool, open up the Poedit tool, go to the toolbar of the tool, click File > New catalog from POT file. Browse to your theme folder wp-content/themes/theme_name/languages and pick the en.po file.
Now, you will see a list of all language strings you need to translate.
If you right click on any string, you’ll see the exact place with the file name and line number where this text is being located as shown below:
The translation box is located down below, click on an original text then translate the text.
Once done, simply click File >> Save as to save the file in the folder path wp-content/themes/theme_name/languages,
and name it accordingly to your language code.
For example, your language is French then the language code is fr_FR.
Please note that if you save the language file incorrectly, WordPress can not pick the translated text. In case you don’t know your language code exactly, please check out the following link: https://make.wordpress.org/polyglots/teams/
After having your language file .po, you will need to save it as .mo file in order to work. You can do it manually by going to File >> Save again to compile a .mo file alongside your .po file. Now you have two your own language files: – a.po file and a .mo file as illustrated below:
Or you can set your Poedit to always automatically generate a .mo file by clicking File >> Preferences to open up a preferences box , on the Editor tab, check the “Automatically compile .mo file” :