28#include <QtCore/QString>
29#include <QtCore/QList>
219 void translateRawFrom(
const char *catname,
const char *singular,
const char *plural,
unsigned long n,
227 void translateRaw(
const char *singular,
const char *plural,
unsigned long n,
QString *lang,
257 void translateRawFrom(
const char *catname,
const char *ctxt,
const char *singular,
const char *plural,
265 void translateRaw(
const char *ctxt,
const char *singular,
const char *plural,
unsigned long n,
363 QString digitSetToName(DigitSet digitSet,
bool withDigits =
false)
const;
391 QString thousandsSeparator()
const;
402 DigitSet digitSet()
const;
428 QString currencySymbol()
const;
437 QString monetaryDecimalSymbol()
const;
446 QString monetaryThousandsSeparator()
const;
471 KDE_DEPRECATED
int fracDigits()
const;
480 int decimalPlaces()
const;
489 int monetaryDecimalPlaces()
const;
497 bool positivePrefixCurrencySymbol()
const;
505 bool negativePrefixCurrencySymbol()
const;
514 SignPosition positiveMonetarySignPosition()
const;
523 SignPosition negativeMonetarySignPosition()
const;
534 DigitSet monetaryDigitSet()
const;
570 QString formatNumber(
double num,
int precision = -1)
const;
586 QString formatNumber(
const QString &numStr,
bool round =
true,
int precision = -1)
const;
598 QString formatLong(
long num)
const;
677 QString formatByteSize(
double size)
const;
704 QString formatByteSize(
double size,
int precision,
720 BinaryUnitDialect binaryUnitDialect()
const;
730 void setBinaryUnitDialect(BinaryUnitDialect newDialect);
741 QString formatDuration(
unsigned long mSec)
const;
758 QString prettyFormatDuration(
unsigned long mSec)
const;
769 KDE_DEPRECATED
bool nounDeclension()
const;
946 QString formatDate(
const QDate &date, DateFormat format = LongDate)
const;
960 QString formatDateTime(
const QDateTime &dateTime, DateFormat format = ShortDate,
961 bool includeSecs =
false)
const;
971 Q_DECLARE_FLAGS(DateTimeFormatOptions, DateTimeFormatOption)
984 QString formatDateTime(
const KDateTime &dateTime, DateFormat format = ShortDate,
985 DateTimeFormatOptions options = 0)
const;
993 bool dateMonthNamePossessive()
const;
1009 QString formatTime(
const QTime &pTime,
bool includeSecs =
false,
bool isDuration =
false)
const;
1036 Q_DECLARE_FLAGS(TimeFormatOptions, TimeFormatOption)
1049 QString formatLocaleTime(
const QTime &pTime,
1061 DigitSet dateTimeDigitSet()
const;
1068 bool use12Clock()
const;
1079 QString dayPeriodText(
const QTime &time, DateTimeComponentFormat format = DefaultComponentFormat)
const;
1086 int weekStartDay()
const;
1094 int workingWeekStartDay()
const;
1102 int workingWeekEndDay()
const;
1110 int weekDayOfPray()
const;
1129 KDE_DEPRECATED
QString calendarType()
const;
1152 KDE_DEPRECATED
void setCalendar(
const QString & calendarType);
1208 double readMoney(
const QString &numStr,
bool * ok = 0)
const;
1235 QDate readDate(
const QString &str,
bool* ok = 0)
const;
1243 QDate readDate(
const QString &intstr,
const QString &fmt,
bool* ok = 0)
const;
1276 QDate readDate(
const QString &str, ReadDateFlags flags,
bool *ok = 0)
const;
1290 QTime readTime(
const QString &str,
bool* ok = 0)
const;
1317 QTime readTime(
const QString &str, ReadTimeFlags flags,
bool *ok = 0)
const;
1333 Q_DECLARE_FLAGS(TimeProcessingOptions, TimeProcessingOption)
1353 QTime readLocaleTime(
const QString &str,
bool *ok = 0,
1355 TimeProcessingOptions processing = ProcessNonStrict)
const;
1409 QString countryDivisionCode()
const;
1447 const QByteArray encoding()
const;
1457 int encodingMib()
const;
1467 QTextCodec * codecForEncoding()
const;
1477 int fileEncodingMib()
const;
1501 void setDateFormat(
const QString & format);
1525 void setDateFormatShort(
const QString & format);
1532 void setDateMonthNamePossessive(
bool possessive);
1553 void setTimeFormat(
const QString & format);
1563 void setDateTimeDigitSet(DigitSet digitSet);
1570 void setWeekStartDay(
int day);
1578 void setWorkingWeekStartDay(
int day);
1586 void setWorkingWeekEndDay(
int day);
1594 void setWeekDayOfPray(
int day);
1610 QString dateFormatShort()
const;
1625 void setDecimalSymbol(
const QString & symbol);
1632 void setThousandsSeparator(
const QString & separator);
1640 void setPositiveSign(
const QString & sign);
1647 void setNegativeSign(
const QString & sign);
1657 void setDigitSet(DigitSet digitSet);
1664 void setPositiveMonetarySignPosition(SignPosition signpos);
1671 void setNegativeMonetarySignPosition(SignPosition signpos);
1680 void setPositivePrefixCurrencySymbol(
bool prefix);
1689 void setNegativePrefixCurrencySymbol(
bool prefix);
1698 KDE_DEPRECATED
void setFracDigits(
int digits);
1707 void setDecimalPlaces(
int digits);
1716 void setMonetaryDecimalPlaces(
int digits);
1723 void setMonetaryThousandsSeparator(
const QString & separator);
1731 void setMonetaryDecimalSymbol(
const QString & symbol);
1740 void setCurrencyCode(
const QString &newCurrencyCode);
1750 void setCurrencySymbol(
const QString & symbol);
1760 void setMonetaryDigitSet(DigitSet digitSet);
1767 int pageSize()
const;
1774 void setPageSize(
int paperFormat);
1790 MeasureSystem measureSystem()
const;
1797 void setMeasureSystem(MeasureSystem value);
1809 void insertCatalog(
const QString& catalog);
1816 void removeCatalog(
const QString &catalog);
1822 void setActiveCatalog(
const QString &catalog);
1829 QString translateQt(
const char *context,
const char *sourceText,
const char *comment)
const;
1925 static void setMainCatalog(
const char *catalog);
1943 static QString langLookup(
const QString &fname,
const char *rtype =
"html");
1950 static QString defaultLanguage();
1962 static QString defaultCountry();
1971 static QString defaultCurrencyCode();
1978 bool useTranscript()
const;
1985 bool isApplicationTranslatedInto(
const QString & language);
1992 void copyCatalogsTo(
KLocale *locale);
2029 bool setCountryDivisionCode(
const QString & countryDivision);
2121 bool ignoreContext =
false)
const;
2129 void reparseConfiguration();
2138Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::DateTimeFormatOptions)
2139Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::DateTimeComponents)
2140Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::TimeFormatOptions)
2141Q_DECLARE_OPERATORS_FOR_FLAGS(KLocale::TimeProcessingOptions)
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE.
The central class of the KDE configuration data system.
A class representing a date and time with an associated time zone.
KLocale provides support for country specific stuff like the national language.
@ IsoWeekNumber
ISO Week Number.
@ SimpleWeek
Week 1 starts Jan 1st ends after 7 days.
@ DefaultWeekNumber
The system locale default.
@ FirstPartialWeek
Week 1 starts Jan 1st ends day before first Week Start Day in year.
@ FirstFullWeek
Week 1 starts on the first Week Start Day in year ends after 7 days.
@ KannadaDigits
೦೧೨೩೪೫೬೭೮೯ (Kannada)
@ ArabicIndicDigits
٠١٢٣٤٥٦٧٨٩ (eastern Arabic dialects)
@ EasternArabicIndicDigits
۰۱۲۳۴۵۶۷۸۹ (Persian and Urdu)
@ OriyaDigits
୦୧୨୩୪୫୬୭୮୯ (Oriya)
@ ThaiDigits
๐๑๒๓๔๕๖๗๘๙ (Thai)
@ ArabicDigits
0123456789 (European and some Asian languages and western Arabic dialects)
@ TeluguDigits
౦౧౨౩౪౫౬౭౯ (Telugu)
@ TamilDigits
௦௧௨௩௪௫௬௭௮ (Tamil)
@ GurmukhiDigits
੦੧੨੩੪੫੬੭੮੯ (Punjabi)
@ BengaliDigits
০১২৩৪৫৬৭৮৯ (Bengali and Assamese)
@ GujaratiDigits
૦૧૨૩૪૫૬૭૮૯ (Gujarati)
@ MalayalamDigits
൦൧൨൩൪൫൬൭൮൯ (Malayalam)
@ KhmerDigits
០១២៣៤៥៦៧៨៩ (Khmer)
@ DevenagariDigits
०१२३४५६७८९ (Hindi)
void translateRawFrom(const char *catname, const char *msg, QString *lang, QString *trans) const
BinarySizeUnits
These binary units are used in KDE by the formatByteSize() functions.
@ UnitPetaByte
PiB/PB/PB 2^50/10^15 bytes.
@ UnitTeraByte
TiB/TB/TB 2^40/10^12 bytes.
@ UnitMegaByte
MiB/MB/MB 2^20/10^06 bytes.
@ UnitKiloByte
KiB/KB/kB 1024/1000 bytes.
@ UnitYottaByte
YiB/YB/YB 2^80/10^24 bytes.
@ UnitZettaByte
ZiB/ZB/ZB 2^70/10^21 bytes.
@ UnitGigaByte
GiB/GB/GB 2^30/10^09 bytes.
@ UnitExaByte
EiB/EB/EB 2^60/10^18 bytes.
@ DefaultBinaryUnits
Auto-choose a unit such that the result is in the range [0, 1000 or 1024)
bool setEncoding(int mibEnum)
Changes the current encoding.
SignPosition
Various positions for where to place the positive or negative sign when they are related to a monetar...
@ AfterMoney
Suffix the currency symbol with the sign, e.g.
@ ParensAround
Put parantheses around the quantity, e.g.
@ BeforeMoney
Prefix the currency symbol with the sign, e.g.
@ BeforeQuantityMoney
Prefix the quantity with the sign, e.g.
@ AfterQuantityMoney
Suffix the quanitity with the sign, e.g.
@ TimeWithoutSeconds
Exclude the seconds part of the time from display.
@ TimeDuration
Read/format time string as duration.
@ TimeFoldHours
Read/format time string as duration.
@ TimeWithoutAmPm
Read/format time string without am/pm suffix but keep the 12/24h format as specified by locale time f...
@ TimeDefault
Default formatting using seconds and the format as specified by the locale.
BinaryUnitDialect
This enum chooses what dialect is used for binary units.
@ MetricBinaryDialect
SI Units, kB, MB, etc. 10^(3*n)
@ IECBinaryDialect
KDE Default, KiB, MiB, etc. 2^(10*n)
@ DefaultBinaryDialect
Used if no specific preference.
@ JEDECBinaryDialect
KDE 3.5 default, KB, MB, etc. 2^(10*n)
@ UnicodeFormat
UNICODE Standard (Qt/Java/OSX/Windows)
@ PosixFormat
POSIX Standard.
friend class KLocalePrivate
ReadDateFlags
Flags for readDate()
@ IsoFormat
Only accept a date string in ISO date format (YYYY-MM-DD)
@ NormalFormat
Only accept a date string in the locale LongDate format.
@ ShortFormat
Only accept a date string in the locale ShortDate format.
@ IsoOrdinalFormat
Only accept a date string in ISO Week date format (YYYY-DDD)
@ IsoWeekFormat
Only accept a date string in ISO Week date format (YYYY-Www-D)
@ DayPeriod
The Day Period portion of a date, e.g.
@ Day
The Day portion of a date, may be number or name.
@ DaysInWeek
The Days In Week portion of a date.
@ WeeksInYear
The Weeks In Year portion of a date.
@ EraYear
The Era and Year portion of a date.
@ DayPeriodHour
The Day Period Hour portion of a date.
@ Week
The Week Number portion of a date.
@ Millisecond
The Milliseconds portion of a date.
@ Second
The Seconds portion of a date.
@ DayOfWeekName
The Day Of Week Name / Weekday Name portion of a date.
@ UnixTime
The UNIX Time portion of a date.
@ Minute
The Minutes portion of a date.
@ DayOfYearName
The Day Of Year Name portion of a date.
@ MonthsInYear
The Months In Year portion of a date.
@ Year
The Year portion of a date, may be number or name.
@ TimezoneName
The Time Zone Name portion of a date.
@ DaysInYear
The Days In Year portion of a date.
@ EraName
The Era Name portion of a date.
@ Month
The Month portion of a date, may be number or name.
@ DayName
The Day Name portion of a date.
@ Timezone
The Time Zone portion of a date, may be offset or name.
@ DayOfWeek
The Day Of Week / Weekday portion of a date, may be number or name.
@ MonthName
The Month Name portion of a date.
@ JulianDay
The Julian Day of a date.
@ DaysInMonth
The Days In Month portion of a date.
@ YearInEra
The Year In Era portion of a date.
@ DayOfYear
The Day Of Year portion of a date, may be number or name.
@ WeekYear
The Week Year portion of a date.
@ YearName
The Year Name portion of a date.
@ Hour
The Hours portion of a date.
TimeProcessingOption
Additional processing options for readLocaleTime().
@ ProcessNonStrict
Process time in a lax manner, ie.
@ ProcessStrict
Process time in a strict manner, ie.
MeasureSystem
The Metric system will give you information in mm, while the Imperial system will give you informatio...
@ Metric
Metric system (used e.g. in Europe)
@ Imperial
Imperial system (used e.g. in the United States)
DateFormat
Format for date string.
@ FancyShortDate
Same as ShortDate for dates a week or more ago.
@ IsoOrdinalDate
ISO-8601 Ordinal Date format YYYY-DDD, e.g.
@ IsoWeekDate
ISO-8601 Week Date format YYYY-Www-D, e.g.
@ IsoDate
ISO-8601 Date format YYYY-MM-DD, e.g.
@ ShortDate
Locale Short date format, e.g.
@ FancyLongDate
Same as LongDate for dates a week or more ago.
@ LongDate
Locale Long date format, e.g.
KLocale(const QString &catalog, KSharedConfig::Ptr config=KSharedConfig::Ptr())
Constructs a KLocale with the given catalog name.
DateTimeFormatOption
Options for formatting date-time values.
@ Seconds
Include the seconds value.
@ TimeZone
Include a time zone string.
void translateRaw(const char *msg, QString *lang, QString *trans) const
Like translateRawFrom, with implicit lookup through all loaded catalogs.
QString country() const
Returns the country code of the country where the user lives.
@ IslamicCivilCalendar
Islamic Civil Calendar, aka Hijri, not the Lunar Calendar.
@ IndianNationalCalendar
Indian National Calendar, not the Lunar Calendar.
@ JapaneseCalendar
Japanese Calendar, Gregorian calculation using Japanese Era (Nengô)
@ QDateCalendar
KDE Default, hybrid of Gregorian and Julian as used by QDate.
@ HebrewCalendar
Hebrew Calendar, aka Jewish Calendar.
@ EthiopianCalendar
Ethiopian Calendar, aka Ethiopic Calendar.
@ CopticCalendar
Coptic Calendar as used Coptic Church and some parts of Egypt.
@ GregorianCalendar
Gregorian Calendar, pure proleptic implementation.
@ ThaiCalendar
Thai Calendar, aka Buddhist or Thai Buddhist.
@ JalaliCalendar
Jalali Calendar, aka Persian or Iranian, also used in Afghanistan.
@ MinguoCalendar
Minguo Calendar, aka ROC, Republic of China or Taiwanese.
@ JulianCalendar
Julian Calendar, as used in Orthodox Churches.
ReadTimeFlags
Flags for the old version of readTime()
@ WithoutSeconds
Only accept a time string without seconds.
@ WithSeconds
Only accept a time string with seconds. Default (no flag set)
@ LiberalParsing
Parse Date/Time liberally.
friend class KDateTimeFormatter
@ DefaultComponentFormat
The system locale default for the componant.
@ LongName
Long text format, e.g.
@ LongNumber
Number padded to a required width, e.g.
@ ShortName
Short text format, e.g.
@ NarrowName
Narrow text format, may not be unique, e.g.
@ ShortNumber
Number at its natural width, e.g.
QString language() const
Returns the language code used by this object.
KSharedPtr< KSharedConfig > Ptr
QString removeAcceleratorMarker(const QString &label_)
static char readNumber(qint64 &value, QIODevice *file)