Describing all languages available to the system.¶
Describing all languages available to the system.¶
1# This example displays all the languages available to
2# the impact.system and finally describes the active language
3
4
5# Create a local variable for the output toolbox
6ot = impact.gui.output_toolbox
7
8# Create a local variable for the languages available to the impact.system
9languages = impact.system.languages
10
11
12# Define a method to describe a language
13def describe_language(l):
14 ot.add("------------")
15 ot.add("English Name: " + str(l.english_name))
16 ot.add("Native Name: " + str(l.native_name))
17 ot.add("Code Page: " + str(l.code_page))
18 ot.add("Locale: " + str(l.locale))
19 ot.add("Primary: " + str(l.primary))
20 ot.add("Sub: " + str(l.sub))
21 ot.add("ISO Language: " + str(l.iso_language))
22 ot.add("ISO Default Country: " + str(l.iso_default_country))
23
24
25# Clear the output toolbox
26ot.clear()
27
28# Iterate all the languages
29for language in languages:
30
31 # Describe each language
32 describe_language(language)
33
34# Describe the active language
35ot.add("------------")
36ot.add("Active Language")
37
38describe_language(impact.system.active_language)