Метод |
Описание |
|
AllCountriesList ( ) : List |
Provides list of all known country codes. Use countryCodeToName(country) to get human readable, localized country names. |
|
AllLanguagesList ( ) : List |
Provides list of all known language codes. Use languageCodeToName(language) to get human readable, localized language names. |
|
Calendar ( ) : KCalendarSystem |
Returns a pointer to the calendar system object. |
|
CalendarType ( ) : string |
Returns the name of the calendar system that is currently being used by the system. |
|
CodecForEncoding ( ) : QTextCodec |
Returns the user's preferred encoding. Should never be NULL. |
|
CopyCatalogsTo ( KLocale locale ) : void |
Copies the catalogs of this objct to an other KLocale object. |
|
Country ( ) : string |
Returns the country code of the country where the user lives. defaultCountry() is returned by default, if no other available. Use countryCodeToName(country) to get human readable, localized country names. |
|
CountryCodeToName ( string country ) : string |
Convert a known country code to a human readable, localized form. If an unknown country code is supplied, empty string is returned; this will never happen if the code has been obtained by one of the KLocale methods. name="code" the country code |
|
CurrencySymbol ( ) : string |
Returns what the symbol denoting currency in the current locale as as defined by user settings should look like. |
|
DateFormatShort ( ) : string |
Returns the currently selected short date format. |
|
DateMonthNamePossessive ( ) : bool |
Use this to determine whether in dates a possessive form of month name is preferred ("of January" rather than "January") |
|
DecimalSymbol ( ) : string |
Returns what a decimal point should look like ("." or "," etc.) according to the current locale or user settings. |
|
DefaultCountry ( ) : string |
Returns the name of the default country. |
|
DefaultLanguage ( ) : string |
Returns the name of the internal language. |
|
Dispose ( ) : void |
|
|
Encoding ( ) : Qyoto.QByteArray |
Returns the user's preferred encoding. |
|
EncodingMib ( ) : int |
Returns the user's preferred encoding. |
|
FileEncodingMib ( ) : int |
Returns the file encoding. |
|
FormatByteSize ( double size ) : string |
Converts size from bytes to the string representation using the IEC 60027-2 standard Example: formatByteSize(1024) returns "1.0 KiB" name="size" size in bytes |
|
FormatDate ( QDate date ) : string |
|
|
FormatDate ( QDate date, KLocale format ) : string |
Returns a string formatted to the current locale's conventions regarding dates. name="date" the date to be formatted. name="format" category of date format to use |
|
FormatDateTime ( KDateTime dateTime ) : string |
|
|
FormatDateTime ( KDateTime dateTime, KLocale format ) : string |
|
|
FormatDateTime ( KDateTime dateTime, KLocale format, uint options ) : string |
Returns a string formatted to the current locale's conventions regarding both date and time. name="dateTime" the date and time to be formatted name="format" category of date format to use name="options" additional output options |
|
FormatDateTime ( Qyoto.QDateTime dateTime ) : string |
|
|
FormatDateTime ( Qyoto.QDateTime dateTime, KLocale format ) : string |
|
|
FormatDateTime ( Qyoto.QDateTime dateTime, KLocale format, bool includeSecs ) : string |
Returns a string formatted to the current locale's conventions regarding both date and time. name="dateTime" the date and time to be formatted name="format" category of date format to use name="options" additional output options |
|
FormatDuration ( ulong mSec ) : string |
Given a number of milliseconds, converts that to a string containing the localized equivalent e.g. given formatDuration(60000), returns "1.0 minutes" name="mSec" Time duration in milliseconds |
|
FormatLong ( long num ) : string |
Given an integer, converts that to a numeric string containing the localized numeric equivalent. e.g. given 123456L, return "123,456" (for some European country). name="num" The number to convert |
|
FormatMoney ( double num ) : string |
|
|
FormatMoney ( double num, string currency ) : string |
|
|
FormatMoney ( double num, string currency, int digits ) : string |
Given a double, converts that to a numeric string containing the localized monetary equivalent. e.g. given 123456, return "$ 123,456.00". name="num" The number we want to format name="currency" The currency symbol you want. name="digits" Number of fractional digits, or -1 for the default value |
|
FormatNumber ( double num ) : string |
|
|
FormatNumber ( double num, int precision ) : string |
Given a double, converts that to a numeric string containing the localized numeric equivalent. e.g. given 123456.78F, return "123,456.78" (for some European country). If precision isn't specified, 2 is used. This function is a wrapper that is provided for convenience. name="num" The number to convert name="precision" Number of fractional digits used. |
|
FormatNumber ( string numStr ) : string |
|
|
FormatNumber ( string numStr, bool round ) : string |
|
|
FormatNumber ( string numStr, bool round, int precision ) : string |
Given a string representing a number, converts that to a numeric string containing the localized numeric equivalent. e.g. given 123456.78F, return "123,456.78" (for some European country). name="numStr" The number to format, as a string. name="round" Round fractional digits. (default true) name="precision" Number of fractional digits used for rounding. Unused if round=false. (default 2) |
|
FormatTime ( Qyoto.QTime pTime ) : string |
|
|
FormatTime ( Qyoto.QTime pTime, bool includeSecs ) : string |
|
|
FormatTime ( Qyoto.QTime pTime, bool includeSecs, bool isDuration ) : string |
Returns a string formatted to the current locale's conventions regarding times. name="pTime" The time to be formatted. name="includeSecs" if true, seconds are included in the output, otherwise only hours and minutes are formatted. name="isDuration" if true, the given time is a duration, not a clock time. This means "am/pm" shouldn't be displayed. |
|
FracDigits ( ) : int |
The number of fractional digits to include in numeric/monetary values (usually 2). |
|
InsertCatalog ( string catalog ) : void |
Adds another catalog to search for translation lookup. This function is useful for extern libraries and/or code, that provide there own messages. If the catalog does not exist for the chosen language, it will be ignored and en_US will be used. name="catalog" The catalog to add. |
|
IsApplicationTranslatedInto ( string language ) : bool |
Checks whether or not the active catalog is found for the given language. name="language" language to check |
|
KLocale ( KLocale rhs ) : System |
Copy constructor. |
|
KLocale ( string catalog ) : System |
|
|
KLocale ( string catalog, Kimono.KSharedConfig config ) : System |
Constructs a KLocale with the given catalog name. The constructor looks for an entry Locale/Language in the configuration file. If no config file is specified, it will also look for languages using the environment variables (KDE_LANG, LC_MESSAGES, LC_ALL, LANG), as well as the global configuration file. If KLocale is not able to use any of the specified languages, the default language (en_US) will be used. If you specify a configuration file, it has to be valid until the KLocale object is destroyed. name="catalog" The name of the main language file name="config" The configuration file to use. |
|
KLocale ( string catalog, string language ) : System |
|
|
KLocale ( string catalog, string language, string country ) : System |
|
|
KLocale ( string catalog, string language, string country, Kimono.KConfig config ) : System |
|
|
Language ( ) : string |
Returns the language code used by this object. The domain AND the library translation must be available in this language. defaultLanguage() is returned by default, if no other available. Use languageCodeToName(language) to get human readable, localized language name. |
|
LanguageCodeToName ( string language ) : string |
Convert a known language code to a human readable, localized form. If an unknown language code is supplied, empty string is returned; this will never happen if the code has been obtained by one of the KLocale methods. name="language" the language code |
|
LanguageList ( ) : List |
Returns the language codes selected by user, ordered by decreasing priority. Use languageCodeToName(language) to get human readable, localized language name. |
|
LocalizedFilePath ( string filePath ) : string |
Tries to find a path to the localized file for the given original path. This is intended mainly for non-text resources (images, sounds, etc.), whereas text resources should be handled in more specific ways. The possible localized paths are checked in turn by priority of set languages, in form of dirname/l10n/ll/basename, where dirname and basename are those of the original path, and ll is the language code. KDE core classes which resolve paths internally (e.g. KStandardDirs) will usually perform this lookup behind the scene. In general, you should pipe resource paths through this method only on explicit translators' request, or when a resource is an obvious candidate for localization (e.g. a splash screen or a custom icon with some text drawn on it). name="filePath" path to the original file |
|
MonetaryDecimalSymbol ( ) : string |
Returns what a decimal point should look like ("." or "," etc.) for monetary values, according to the current locale or user settings. |
|
MonetaryThousandsSeparator ( ) : string |
Returns what a thousands separator for monetary values should look like ("," or " " etc.) according to the current locale or user settings. |
|
NegativeMonetarySignPosition ( ) : KLocale.SignPosition |
Denotes where to place a negative sign in relation to a monetary value. |
|
NegativePrefixCurrencySymbol ( ) : bool |
If and only if the currency symbol precedes a negative value, this will be true. |
|
NegativeSign ( ) : string |
Returns what a negative sign should look like ("-", etc.) according to the current locale or user settings. |
|
NounDeclension ( ) : bool |
Use this to determine whether nouns are declined in locale's language. This property should remain read-only (no setter function) |
|
PageSize ( ) : int |
Returns the preferred page size for printing. |
|
PositiveMonetarySignPosition ( ) : KLocale.SignPosition |
Returns the position of a positive sign in relation to a monetary value. |
|
PositivePrefixCurrencySymbol ( ) : bool |
If and only if the currency symbol precedes a positive value, this will be true. |
|
PositiveSign ( ) : string |
Returns what a positive sign should look like ("+", " ", etc.) according to the current locale or user settings. |
|
ReadDate ( string str ) : QDate |
|
|
ReadDate ( string str, KLocale flags ) : QDate |
|
|
ReadDate ( string str, KLocale flags, bool &ok ) : QDate |
Converts a localized date string to a QDate. This method is stricter than readDate(str,&ok): it will either accept a date in full format or a date in short format, depending on flags. name="str" the string we want to convert. name="flags" whether the date string is to be in full format or in short format. name="ok" the boolean that is set to false if it's not a valid date. If ok is 0, it will be ignored |
|
ReadDate ( string str, bool &ok ) : QDate |
Converts a localized date string to a QDate. The bool pointed by ok will be invalid if the date entered was not valid. name="str" the string we want to convert. name="ok" the boolean that is set to false if it's not a valid date. If ok is 0, it will be ignored |
|
ReadDate ( string intstr, string fmt ) : QDate |
|
|
ReadDate ( string intstr, string fmt, bool &ok ) : QDate |
Converts a localized date string to a QDate, using the specified format. You will usually not want to use this method. |
|
ReadMoney ( string numStr ) : double |
|
|
ReadMoney ( string numStr, bool &ok ) : double |
Converts a localized monetary string to a double. name="numStr" the string we want to convert. name="ok" the boolean that is set to false if it's not a number. If ok is 0, it will be ignored |
|
ReadNumber ( string numStr ) : double |
|
|
ReadNumber ( string numStr, bool &ok ) : double |
Converts a localized numeric string to a double. name="numStr" the string we want to convert. name="ok" the boolean that is set to false if it's not a number. If ok is 0, it will be ignored |
|
ReadTime ( string str ) : Qyoto.QTime |
|
|
ReadTime ( string str, KLocale flags ) : Qyoto.QTime |
|
|
ReadTime ( string str, KLocale flags, bool &ok ) : Qyoto.QTime |
Converts a localized time string to a QTime. This method is stricter than readTime(str,&ok): it will either accept a time with seconds or a time without seconds. Use this method when the format is known by the application. name="str" the string we want to convert. name="flags" whether the time string is expected to contain seconds or not. name="ok" the boolean that is set to false if it's not a valid time. If ok is 0, it will be ignored |
|
ReadTime ( string str, bool &ok ) : Qyoto.QTime |
Converts a localized time string to a QTime. This method will try to parse it with seconds, then without seconds. The bool pointed to by ok will be set to false if the time entered was not valid. name="str" the string we want to convert. name="ok" the boolean that is set to false if it's not a valid time. If ok is 0, it will be ignored |
|
RemoveCatalog ( string catalog ) : void |
Removes a catalog for translation lookup. name="catalog" The catalog to remove. |
|
SetActiveCatalog ( string catalog ) : void |
Sets the active catalog for translation lookup. name="catalog" The catalog to activate. |
|
SetCalendar ( string calendarType ) : void |
Changes the current calendar system to the calendar specified. Currently "gregorian" and "hijri" are supported. If the calendar system specified is not found, gregorian will be used. name="calendarType" the name of the calendar type |
|
SetCountry ( string country, Kimono.KConfig config ) : bool |
Changes the current country. The current country will be left unchanged if failed. It will force a reload of the country specific configuration. name="country" The ISO 3166 country code. |
|
SetCurrencySymbol ( string symbol ) : void |
Changes the current currency symbol. name="symbol" The new currency symbol |
|
SetDateFormat ( string format ) : void |
Changes the current date format. The format of the date is a string which contains variables that will be replaced: %Y with the whole year (e.g. "1984" for "1984") %y with the lower 2 digits of the year (e.g. "84" for "1984") %n with the month (January="1", December="12") %m with the month with two digits (January="01", December="12") %e with the day of the month (e.g. "1" on the first of march) %d with the day of the month with two digits(e.g. "01" on the first of march) %b with the short form of the month (e.g. "Jan" for January) %B with the long form of the month (e.g. "January") %a with the short form of the weekday (e.g. "Wed" for Wednesday) %A with the long form of the weekday (e.g. "Wednesday" for Wednesday) Everything else in the format string will be taken as is. For example, March 20th 1989 with the format "%y:%m:%d" results in "89:03:20". name="format" The new date format |
|
SetDateFormatShort ( string format ) : void |
Changes the current short date format. The format of the date is a string which contains variables that will be replaced: %Y with the whole year (e.g. "1984" for "1984") %y with the lower 2 digits of the year (e.g. "84" for "1984") %n with the month (January="1", December="12") %m with the month with two digits (January="01", December="12") %e with the day of the month (e.g. "1" on the first of march) %d with the day of the month with two digits(e.g. "01" on the first of march) %b with the short form of the month (e.g. "Jan" for January) %B with the long form of the month (e.g. "January") %a with the short form of the weekday (e.g. "Wed" for Wednesday) %A with the long form of the weekday (e.g. "Wednesday" for Wednesday) Everything else in the format string will be taken as is. For example, March 20th 1989 with the format "%y:%m:%d" results in "89:03:20". name="format" The new short date format |
|
SetDateMonthNamePossessive ( bool possessive ) : void |
Changes the form of month name used in dates. name="possessive" True if possessive forms should be used |
|
SetDecimalSymbol ( string symbol ) : void |
Changes the symbol used to identify the decimal pointer. name="symbol" The new decimal symbol. |
|
SetEncoding ( int mibEnum ) : bool |
Changes the current encoding. name="mibEnum" The mib of the preferred codec |
|
SetFracDigits ( int digits ) : void |
Changes the number of digits used when formating numbers. name="digits" The default number of digits to use. |
|
SetLanguage ( List languages ) : bool |
Changes the list of preferred languages for the locale. The first valid language in the list will be used, or the default language (en_US) if none of the specified languages were available. name="languages" the list of language codes |
|
SetLanguage ( string language, Kimono.KConfig config ) : bool |
Changes the current language. The current language will be left unchanged if failed. It will force a reload of the country specific configuration as well. name="language" the language code |
|
SetMainCatalog ( string catalog ) : void |
Use this as main catalog for all KLocales, if not the appname will be used. This function is best to be the very first instruction in your program's main function as it only has an effect before the first KLocale object is created. name="catalog" Catalog to override all other main Catalogs. |
|
SetMeasureSystem ( KLocale value ) : void |
Changes the preferred measuring system. |
|
SetMonetaryDecimalSymbol ( string symbol ) : void |
Changes the symbol used to identify the decimal pointer for monetary values. name="symbol" The new decimal symbol. |
|
SetMonetaryThousandsSeparator ( string separator ) : void |
Changes the separator used to group digits when formating monetary values. name="separator" The new thousands separator. |
|
SetNegativeMonetarySignPosition ( KLocale signpos ) : void |
Changes the sign position used for negative monetary values. name="signpos" The new sign position |
|
SetNegativePrefixCurrencySymbol ( bool prefix ) : void |
Changes the position where the currency symbol should be printed for negative monetary values. name="prefix" True if the currency symbol should be prefixed instead of postfixed |
|
SetNegativeSign ( string sign ) : void |
Changes the sign used to identify a negative number. name="sign" Sign used for negative numbers. |
|
SetPageSize ( int paperFormat ) : void |
Changes the preferred page size when printing. name="paperFormat" the new preferred page size in the format QPrinter.PageSize |
|
SetPositiveMonetarySignPosition ( KLocale signpos ) : void |
Changes the sign position used for positive monetary values. name="signpos" The new sign position |
|
SetPositivePrefixCurrencySymbol ( bool prefix ) : void |
Changes the position where the currency symbol should be printed for positive monetary values. name="prefix" True if the currency symbol should be prefixed instead of postfixed |
|
SetPositiveSign ( string sign ) : void |
Changes the sign used to identify a positive number. Normally this is left blank. name="sign" Sign used for positive numbers. |
|
SetThousandsSeparator ( string separator ) : void |
Changes the separator used to group digits when formating numbers. name="separator" The new thousands separator. |
|
SetTimeFormat ( string format ) : void |
Changes the current time format. The format of the time is string a which contains variables that will be replaced: %H with the hour in 24h format and 2 digits (e.g. 5pm is "17", 5am is "05") %k with the hour in 24h format and one digits (e.g. 5pm is "17", 5am is "5") %I with the hour in 12h format and 2 digits (e.g. 5pm is "05", 5am is "05") %l with the hour in 12h format and one digits (e.g. 5pm is "5", 5am is "5") %M with the minute with 2 digits (e.g. the minute of 07:02:09 is "02") %S with the seconds with 2 digits (e.g. the minute of 07:02:09 is "09") %p with pm or am (e.g. 17.00 is "pm", 05.00 is "am") Everything else in the format string will be taken as is. For example, 5.23pm with the format "%H:%M" results in "17:23". name="format" The new time format |
|
SetWeekStartDay ( int day ) : void |
Changes how KLocale defines the first day in week. name="day" first day of the week (Monday=1..Sunday=7) as integer |
|
SplitLocale ( string locale, StringBuilder language, StringBuilder country, StringBuilder modifier, StringBuilder charset ) : void |
Parses locale string into distinct parts. The format of locale is [email protected] name="locale" the locale string to split name="language" set to the language part of the locale name="country" set to the country part of the locale name="modifier" set to the modifer part of the locale name="charset" set to the charset part of the locale |
|
ThousandsSeparator ( ) : string |
Returns what the thousands separator should look like ("," or "." etc.) according to the current locale or user settings. |
|
TimeFormat ( ) : string |
Returns the currently selected time format. |
|
TranslateQt ( string context, string sourceText, string comment ) : string |
Translates a message as a QTranslator is supposed to. The parameters are similar to i18n(), but the result value has other semantics (it can be string()) |
|
TranslateRaw ( string msg, StringBuilder lang, StringBuilder trans ) : void |
Raw translation from message catalogs. Never use this directly to get message translations. See i18n and ki18n calls related to KLocalizedString. name="msg" the message. Must not be null. Must be UTF-8 encoded. name="lang" language in which the translation was found. If no translation was found, KLocale.DefaultLanguage() is reported. If null, the language is not reported. name="trans" raw translation, or original if not found. If no translation was found, original message is reported. If null, the translation is not reported. |
|
TranslateRaw ( string ctxt, string msg, StringBuilder lang, StringBuilder trans ) : void |
Raw translation from message catalogs, with given context. Context + message are used as the lookup key in catalogs. Never use this directly to get message translations. See i18n and ki18n calls related to KLocalizedString. name="ctxt" the context. Must not be null. Must be UTF-8 encoded. name="msg" the message. Must not be null. Must be UTF-8 encoded. name="lang" language in which the translation was found. If no translation was found, KLocale.DefaultLanguage() is reported. If null, the language is not reported. name="trans" raw translation, or original if not found. If no translation was found, original message is reported. If null, the translation is not reported. |
|
TranslateRaw ( string ctxt, string singular, string plural, ulong n, StringBuilder lang, StringBuilder trans ) : void |
Raw translation from message catalogs, with given context and singular/plural form. Context + singular form is used as the lookup key in catalogs. Never use this directly to get message translations. See i18n and ki18n calls related to KLocalizedString. name="ctxt" the context. Must not be null. Must be UTF-8 encoded. name="singular" the singular form. Must not be null. Must be UTF-8 encoded. name="plural" the plural form. Must not be null. Must be UTF-8 encoded. name="n" number on which the forms are decided. name="lang" language in which the translation was found. If no translation was found, KLocale.DefaultLanguage() is reported. If null, the language is not reported. name="trans" raw translation, or original if not found. If no translation was found, original message is reported (either plural or singular, as determined by n ). If null, the translation is not reported. |
|
TranslateRaw ( string singular, string plural, ulong n, StringBuilder lang, StringBuilder trans ) : void |
Raw translation from message catalogs, with given singular/plural form. Singular form is used as the lookup key in catalogs. Never use this directly to get message translations. See i18n and ki18n calls related to KLocalizedString. name="singular" the singular form. Must not be null. Must be UTF-8 encoded. name="plural" the plural form. Must not be null. Must be UTF-8 encoded. name="n" number on which the forms are decided. name="lang" language in which the translation was found. If no translation was found, KLocale.DefaultLanguage() is reported. If null, the language is not reported. name="trans" raw translation, or original if not found. If no translation was found, original message is reported (either plural or singular, as determined by n ). If null, the translation is not reported. |
|
Use12Clock ( ) : bool |
Use this to determine if the user wants a 12 hour clock. |
|
UseTranscript ( ) : bool |
Reports whether evaluation of translation scripts is enabled. |
|
WeekStartDay ( ) : int |
Use this to determine which day is the first day of the week. |
|
dateFormat ( ) : string |
Returns the currently selected date format. |
|
measureSystem ( ) : KLocale.MeasureSystem |
Returns which measuring system we use. |
|