 jean-marcd-2
|
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?
Thank you for your help on this matter.
Best regards
JM Duchi
|
 Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
|
Hi JM Duchi,
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.
While you can always change it, the default locale recommend is the one set by WordPress -- you can find it here https://make.wordpress.org/polyglots/teams/
For Spanish(Spain) it's es_ES
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
More documentation on how to add a custom language can be found here:
https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/
|
 jean-marcd-2
|
Hello,
The goals are to:
- Keep URLs with /es/
- Export into XLF files with: 'target-language="es-419"' and 'target xml:lang="es-419"'
So is there any Language WPML field with could store "es-419" without impacting the URL or the HReflang?
Thank you.
JM Duchi
|
 Bobby
WPML Supporter since 04/2015
Languages:
English (English )
Timezone:
America/Los_Angeles (GMT-07:00)
|
Hello,
Thank you for clarifying, the XLIFF will use the hreflang to pull the source language for the target-language attribute.
Unfortunately, no feature would allow us to overwrite this just for XLIFF and leave it as is for the site.
|