Sie sind auf Seite 1von 5

Applying i18 n in multiple labels of the dialog component

1. Create an “i18n” node (node Type sling: Folder) under root node of the title
component.
E.g. apps/training/components/content/title
2. Create an “en” node (node Type sling: Folder) under the newly created i18n
Node.
3. Create a” fieldLabel1” node (node Type sling: MessageEntry) under the newly
created “en” node.

Create the properties of the “fieldLabel1” node as below: Mention sling: key as
“i18n-title” & sling: message as “Enter Name”

4. Create a” fieldLabel2” node (node Type sling: MessageEntry) under the newly
created “en” node.
Create the properties of the “fieldLabel2” node as below: Mention sling: key as
“i18n-Enter Address” & sling: message as “Enter Address”

5. Similarly create an “es” node (node Type sling: Folder) under the newly created i18n
Node.
6. Similarly create a” fieldLabel1” node (node Type sling: MessageEntry) under the
newly created “es” node.

Create the properties of the “fieldLabel1” node as below: Mention sling: key as
“i18n-title” & sling: message as “Introduzca el nombre de”
7. Similarly create a” fieldLabel2” node (node Type sling: MessageEntry) under the
newly created “es” node.

Create the properties of the “fieldLabel1” node as below: Mention sling: key as
“i18n-Enter Address” & sling: message as “Introduzca la dirección”

8. Now create a dialog inside the “apps/training/components/content/title”. Create


widget like “01”, “02” etc
9. Create “01” widget property as below:
In fieldLabel value mentioning “i18n-title”.It will map with the” fieldLabel1” node
under the “en” & “es” node and will pick up the corresponding sling: message value
in en & es . (Like: “Enter name” and “Introduzca el nombre de” mentioned in step 3
& step 6)

10. Create “02” widget property as below:


In fieldLabel value mentioning “i18n-Enter Address”. It will map with the”
fieldLabel2” node under the “en” & “es” node and will pick up the corresponding
sling: message value in en & es. (Like: “Enter Address” and “Introduzca la dirección”
mentioned in step 4 & step 7)

# After doing all the above changes if we run the script dialog it will display in English
language since the content author’s default current language preference is English.
Output will be as below:
# If we want to display the dialog values in Spanish, change the content author’s
language preference to Spanish. Go to “Users” in toolbar. Select “admin” and
doubleclick.Then go to “Preferences” tab & change the “Language” dropdown value
to “Spanish”. Save it.
Output will be as below:

Das könnte Ihnen auch gefallen