Advanced Techniques - Multilingual data records
If you would like to show data records in more than one language in the portal,
e.g. German and English, you need the translation of the data record in each
language and the two-letter language code according to ISO 3166-1 - e.g.
for German and en
for English. The method described below can of course be used for any number
Create the application
Create a new application based on the application template
From the context menu
of the data group, create a new data field. Enter
as the title and select
as the data type. Click on OK
Create a drop-down list
and enter Language
as the title. Click on
Select the option Special data sources
and the class LanguageListProcessor
. Click on Next
Select the data field Language code
to connect the drop-down list to it and then click on
and finally Finish
Now switch to the All entries
page and open the
of the view table
and add the data field Language code
Click on OK
Then switch to the browser.
Create a German and English data record on the edit page.
As you can see, the view table on the All entries
displays both data records with their language code. The function of the class
is therefore to display
the language names in the drop-down list. It's much easier to select a language
than to select the right language code, as these are easily confused.
The class LanguageListProcessor
corresponding language code in the data field. The language-dependent
display of data records can only be achieved with the saved language code.
To filter the data records dependent on the language, please reopen
the properties dialog
of the view table.
Create a filter
the data field Language code
with the system
Refresh the application in the browser (F5 key). If your portal is
set to English, only the English data record will be shown in the table.
Now switch the portal to German.
The table now only shows the German data record.
Alongside the class LanguageListProcessor
that provides the entries for the drop-down list for the language, there are
also many more classes, which, for example, only list the languages
that you have in the
Regional settings of the Portal properties
You can find more information about that
The Dynamic view
can also be set up to display already saved language codes, like the drop-down list,
and then provides the language names instead of the codes.