L-VIS User Manual
254
LOYTEC
Version 6.2
LOYTEC electronics GmbH
Region:
In case the selected language is spoken in different regions of the world,
refine the selection by picking the appropriate region. This will change details
like the used decimal separator, grouping character, or currency of the locale to
match the selected region. It will also influence the selection of available scripts
and calendar systems (see below).
Script:
In some regions, more than one script is commonly used. For example,
Hong Kong may use either simplified or traditional Chinese. In most cases,
however, the script will be automatically defined by the selected language and
region, without any options to choose from.
Calendar:
The calendar system to use. While most regions exclusively use the
Gregorian calendar, there are some regions in which multiple different calendar
systems are in use. For these regions, the calendar selector becomes available and
lists the commonly used calendar systems for the selected region, for example
Gregorian, Hebrew, and Islamic for region Israel. The selection of the calendar
system has a big impact on how dates are displayed in a locale aware date
control.
Since the locale can be changed during run time via a system register, the settings made in
the project preferences are merely a default and are not put into effect at every project
download. Instead, the following algorithm applies:
When a new project is downloaded, the device checks if the locale settings of the
new project are different from the old project. If yes, the settings from the new
project are taken over (activated on the device). Otherwise, the current device
locale remains unchanged, even if it is different from the project settings.
This ensures that changing the locale settings of the project in an otherwise static system
(no run time changes) will take effect after download, and at the same time keep any run
time selection of a different locale persistent across project downloads, as long as the locale
setting of the project remains untouched.
11.3.1 Locale ID Format
In case the locale is going to be changed during run time, it is necessary to understand the
format of the locale specifier string in order to construct valid input for the system register.
A locale ID string consists of one or more pieces of ordered information:
Language Code:
The first part of any locale string is the language identifier.
Languages are specified using a two-letter lowercase code for a particular
language. For example, Spanish is
es
, English is
en
and French is
fr
. The two-
letter language code follows the ISO-639 standard.
Script Code:
The optional four-letter script code follows the language code. If
specified, it should be a valid script code as listed on the Unicode ISO-15924
Registry, for example
Latn
for Latin,
Hans
for simplified Chinese, or
Jpan
for
Japanese.
Country Code (Region):
There are often different language conventions within
the same language. For example, Spanish is spoken in many countries in Central
and South America but the currencies are different in each country. To allow for
these differences among specific geographical, political, or cultural regions,
locales are specified by two-letter, uppercase codes. For example,
ES
represents
Spain and
MX
represents Mexico. The two letter country code uses the ISO-3166
standard.
Keywords:
The final element of a locale is an optional list of keywords together
with their values. Keywords must be unique. Their order is not significant.