|
wxMaxima
|
The languages wxMaxima's user interface can be switched to (GH #849). More...
#include <wx/string.h>#include <vector>Go to the source code of this file.
Data Structures | |
| struct | wxm::UiLanguage |
| One entry of the UI language list. More... | |
Functions | |
| std::vector< UiLanguage > | wxm::UiLanguages () |
| The UI languages, in the order the language chooser lists them. | |
| wxString | wxm::UiLanguageSortKey (const wxString &name) |
| The key the language list is sorted by: a language's native name. | |
| wxString | wxm::UiLanguageLabel (const UiLanguage &language) |
| The text the language chooser shows for a language. | |
The languages wxMaxima's user interface can be switched to (GH #849).
Each language is listed under its own name ("Deutsch", "日本語"), followed by its name in the current UI language where that differs. Someone who ended up with a UI language they cannot read still finds their own language in the list that way, which a list of names translated into the unreadable language would not let them do.
Deliberately no flags: a flag stands for a country, not a language. English, Spanish, Portuguese, Arabic or Chinese would each need one country picked over the others, Catalan, Basque, Corsican, Galician or Kabyle would need a regional or no flag at all, and Traditional Chinese is written in more than one place whose flag is a political statement. Names are what the operating systems use for the same purpose, and the two Chinese variants are named by their script, not by a region.
| wxString wxm::UiLanguageLabel | ( | const UiLanguage & | language | ) |
The text the language chooser shows for a language.
"Deutsch — German" in an English UI, "Deutsch" alone in a German one.
| std::vector< wxm::UiLanguage > wxm::UiLanguages | ( | ) |
The UI languages, in the order the language chooser lists them.
The "use the default language" entry comes first, then every language sorted by its own name. The translated names are looked up on every call, so the result follows a UI language change.
| wxString wxm::UiLanguageSortKey | ( | const wxString & | name | ) |
The key the language list is sorted by: a language's native name.
A plain comparison of code points would sort "Čeština" after "Türkçe". wxWidgets offers no collation that works without the OS having that locale installed, so this folds the Latin-1 and Latin Extended-A letters (U+00C0 to U+017F, which covers every name in the list) to the first character of their canonical decomposition, Č to C and ã to a, and ignores case. Other scripts sort by code point, which groups them by script after the Latin one, as the operating systems' language choosers do.