Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://astro.uni-altai.ru/~aw/stellarium/api/classStelTranslator.html
Дата изменения: Unknown Дата индексирования: Fri Feb 28 07:31:16 2014 Кодировка: Поисковые слова: http astrokuban.info astrokuban |
Stellarium 0.12.3
|
Class used to translate strings to any language. More...
#include <StelTranslator.hpp>
Public Member Functions | |
StelTranslator (const QString &adomain, const QString &amoDirectory, const QString &alangName) | |
Create a translator from a language name. More... | |
QString | qtranslate (const QString &s, const QString &c=QString()) |
Translate input message and return it as a QString. More... | |
const QString & | getTrueLocaleName (void) const |
Get true translator locale name. More... | |
QStringList | getAvailableLanguagesNamesNative (const QString &localeDir="") const |
Get available language name in native language from passed locales directory. More... | |
Static Public Member Functions | |
static QString | iso639_1CodeToNativeName (const QString &languageCode) |
Convert from ISO639-1 langage code to native language name. More... | |
static QString | nativeNameToIso639_1Code (const QString &languageName) |
Convert from native language name to ISO639-1 2 letters langage code. More... | |
static void | init (const QString &fileName) |
Initialize Translation. More... | |
Static Public Attributes | |
static StelTranslator | globalTranslator |
Used as a global translator by the whole app. More... | |
Class used to translate strings to any language.
Implements a nice interface to gettext which is UTF-8 compliant and is somewhat multiplateform All its operations do not modify the global locale. The purpose of this class is to remove all non-OO C locale functions from stellarium.
Definition at line 54 of file StelTranslator.hpp.
|
inline |
Create a translator from a language name.
If the passed locale name cannot be handled by the system, default value will be used. The passed language name is a language code string like "fr" or "fr_FR". This class wrap gettext to simulate an object oriented multiplateform gettext UTF8 translator
adomain | The name of the domain to use for translation |
amoDirectory | The directory where to look for the domain.mo translation files. |
alangName | The C locale name or language name like "fr" or "fr_FR". If string is "" or "system" it will use the system locale. |
Definition at line 65 of file StelTranslator.hpp.
QStringList StelTranslator::getAvailableLanguagesNamesNative | ( | const QString & | localeDir = "" | ) | const |
Get available language name in native language from passed locales directory.
|
inline |
Get true translator locale name.
Actual locale, never "system".
Definition at line 103 of file StelTranslator.hpp.
|
static |
Initialize Translation.
fileName | file containing the list of language codes |
|
static |
Convert from ISO639-1 langage code to native language name.
languageCode | the code to look up |
|
static |
Convert from native language name to ISO639-1 2 letters langage code.
|
inline |
Translate input message and return it as a QString.
s | input string in english. |
c | disambiguation string (gettext "context" string). |
Definition at line 75 of file StelTranslator.hpp.
|
static |
Used as a global translator by the whole app.
Definition at line 112 of file StelTranslator.hpp.