When you change a language locale, for example, for German from de_DE to de_DE_formal, you might notice that translation of strings stopped displaying.
This problem happens because WPML can’t find MO files with matching language locale anymore. In our example, it would look for some-domain-de_DE_formal.mo but such a file does not exist. Instead of that, WPML only has a record of some-domain-de_DE.mo.
To solve this problem, you need to do two things:
1. If you have any strings translated via the WPML -> String Translation page, go to the WPML -> Support -> Troubleshooting page and click the Show custom MO Files Pre-generation dialog box button. In the dialog that appears, click the blue button to regenerate custom MO files.
2. Most likely, the first step will not repair all missing strings. This is because some values may come from missing native MO files, provided by other plugins or themes. To solve this, you must find the missing MO files and create copies using new names with the new language code.
In our example, if a string is normally loaded from the woocommerce-de_DE.mo file, we must find that file and create a copy of it using a name that matches current locale: woocommerce-de_DE_formal.mo. You have to copy all missing files that are used by your site.
The typical locations where you can find these MO files are:
Finally, you can also find specific paths in the wp_icl_mo_files_domains table in your database.