This thread is resolved. Here is a description of the problem and solution.
Problem:
The client created a custom language, Afrikaans, with the code af-za by mistake and needs it to be /af/ to match the site they are migrating. They have already translated content and cannot start over but are unable to change the language code in WPML.
Solution:
Unfortunately, you cannot directly change the language code of an existing custom language in WPML. However, you can preserve your translations by transferring them to a new custom language with the correct code. Here are the steps to do this safely:
1. Navigate to WPML → Languages and add a new custom language for Afrikaans with the correct code (/af/).
2. Manually transfer your translations from the old language code (af-za) to the new one (/af/).
If this solution does not apply to your case, or if it seems outdated, we recommend checking the 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 further assistance is needed, please open a new support ticket at our support forum.
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.