StelTranslator.hpp   StelTranslator.hpp 
skipping to change at line 65 skipping to change at line 65
//! The passed language name is a language code string like "fr" or "fr_FR". //! The passed language name is a language code string like "fr" or "fr_FR".
//! This class wrap gettext to simulate an object oriented multiplat eform gettext UTF8 translator //! This class wrap gettext to simulate an object oriented multiplat eform gettext UTF8 translator
//! @param adomain The name of the domain to use for translation //! @param adomain The name of the domain to use for translation
//! @param amoDirectory The directory where to look for the domain.m o translation files. //! @param amoDirectory The directory where to look for the domain.m o translation files.
//! @param alangName The C locale name or language name like "fr" or "fr_FR". If string is "" or "system" it will use the system locale. //! @param alangName The C locale name or language name like "fr" or "fr_FR". If string is "" or "system" it will use the system locale.
StelTranslator(const QString& adomain, const QString& alangName); StelTranslator(const QString& adomain, const QString& alangName);
~StelTranslator(); ~StelTranslator();
//! Translate input message and return it as a QString. //! Translate input message and return it as a QString.
//! If the string is not translated in the current locale, the input string is returned unchanged.
//! @param s input string in english. //! @param s input string in english.
//! @param c disambiguation string (gettext "context" string). //! @param c disambiguation string (gettext "context" string).
//! @return The translated QString //! @return The translated QString
QString qtranslate(const QString& s, const QString& c = QString()) c onst; QString qtranslate(const QString& s, const QString& c = QString()) c onst;
//! Try to translate input message and return it as a QString. If no
translation
//! exist for the current StelTranslator language, a null string is
returned.
//! @param s input string in english.
//! @param c disambiguation string (gettext "context" string).
//! @return The translated QString
QString tryQtranslate(const QString& s, const QString& c = QString()
) const;
//! Get true translator locale name. Actual locale, never "system". //! Get true translator locale name. Actual locale, never "system".
//! @return Locale name e.g "fr_FR" //! @return Locale name e.g "fr_FR"
const QString& getTrueLocaleName() const const QString& getTrueLocaleName() const
{ {
if (langName=="system" || langName=="system_default") if (langName=="system" || langName=="system_default")
return StelTranslator::systemLangName; return StelTranslator::systemLangName;
else else
return langName; return langName;
} }
//! Used as a global translator by the whole app //! Used as a global translator by the whole app
static StelTranslator* globalTranslator; static StelTranslator* globalTranslator;
//! Get available language name in native language from passed local es directory //! Get available language name in native language from passed local es directory
QStringList getAvailableLanguagesNamesNative(const QString& localeDi r="") const; QStringList getAvailableLanguagesNamesNative(const QString& localeDi r="", const QString &section="") const;
//! Convert from ISO639-1 langage code to native language name //! Convert from ISO639-1 langage code to native language name
//! @param languageCode the code to look up //! @param languageCode the code to look up
static QString iso639_1CodeToNativeName(const QString& languageCode) ; static QString iso639_1CodeToNativeName(const QString& languageCode) ;
//! Convert from native language name to ISO639-1 2 letters langage code //! Convert from native language name to ISO639-1 2 letters langage code
static QString nativeNameToIso639_1Code(const QString& languageName) ; static QString nativeNameToIso639_1Code(const QString& languageName) ;
//! Initialize Translation //! Initialize Translation
//! @param fileName file containing the list of language codes //! @param fileName file containing the list of language codes
 End of changes. 3 change blocks. 
1 lines changed or deleted 12 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/