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
9# Define a method to describe a language
10def describe_language(l):
11 ot.add("------------")
12 ot.add("English Name: " + str(l.english_name))
13 ot.add("Native Name: " + str(l.native_name))
14 ot.add("Code Page: " + str(l.code_page))
15 ot.add("Locale: " + str(l.locale))
16 ot.add("Primary: " + str(l.primary))
17 ot.add("Sub: " + str(l.sub))
18 ot.add("ISO Language: " + str(l.iso_language))
19 ot.add("ISO Default Country: " + str(l.iso_default_country))
20
21
22# Clear the output toolbox
23ot.clear()
24
25# Create a local variable for the languages available to the impact.system
26languages = impact.system.languages
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)