StoreCenter Help : Online Editor : Variable Actions Samples : Switch between languages (multilingual form)
Switch between languages (multilingual form)
In a multilingual form you can use a variable to switch to the language of the store so the shopper sees the form labels in his own language.
Create a variable named translation_keep_visible. Its type is not important, leave it set to 'Short Text'. Make sure the variable is visible.
Add an action of the 'Validate' type that contains the code below. In this example it is assumed there are two variables firstname and lastname that need their display name or label translated to French and German
Action code:
1 if variable translation_keep_visible visible is true
2 set variable translation_keep_visible visible = false
3 declare string language = document languageName
4 if local language is string FR
5 set variable firstname displayName = string Prénom
6 set variable lastname displayName = string Nom
7 end if
8 if local language is string DE
9 set variable firstname displayName = string Vorname
10 set variable lastname displayName = string Familienname
11 end if
12 end if
doc. version 6.0.4