This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where dates on their Swiss French language version of the site do not translate correctly and revert back to English. This occurs because WordPress does not officially support the 'fr_CH' locale, causing a fallback to English for core date strings. Solution: To resolve this, we recommend either manually copying the official French WordPress translation files ('fr_FR.po' and 'fr_FR.mo'), renaming them to 'fr_CH.po' and 'fr_CH.mo', and uploading them to
wp-content/languages/
. After clearing all caches, WordPress will automatically load these files, and the
date_i18n()
function will render French month names correctly on the Swiss French site. Alternatively, using the Loco Translate plugin to create a French (Switzerland) 'fr_CH' translation for WordPress core (based on 'fr_FR') and translating the date strings there can achieve the same result without manual file handling and is safe across updates.
Please note that these files will not be removed by a WordPress update as the 'wp-content/languages/' directory is meant for custom and downloaded translation files and is not affected by core updates. However, since 'fr_CH' uses 'fr_FR' as a fallback, it won’t automatically receive updated translations when French translations are updated. If new strings are released, you would need to re-copy the updated 'fr_FR' files again.
If this solution does not resolve your issue or seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket at WPML support forum for further assistance.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Hi, for our site oikocredit.org we are seeing an issue on the Swiss French language version. Some of the dates do not get translated correctly, and therefore revert back to English. Example page: hidden link
After doing some digging, this is likely because under language settings we have Swiss French set to locale fr_CH, but WordPress does not provide a translation in this locale. Is this a correct assumption? Or should 'Language Mapping' have already fixed this for us?
Is it risky / tricky to change the locale to fr_FR, yet leave the hreflang on fr-ch?
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
Since wordPress does not provide an official `fr_CH` locale, so when WPML sets the site language to Swiss French, WordPress falls back to English for core date strings. To resolve this, a French fallback locale needs to be provided for `fr_CH`.
This can be done by copying the official French WordPress translation files (`fr_FR.po` and `fr_FR.mo`), renaming them to `fr_CH.po` and `fr_CH.mo`, and uploading them to `wp-content/languages/`. After clearing all caches, WordPress will load these files automatically and `date_i18n()` will correctly render French month names on the Swiss French site.
Alternatively, the same result could be achieved using the Loco Translate plugin by creating a French (Switzerland) `fr_CH` translation for WordPress core (based on `fr_FR`) and translating the date strings there. This avoids manual file handling and is safe across updates.
OK. We'd like to avoid using Locotranslate if we can.
I tried the duplicating of fr_FR to fr_CH, and this works. However, my understanding is that these files would be removed on a WordPress update.
Is there a way to force WordPress to fallback on the fr_FR file rather than English if the locale was set to fr_CH? This way we can simply add some code that tells WordPress which locale to use for date formatting etc.
We tried something like this (second option), even linking to a duplicated file, but it did not work. Perhaps WPML gets in the way with some of these functions? hidden link
Languages: English (English )German (Deutsch )French (Français )
Timezone: Europe/Zagreb (GMT+02:00)
They won’t be removed by a WordPress update. WordPress core updates do not touch anything inside `wp-content/`, including `wp-content/languages/`. That directory is explicitly meant for custom and downloaded translation files.
So if you place `fr_CH.po` and `fr_CH.mo` in:
wp-content/languages/
they will persist across WordPress core updates.
The only time those files would be removed is if:
* someone manually deletes them, or
* a deployment or sync process overwrites the `wp-content` directory
WordPress itself will not remove or replace them during updates.
One small caveat worth noting -because `fr_CH` is using `fr_FR` as a fallback, it won’t automatically receive updated translations when French translations are updated. If WordPress releases new strings in the future, you’d need to re-copy updated `fr_FR` files again if you want them included.
But from a stability and update-safety perspective, this approach is safe and standard practice.