NOTE: This needs to be done for all plugins also used in the website.
File overview
The .POT file is the portable object template file, this is the base file from which translations are created. This is generated by scanning the codebase for strings that are marked for translation; we provide this in the repository for this project.
The .PO file is the human-readable portable object file, this file is created from the POT file, and is what should be created when adding a language to the theme.
The .MO file is the machine-readable form of the PO file, which is used by the code to retrieve the translated strings.
Tools
In order to create a new translation, it’s best to use a tool designed for the purpose. One of the most popular tools is Poedit, which is available for Mac, Windows, and Linux.
The process
Using Poedit, here’s how you’d create a new translation:
1 -Request a copy of the language folder containing the POT, PO and MO files.
amnesty-core/languages
amnesty-core/languages/amnesty.pot
2 – Open the POT file with POedit.
3 – You’ll be prompted to choose the language of the new translation
4a – The translator can then go through each string one-by-one and add their translations
4b – Alternatively, the translation can be “pre-translated”, which means Poedit will translate the strings using an online service. These are not always 100% accurate, but they can provide a good starting point
5 – When saving the file, the filename for the PO file is pre-filled, and I recommend never changing it. At this point, Poedit will also create the MO file in the background.
6 – Then, once the PO & MO files have been added to the project, they will be referenced based on their filename by WordPress (hence my recommendation to not change the language name), if there is a corresponding site with that language installed.
7 – Send the files to the website team who will ask the agency to add the updated work to the theme repository.