![]() |
Stellarium
24.4
|
Manage i18n operations such as message translation and date/time localization. More...
#include <StelLocaleMgr.hpp>
Public Types | |
| enum | STimeFormat { STimeSystemDefault , STime24h , STime12h } |
| The time display format. More... | |
| enum | SDateFormat { SDateSystemDefault , SDateMMDDYYYY , SDateDDMMYYYY , SDateYYYYMMDD , SDateWWMMDDYYYY , SDateWWDDMMYYYY , SDateWWYYYYMMDD } |
| The date display format. More... | |
Public Member Functions | |
| void | init () |
| Initialize object. More... | |
| QString | getAppLanguage () const |
| Get the application language currently used for GUI etc. More... | |
| void | setAppLanguage (const QString &newAppLangName, bool refreshAll=true) |
| Set the application language. More... | |
| const StelTranslator & | getAppStelTranslator () const |
| Get the StelTranslator object currently used for global application. | |
| bool | isAppRTL () const |
| Get the type (RTL or LTR) of application language currently used for GUI etc. | |
| QString | getSkyLanguage () const |
| Get the language currently used for sky objects. More... | |
| void | setSkyLanguage (const QString &newSkyLangName, bool refreshAll=true) |
| Set the sky language and reload the sky object names with the new translation. More... | |
| const StelTranslator & | getSkyTranslator () const |
| Get a reference to the StelTranslator object currently used for sky objects. | |
| const StelTranslator & | getPlanetaryFeaturesTranslator () const |
| Get a reference to the StelTranslator object currently used for planetary features. | |
| const StelTranslator & | getScriptsTranslator () const |
| Get a reference to the StelTranslator object currently used for scripts. | |
| bool | isSkyRTL () const |
| Get the type (RTL or LTR) of language currently used for sky objects. | |
| QString | getTimeFormatStr (void) const |
| Get the format string which describes the current time format. More... | |
| void | setTimeFormatStr (const QString &tf) |
| Set the time format from a format string. More... | |
| QString | getDateFormatStr (void) const |
| Get the format string which describes the current date format. More... | |
| void | setDateFormatStr (const QString &df) |
| QString | getQtDateFormatStr (void) const |
| Get the format string which describes the current date format (Qt style). | |
| QString | getPrintableDateLocal (double JD, double utcOffsetHrs) const |
| Get a localized, formatted string representation of the date component of a Julian date. More... | |
| QString | getPrintableTimeLocal (double JD, double utcOffsetHrs) const |
| Get a localized, formatted string representation of the time component of a Julian date. More... | |
| QString | getPrintableTimeZoneLocal (double JD, double utcOffsetHrs) const |
| Get a localized, formatted string representation of the time zone of a Julian date. More... | |
| QString | getISO8601TimeLocal (double JD, double utcOffsetHrs) const |
| Return the time in ISO 8601 format that is : Y-m-dTH:M:S. More... | |
| double | 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. More... | |
Static Public Member Functions | |
| static QString | shortDayName (int weekday) |
| Returns the short name of the weekday [0=Sunday, 1=Monday..6]; weekday mod 7) | |
| static QString | longDayName (int weekday) |
| Returns the long name of the weekday ([0..6]; weekday mod 7) | |
| static QString | shortMonthName (int month) |
| Returns the short name of the month [1..12]. | |
| static QString | longMonthName (int month) |
| Returns the long name of the month [1..12]. | |
| static QString | longGenitiveMonthName (int month) |
| Returns the genitive long name of the month [1..12]. | |
| static QString | romanMonthName (int month) |
| Returns the Roman name (a number) of the month [1..12]. | |
Manage i18n operations such as message translation and date/time localization.
The date display format.
|
inline |
Get the application language currently used for GUI etc.
This function has no permanent effect on the global locale.
|
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, |
| double | utcOffsetHrs | ||
| ) | 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. |
| utcOffsetHrs | from StelCore::getUTCOffset(JD) |
| 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::getPrintableDateLocal | ( | double | JD, |
| double | utcOffsetHrs | ||
| ) | const |
Get a localized, formatted string representation of the date component of a Julian date.
| utcOffsetHrs | from StelCore::getUTCOffset(JD) |
| QString StelLocaleMgr::getPrintableTimeLocal | ( | double | JD, |
| double | utcOffsetHrs | ||
| ) | const |
Get a localized, formatted string representation of the time component of a Julian date.
| utcOffsetHrs | from StelCore::getUTCOffset(JD) |
| QString StelLocaleMgr::getPrintableTimeZoneLocal | ( | double | JD, |
| double | utcOffsetHrs | ||
| ) | const |
Get a localized, formatted string representation of the time zone of a Julian date.
| utcOffsetHrs | from StelCore::getUTCOffset(JD) |
| QString StelLocaleMgr::getSkyLanguage | ( | ) | const |
Get the language currently used for sky objects.
This function has no permanent effect on the global locale.
|
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, |
| bool | refreshAll = true |
||
| ) |
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::setSkyLanguage | ( | const QString & | newSkyLangName, |
| bool | refreshAll = true |
||
| ) |
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. |
|
inline |
Set the time format from a format string.
| tf | values are the same as the return values for getTimeFormatStr(). |