This thread is resolved. Here is a description of the problem and solution.
Problem: The client needs to use a specific language translation code such as "es-419" for translations, but is unsure if the default locale field is the correct place to define this code, especially since there is an issue with using a dash "-" in the language default locale. Solution: We explained that the XLIFF uses the hreflang to pull the source language for the target-language attribute. However, we currently do not have a feature that allows for the overwriting of this attribute specifically for XLIFF while keeping it unchanged for the site. If this solution does not seem relevant to your issue, please feel free to open a new support ticket with us.
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.
Hello,
I would like if we could use the language default locale to specify a required and specific language translation code like for "es" which is fine for the code, page url and hreflang we need to have "es-419" for the translations.
I know there is an issue with the dash "-" in the language default locale and it should be "es_419", but the main question is: "is it right to use the default locale to define specific translation code es-419? Or should we use another field and which one?
What is the goal you would like to achieve by adding the code es-419?
The problem with changing the default locale is that WordPress & our plugin uses the default locale as a means to pull existing translations from .mo files and it's own servers onto your site.
Almost all major plugins as well use the default locale to link languages to their .mo files.
Then the language code field is what is used to display in your URL, for example in Spanish it's already set to es, therefore, your URL will display as hidden link
You can change this only by creating a new custom language.
To do this go to WPML->Languages->Edit languages and add a custom language then set your code to es-418, however, your URL will also start showing as hidden link