How to add a website translation to an "unofficial" language in AEM 6.5 if this language does not have an ISO code?
Hi everyone,
We have a multilingual project in AEM 6.5 in which we need to show pages in the following languages:
- Spanish
- English
- French
- Catalan
- Basque
- Galician
- Valencian
All of these languages but Valencian have ISO codes.
Valencian is linguistically considered a variant of Catalan language but politically it is considered an independent language in Spain. (https://en.wikipedia.org/wiki/Valencian_language).
In Java it is identified with the variant code "ca_ES_VALENCIA".
We have organized our project using the following tree:
- /content/client
- language-masters
- es
- en
- fr
- ca
- eu
- gl
- va
- es
- en
- fr
- ca
- eu
- gl
- va
- language-masters
We are using i18n dictionaries in json format and all of them but for Valencian are working fine.
This was expected as AEM only supports OOTB ISO languages.
We now need to make it work for Valencian. How could we do this?
We have found some promissing documentation regarding adding languages to AEM but it has not worked as expected.
We have followed these steps to add Valencian as a language in AEM (https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-msm.html?lang=en#changing-language-names-and-default-countries) and indeed we can now set the "language" property (jcr:language) of a page (/content/client/language-masters/va) as Valencian.

A screenshot showing that we have Valencian as an available language.

A screenshot showing we can set the jcr:language property of a page to "va".
The problem is that com.day.cq.wcm.api.Page.getLanguage() is not returning "va" (getting it from the path nor from the property) but "es_ES", the value of my request's "Accept-Language" header.
In the official documentation for this method (https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/api/Page.html#getLanguage--) it says:
"The language is usually defined on the page content via a jcr:language property containing the iso codes for language and country. if the property is not defined on this page all ancestors are search for such an property. If no language is defined at all, the path is examined if it contains a iso label. If no language can be found at all, the systems default locale is returned. Note that this has nothing to do with i18n of the cq5 itself."
So, how could we do it for Valencian to work as any other language in AEM 6.5?
Thanks in advance.