How to translate WordPress theme?
To translate your WordPress theme you can of course use plugin like WPML, but there is also a way to make transaltion easily and without additional plugin usage.
Step 1. Change your site language settings in your WordPress (for example WP admin > Settings > General -> Site language -> Deutsch) and save changes.
Step 2. Download free version of PoEdit from here https://poedit.net/. Then go to languages subdirectory of your theme folder and open (in PoEdit) translation file with extension .pot. It can be for example clean-cutta/languages/clean-cutta.pot.
In PoEdit click to create new translation from pot file and choose your language (for example Deutsch). Then translate choosen strings depends on your neeeds, like on on the screenshot below.
After you finish your translation then click on File > Save and save it with the name according to your site language. For example if your site language is set to Deutsch then file name should be de_DE.
Other file names for popular languages/countries:
- en_US (United States)
- en_GB (United Kingdom)
- de_DE (Germany)
- en_AU (Australia)
- en_CA (Canada)
- fr_FR (France)
- pl_PL (Poland)
- it_IT (Italy)
- es_ES (Spain)
- nl_NL (Netherlands)
- da_DK (Danmark)
PoEdit will automatically create two necessary translation files at once with proper extensions (de_DE.po and de_DE.mo).
Step 3. Upload your new translation files (de_DE.mo and de_DE.po) via ftp to your host (for example: cleancutta.com/wp-content/themes/clean-cutta/languages/). To upload files we recommend to use for example FileZilla (free to download from here: https://filezilla-project.org).
Your WordPress should now display translated strings from the transation files.