135. Language

This module does all language related stuff:

135.1. Authors

  • Klaus Kaempf <kkaempf@suse.de>

  • Thomas Roelz <tom@suse.de>

  • Maintainer: Jiri Suchomel <jsuchome@suse.cz>

135.2. Summary of Module Globals

List of Global Functions

  • CJKLanguage - Check if the language is "CJK" (and thus could not be shown in text mode - see bug #102958)

  • CheckIncompleteTranslation - Checks if translation is complete and displays Continue/Cancel popup messsage if it is not return true if translation is OK or user agrees with the warning

  • CheckLanguagesSupport - check if selected language has support on media (F301238) show a warning when not

  • Export - AutoYaST interface function: Return the Language configuration as a map.

  • GetExpertValues - GetExpertValues()

  • GetLang2KeyboardMap - return the content of lang2keyboard map (mapping of languages to their default (proposed) keyboard layouts)

  • GetLang2TimezoneMap - return the content of lang2timezone map (mapping of languages to their default (proposed) time zones)

  • GetLanguageCountry - de_DE@UTF-8 -> "DE"

  • GetLanguagesMap - Return the whole map with language descriptions

  • GetLocaleString - generate the whole locale string for given language according to DB (e.g. de_DE -> de_DE.UTF-8)

  • GetLocales - return the map of all supported countries and language codes

  • GetName - return user readable description of language

  • GetTextMode - return the value of text_mode (true for ncurses)

  • Import - AutoYaST interface function: Get the Language configuration from a map.

  • IncompleteTranslation - Returns true if translation for given language is not complete

  • Language - Constructor

  • MakeProposal - Return proposal string.

  • MakeSimpleProposal - Return 'simple' proposal string.

  • Modified - was anything modified?

  • PackagesInit - Initializes source and target, computes the packages necessary to install and uninstall, checks for disk space (#50745)

  • PackagesModified - Does the modification of language(s) require installation of new packages? This test compares the list of original languages (primary+secondary) with the list after user's modifications

  • QuickSet - Set the language that was read from sysconfig, read only one needed language file

  • Read - Store the inital values; in normal mode, read from system was done in constructor

  • ReadSysconfigLanguage - Read the RC_LANG value from sysconfig and exctract language from it

  • ReadSysconfigValues - Read the rest of language values from sysconfig

  • Save - Save state to target.

  • Selection - Return a map of ids and names to build up a selection list for the user. The key is used later in the Set function to select this language. The name is a translated string.

  • Set - Set module to selected language.

  • SetDefault - Store current language as default language.

  • SetExpertValues - SetExpertValues()

  • Summary - AutoYaST interface function: Return the summary of Language configuration as a map.

  • WfmSetGivenLanguage - WfmSetLanguag()

  • WfmSetLanguage - WfmSetLanguag()

List of Global Variables

135.3. Global Functions

135.3.1. CJKLanguage

Check if the language is "CJK" (and thus could not be shown in text mode - see bug #102958)

Function parameters

  • string lang

Return value

  • boolean

135.3.2. CheckIncompleteTranslation

Checks if translation is complete and displays Continue/Cancel popup messsage if it is not return true if translation is OK or user agrees with the warning

Function parameters

  • string lang

Return value

  • boolean

135.3.3. CheckLanguagesSupport

check if selected language has support on media (F301238) show a warning when not

Function parameters

  • string selected_language

Return value

  • void

135.3.4. Export

AutoYaST interface function: Return the Language configuration as a map.

Return value

  • map - with the settings

135.3.5. GetExpertValues

GetExpertValues()

Return value

  • map - with values filled in

135.3.6. GetLang2KeyboardMap

return the content of lang2keyboard map (mapping of languages to their default (proposed) keyboard layouts)

Function parameters

  • boolean force

Return value

  • map<string,string>

135.3.7. GetLang2TimezoneMap

return the content of lang2timezone map (mapping of languages to their default (proposed) time zones)

Function parameters

  • boolean force

Return value

  • map<string,string>

135.3.8. GetLanguageCountry

de_DE@UTF-8 -> "DE"

Return value

  • string - country part of language

135.3.9. GetLanguagesMap

Return the whole map with language descriptions

Function parameters

  • boolean force

Return value

  • map<string, list>

135.3.10. GetLocaleString

generate the whole locale string for given language according to DB (e.g. de_DE -> de_DE.UTF-8)

Function parameters

  • string lang

Return value

  • string

135.3.11. GetLocales

return the map of all supported countries and language codes

Return value

  • map<string,integer>

135.3.12. GetName

return user readable description of language

Return value

  • string

135.3.13. GetTextMode

return the value of text_mode (true for ncurses)

Return value

  • boolean

135.3.14. Import

AutoYaST interface function: Get the Language configuration from a map.

Function parameters

  • map settings

Return value

  • boolean - success

135.3.15. IncompleteTranslation

Returns true if translation for given language is not complete

Function parameters

  • string lang

Return value

  • boolean

135.3.16. Language

Constructor

Return value

  • void

135.3.17. MakeProposal

Return proposal string.

Function parameters

  • boolean force_reset

  • boolean language_changed

Return value

  • list<string> - user readable description. If force_reset is true reset the module to the language stored in default_language.

135.3.18. MakeSimpleProposal

Return 'simple' proposal string.

Return value

  • string - preformated description.

135.3.19. Modified

was anything modified?

Return value

  • boolean

135.3.20. PackagesInit

Initializes source and target, computes the packages necessary to install and uninstall, checks for disk space (#50745)

Function parameters

  • list<string> selected_languages

Return value

  • boolean - false when there is not enough disk space for new packages

135.3.21. PackagesModified

Does the modification of language(s) require installation of new packages? This test compares the list of original languages (primary+secondary) with the list after user's modifications

Return value

  • boolean

135.3.22. QuickSet

Set the language that was read from sysconfig, read only one needed language file

Function parameters

  • string lang

Return value

  • void

135.3.23. Read

Store the inital values; in normal mode, read from system was done in constructor

Function parameters

  • boolean really

Return value

  • boolean

135.3.24. ReadSysconfigLanguage

Read the RC_LANG value from sysconfig and exctract language from it

Return value

  • string - language

135.3.25. ReadSysconfigValues

Read the rest of language values from sysconfig

Return value

  • void

135.3.26. Save

Save state to target.

Return value

  • void

135.3.27. Selection

Return a map of ids and names to build up a selection list for the user. The key is used later in the Set function to select this language. The name is a translated string.

Return value

  • map<string, list> - of $[ language : [ utf8-name, ascii-name] ...] for all known languages 'language' is the (2 or 5 char) ISO language code. 'utf8-name' is a user-readable (UTF-8 encoded !) string. 'ascii-name' is an english (ascii encoded !) string.

See also:

  • Set

135.3.28. Set

Set module to selected language.

Function parameters

  • string lang

Return value

  • void

135.3.29. SetDefault

Store current language as default language.

Return value

  • void

135.3.30. SetExpertValues

SetExpertValues()

Function parameters

  • map val

Return value

  • void -

135.3.31. Summary

AutoYaST interface function: Return the summary of Language configuration as a map.

Return value

  • string - summary string

135.3.32. WfmSetGivenLanguage

WfmSetLanguag()

Function parameters

  • string lang

Return value

  • void - -

135.3.33. WfmSetLanguage

WfmSetLanguag()

Return value

  • void - -

135.4. Global Variables

135.4.1. language

currently selected language

135.4.2. language_on_entry

original language

135.4.3. languages

Default settings for INSTALLED_LANGUAGES in /etc/sysconfig/language

135.4.4. languages_on_entry

Original value of INSTALLED_LANGUAGES

135.4.5. preselected

language preselected in /etc/install.inf

135.4.6. selection_skipped

Was the initial language selection skipped? (see bug 223258) (It can be, if the language was selected in linuxrc)

135.5. Module Requirements

135.5.1. Module Imports

  • AsciiFile
  • Directory
  • Encoding
  • FileUtils
  • HTML
  • InstExtensionImage
  • Linuxrc
  • Misc
  • Mode
  • PackageCallbacks
  • PackageSystem
  • Popup
  • ProductFeatures
  • Stage

135.5.2. Module Includes