Adobe recommends using the modern and extensible data capture Core Components for creating new Adaptive Forms or adding Adaptive Forms to AEM Sites pages. These components represent a significant advancement in Adaptive Forms creation, ensuring impressive user experiences. This article describes older approach to author Adaptive Forms using foundation components.
|AEM 6.5||Click here|
|Core Components||Click here|
|Foundation Components||This article|
AEM Forms provide out of the box support for English (en), Spanish (es), French (fr), Italian (it), German (de), Japanese (ja), Portuguese-Brazilian (pt-BR), Chinese (zh-CN), Chinese-Taiwan (zh-TW), and Korean (ko-KR) locales. You can add support for more locales also, like Hindi(hi_IN).
The localization of adaptive forms relies on two types of locale dictionaries:
Form-specific dictionary Contains strings used in adaptive forms. For example, labels, field names, error messages, help descriptions. It is managed as a set of XLIFF files for each locale and you can access it at
Global dictionaries There are two global dictionaries, managed as JSON objects, in the AEM client library. These dictionaries contain default error messages, month names, currency symbols, date and time patterns, and so on. You can find these dictionaries at
Perform the following steps to add support for a new locale:
AEM Forms currently support localization of Adaptive Forms content in English (en), Spanish (es), French (fr), Italian (it), German (de), Japanese (ja), Portuguese-Brazilian (pt-BR), Chinese (zh-CN), Chinese-Taiwan (zh-TW), and Korean (ko-KR) locales.
To add support for a new locale at the Adaptive Forms runtime:
git clone https://git.cloudmanager.adobe.com/<my-org>/<my-program>/.
Guide Localization Service.cfg.json file and add the locale you want to add to the list of supported locales.
Create a file with the name as
Guide Localization Service.cfg.json file, if already not present.
etc/clientlibsto serve as a container for xfa and af clientlibs.
Create a node named as
[locale-name]_xfa and type as
etc/clientlibs/locale_name, with category
xfaforms.I18N.<locale>, and add the following files:
<locale>as defined in
Create a node named as
[locale-name]_af and type as
etc/clientlibs/locale_name, with category as
guides.I18N.<locale> and dependencies as
Create a folder named as
guidelib.i18n, having patterns of “calendarSymbols”,
<locale>as per the XFA specifications described in Locale Set Specification.
<locale>as defined in
Add js.txt containing the following:
Perform this step only if the
<locale> you are adding is not among
Create a folder
etc, if not present already.
Add a multi-valued string property
languages to the node, if not present already.
<locale-name> default locale values
ko-kr, if not present already.
<locale> to the values of the
languages property of
Add the created folders in the
filter.xml under etc/META-INF/[folder hierarchy] as:
<filter root="/etc/clientlibs/[locale-name]"/> <filter root="/etc/languages"/>
Before committing the changes into the AEM Git repository, you need to access your Git repository information.
Commit the changes to the GIT repository after adding a locale support. Deploy your code using the full stack pipeline. Learn how to set up a pipeline to add new locale support.
Once the pipeline is complete, the newly added locale appears in the AEM environment.
Perform the following steps to use and render an Adaptive Form using newly added locale:
&afAcceptLang=<locale-name>in the URL of an Adaptive Form.
There are two methods to identify the locale of an Adaptive Form. When an Adaptive Form is rendered, it identifies the requested locale by:
[local] selector in the adaptive form URL. The format of the URL is
[local] selector allows caching an Adaptive Form.
Retrieving the following parameters in the listed order:
To override the browser locale of users, you can pass the
afAcceptLang request parameter to force the locale. For example, the following URL forces to render the form in Canadian-French locale:
The browser locale set for the user, which is specified in the request using the
If a client library for the requested locale does not exist, it checks for a client library for the language code present in the locale. For example, if the requested locale is
en_ZA (South African English) and the client library for
en_ZA does not exist, the adaptive form uses the client library for
en (English) language, if it exists. However, if none of them exist, the Adaptive Form uses the dictionary for
Once the locale is identified, the Adaptive Form picks the form-specific dictionary. If the form-specific dictionary for the requested locale is not found, it uses the dictionary for the language in which Adaptive Form is authored.
If no locale information is present, Adaptive Form is delivered in the original language of the form. The original language is the language used while developing the Adaptive Form.
Get a sample client library to add support for new locale. You need to change the content of the folder in the required locale.
Adobe recommends creating a translation project after creating an Adaptive Form.
When new fields are added in an existing Adaptive Form:
[server:port]/libs/cq/i18n/gui/translator.html. Update the dictionary for the newly added fields and upload it.