![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Manage i18n operations such as message translation and date/time localization. More...
#include <StelLocaleMgr.hpp>
Public Types | |
| enum | STimeFormat { STime24h, STime12h, STimeSystemDefault } |
| enum | SDateFormat { SDateMMDDYYYY, SDateDDMMYYYY, SDateSystemDefault, SDateYYYYMMDD } |
| enum | STzFormat { STzCustom, STzGMTShift, STzSystemDefault } |
Public Member Functions | |
| void | init () |
| QString | getAppLanguage () const |
| void | setAppLanguage (const QString &newAppLangName) |
| StelTranslator & | getAppStelTranslator () const |
| QString | getSkyLanguage () const |
| void | setSkyLanguage (const QString &newSkyLangName) |
| StelTranslator & | getSkyTranslator () |
| QString | getTimeFormatStr (void) const |
| void | setTimeFormatStr (const QString &tf) |
| QString | getDateFormatStr (void) const |
| void | setDateFormatStr (const QString &df) |
| void | setCustomTimezone (QString tZ) |
| QString | getPrintableDateLocal (double JD) const |
| QString | getPrintableTimeLocal (double JD) const |
| void | setGMTShift (int t) |
| float | getGMTShift (double JD=0) const |
| void | setCustomTzName (const QString &tzname) |
| QString | getCustomTzName (void) const |
| STzFormat | getTzFormat (void) const |
| QString | getISO8601TimeLocal (double JD) const |
| double | getJdFromISO8601TimeLocal (const QString &str, bool *ok) const |
Static Public Member Functions | |
| static QString | countryCodeToString (const QString &countryCode) |
| static QStringList | getAllCountryNames () |
Manage i18n operations such as message translation and date/time localization.
| QString StelLocaleMgr::getAppLanguage | ( | ) | const [inline] |
Get the application language currently used for GUI etc.
This function has no permanent effect on the global locale.
| QString StelLocaleMgr::getDateFormatStr | ( | void | ) | const [inline] |
Get the format string which describes the current date format.
Valid values:
These values correspond to the similarly named values in the SDateFormat enum.
| QString StelLocaleMgr::getISO8601TimeLocal | ( | double | JD | ) | const |
Return the time in ISO 8601 format that is : Y-m-dTH:M:S.
| JD | the time and date expressed as a Julian date value. |
| double StelLocaleMgr::getJdFromISO8601TimeLocal | ( | const QString & | str, | |
| bool * | ok | |||
| ) | const |
Return the JD time for a local time ISO 8601 format that is: Y-m-dTH:M:S, but Y can be a large number with sign, and Y can be zero.
| str | the local time in ISO 8601 format. | |
| ok | set to false if the string was an invalid date. |
| QString StelLocaleMgr::getSkyLanguage | ( | ) | const |
Get the language currently used for sky objects.
This function has no permanent effect on the global locale.
| QString StelLocaleMgr::getTimeFormatStr | ( | void | ) | const [inline] |
Get the format string which describes the current time format.
Valid values are:
These values correspond to the similarly named values in the STimeFormat enum.
| void StelLocaleMgr::init | ( | ) |
Initialize object.
This process includes:
| void StelLocaleMgr::setAppLanguage | ( | const QString & | newAppLangName | ) |
Set the application language.
This applies to GUI etc. This function has no permanent effect on the global locale.
| newAppLangName | the abbreviated name of the language (e.g fr). |
| void StelLocaleMgr::setCustomTimezone | ( | QString | tZ | ) | [inline] |
Set the time zone.
| tZ | the time zone string as parsed from the TZ environment varibale by the tzset function from libc. |
| void StelLocaleMgr::setSkyLanguage | ( | const QString & | newSkyLangName | ) |
Set the sky language and reload the sky object names with the new translation.
This function has no permanent effect on the global locale.
| newSkyLangName | The abbreviated name of the locale (e.g fr) to use for sky object labels. |
| void StelLocaleMgr::setTimeFormatStr | ( | const QString & | tf | ) | [inline] |
Set the time format from a format string.
| tf | values are the same as the return values for getTimeFormatStr(). |
1.7.1