• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Types | Public Member Functions | Static Public Member Functions
KLocale Class Reference

#include <klocale.h>

List of all members.

Public Types

enum  BinarySizeUnits {
  DefaultBinaryUnits = -1, UnitByte, UnitKiloByte, UnitMegaByte,
  UnitGigaByte, UnitTeraByte, UnitPetaByte, UnitExaByte,
  UnitZettaByte, UnitYottaByte, UnitLastUnit = UnitYottaByte
}
enum  BinaryUnitDialect {
  DefaultBinaryDialect = -1, IECBinaryDialect, JEDECBinaryDialect, MetricBinaryDialect,
  LastBinaryDialect = MetricBinaryDialect
}
enum  CalendarSystem {
  QDateCalendar = 1, CopticCalendar = 5, EthiopianCalendar = 6, GregorianCalendar = 8,
  HebrewCalendar = 9, IslamicCivilCalendar = 12, IndianNationalCalendar = 14, JalaliCalendar = 16,
  JapaneseCalendar = 19, JulianCalendar = 21, MinguoCalendar = 22, ThaiCalendar = 23
}
enum  DateFormat {
  ShortDate, LongDate, FancyShortDate, FancyLongDate,
  IsoDate, IsoWeekDate, IsoOrdinalDate
}
enum  DateTimeComponent {
  Year = 0x1, YearName = 0x2, Month = 0x4, MonthName = 0x8,
  Day = 0x10, DayName = 0x20, JulianDay = 0x40, EraName = 0x80,
  EraYear = 0x100, YearInEra = 0x200, DayOfYear = 0x400, DayOfYearName = 0x800,
  DayOfWeek = 0x1000, DayOfWeekName = 0x2000, Week = 0x4000, WeekYear = 0x8000,
  MonthsInYear = 0x10000, WeeksInYear = 0x20000, DaysInYear = 0x40000, DaysInMonth = 0x80000,
  DaysInWeek = 0x100000, Hour = 0x200000, Minute = 0x400000, Second = 0x800000,
  Millisecond = 0x1000000, DayPeriod = 0x2000000, DayPeriodHour = 0x4000000, Timezone = 0x8000000,
  TimezoneName = 0x10000000, UnixTime = 0x20000000
}
enum  DateTimeComponentFormat {
  DefaultComponentFormat = -1, ShortNumber = 0, LongNumber, NarrowName = 3,
  ShortName, LongName
}
enum  DateTimeFormatOption { TimeZone = 0x01, Seconds = 0x02 }
enum  DateTimeFormatStandard { KdeFormat, PosixFormat, UnicodeFormat }
enum  DateTimeParseMode { LiberalParsing }
enum  DigitSet {
  ArabicDigits, ArabicIndicDigits, EasternArabicIndicDigits, DevenagariDigits,
  BengaliDigits, GujaratiDigits, GurmukhiDigits, KannadaDigits,
  KhmerDigits, MalayalamDigits, OriyaDigits, TamilDigits,
  TeluguDigits, ThaiDigits
}
enum  MeasureSystem { Metric, Imperial }
enum  ReadDateFlags {
  NormalFormat = 1, ShortFormat = 2, IsoFormat = 4, IsoWeekFormat = 8,
  IsoOrdinalFormat = 16
}
enum  ReadTimeFlags { WithSeconds = 0, WithoutSeconds = 1 }
enum  SignPosition {
  ParensAround = 0, BeforeQuantityMoney = 1, AfterQuantityMoney = 2, BeforeMoney = 3,
  AfterMoney = 4
}
enum  TimeFormatOption {
  TimeDefault = 0x0, TimeWithoutSeconds = 0x1, TimeWithoutAmPm = 0x2, TimeDuration = 0x6,
  TimeFoldHours = 0xE
}
enum  TimeProcessingOption { ProcessStrict = 0x1, ProcessNonStrict = 0x2 }
enum  WeekNumberSystem {
  DefaultWeekNumber = -1, IsoWeekNumber = 0, FirstFullWeek = 1, FirstPartialWeek = 2,
  SimpleWeek = 3
}

Public Member Functions

 KLocale (const QString &catalog, KSharedConfig::Ptr config=KSharedConfig::Ptr())
 KLocale (const QString &catalog, const QString &language, const QString &country=QString(), KConfig *config=0)
 KLocale (const KLocale &rhs)
virtual ~KLocale ()
QStringList allCountriesList () const
QList< DigitSet > allDigitSetsList () const
QStringList allLanguagesList () const
BinaryUnitDialect binaryUnitDialect () const
const KCalendarSystem * calendar () const
KLocale::CalendarSystem calendarSystem () const
QString calendarType () const
QTextCodec * codecForEncoding () const
QString convertDigits (const QString &str, DigitSet digitSet, bool ignoreContext=false) const
void copyCatalogsTo (KLocale *locale)
QString country () const
QString countryCodeToName (const QString &country) const
QString countryDivisionCode () const
KCurrencyCode * currency () const
QString currencyCode () const
QStringList currencyCodeList () const
QString currencySymbol () const
QString dateFormat () const
QString dateFormatShort () const
bool dateMonthNamePossessive () const
DigitSet dateTimeDigitSet () const
QString dayPeriodText (const QTime &time, DateTimeComponentFormat format=DefaultComponentFormat) const
int decimalPlaces () const
QString decimalSymbol () const
DigitSet digitSet () const
QString digitSetToName (DigitSet digitSet, bool withDigits=false) const
const QByteArray encoding () const
int encodingMib () const
int fileEncodingMib () const
QString formatByteSize (double size) const
QString formatByteSize (double size, int precision, BinaryUnitDialect dialect=KLocale::DefaultBinaryDialect, BinarySizeUnits specificUnit=KLocale::DefaultBinaryUnits) const
QString formatDate (const QDate &date, DateFormat format=LongDate) const
QString formatDateTime (const QDateTime &dateTime, DateFormat format=ShortDate, bool includeSecs=false) const
QString formatDateTime (const KDateTime &dateTime, DateFormat format=ShortDate, DateTimeFormatOptions options=0) const
QString formatDuration (unsigned long mSec) const
QString formatLocaleTime (const QTime &pTime, TimeFormatOptions options=KLocale::TimeDefault) const
QString formatLong (long num) const
QString formatMoney (double num, const QString &currency=QString(), int precision=-1) const
QString formatNumber (double num, int precision=-1) const
QString formatNumber (const QString &numStr, bool round=true, int precision=-1) const
QString formatTime (const QTime &pTime, bool includeSecs=false, bool isDuration=false) const
int fracDigits () const
void insertCatalog (const QString &catalog)
QStringList installedLanguages () const
bool isApplicationTranslatedInto (const QString &language)
QString language () const
QString languageCodeToName (const QString &language) const
QStringList languageList () const
QString localizedFilePath (const QString &filePath) const
MeasureSystem measureSystem () const
int monetaryDecimalPlaces () const
QString monetaryDecimalSymbol () const
DigitSet monetaryDigitSet () const
QString monetaryThousandsSeparator () const
SignPosition negativeMonetarySignPosition () const
bool negativePrefixCurrencySymbol () const
QString negativeSign () const
bool nounDeclension () const
KLocale & operator= (const KLocale &rhs)
int pageSize () const
SignPosition positiveMonetarySignPosition () const
bool positivePrefixCurrencySymbol () const
QString positiveSign () const
QString prettyFormatDuration (unsigned long mSec) const
QDate readDate (const QString &str, bool *ok=0) const
QDate readDate (const QString &intstr, const QString &fmt, bool *ok=0) const
QDate readDate (const QString &str, ReadDateFlags flags, bool *ok=0) const
QTime readLocaleTime (const QString &str, bool *ok=0, TimeFormatOptions options=KLocale::TimeDefault, TimeProcessingOptions processing=ProcessNonStrict) const
double readMoney (const QString &numStr, bool *ok=0) const
double readNumber (const QString &numStr, bool *ok=0) const
QTime readTime (const QString &str, bool *ok=0) const
QTime readTime (const QString &str, ReadTimeFlags flags, bool *ok=0) const
QString removeAcceleratorMarker (const QString &label) const
void removeCatalog (const QString &catalog)
void reparseConfiguration ()
void setActiveCatalog (const QString &catalog)
void setBinaryUnitDialect (BinaryUnitDialect newDialect)
void setCalendar (const QString &calendarType)
void setCalendarSystem (KLocale::CalendarSystem calendarSystem)
bool setCountry (const QString &country, KConfig *config)
bool setCountryDivisionCode (const QString &countryDivision)
void setCurrencyCode (const QString &newCurrencyCode)
void setCurrencySymbol (const QString &symbol)
void setDateFormat (const QString &format)
void setDateFormatShort (const QString &format)
void setDateMonthNamePossessive (bool possessive)
void setDateTimeDigitSet (DigitSet digitSet)
void setDecimalPlaces (int digits)
void setDecimalSymbol (const QString &symbol)
void setDigitSet (DigitSet digitSet)
bool setEncoding (int mibEnum)
void setFracDigits (int digits)
bool setLanguage (const QString &language, KConfig *config)
bool setLanguage (const QStringList &languages)
void setMeasureSystem (MeasureSystem value)
void setMonetaryDecimalPlaces (int digits)
void setMonetaryDecimalSymbol (const QString &symbol)
void setMonetaryDigitSet (DigitSet digitSet)
void setMonetaryThousandsSeparator (const QString &separator)
void setNegativeMonetarySignPosition (SignPosition signpos)
void setNegativePrefixCurrencySymbol (bool prefix)
void setNegativeSign (const QString &sign)
void setPageSize (int paperFormat)
void setPositiveMonetarySignPosition (SignPosition signpos)
void setPositivePrefixCurrencySymbol (bool prefix)
void setPositiveSign (const QString &sign)
void setThousandsSeparator (const QString &separator)
void setTimeFormat (const QString &format)
void setWeekDayOfPray (int day)
void setWeekNumberSystem (KLocale::WeekNumberSystem weekNumberSystem)
void setWeekStartDay (int day)
void setWorkingWeekEndDay (int day)
void setWorkingWeekStartDay (int day)
QString thousandsSeparator () const
QString timeFormat () const
QString translateQt (const char *context, const char *sourceText, const char *comment) const
void translateRaw (const char *msg, QString *lang, QString *trans) const
void translateRaw (const char *ctxt, const char *msg, QString *lang, QString *trans) const
void translateRaw (const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const
void translateRaw (const char *ctxt, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const
void translateRawFrom (const char *catname, const char *msg, QString *lang, QString *trans) const
void translateRawFrom (const char *catname, const char *ctxt, const char *msg, QString *lang, QString *trans) const
void translateRawFrom (const char *catname, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const
void translateRawFrom (const char *catname, const char *ctxt, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const
bool use12Clock () const
bool useTranscript () const
int weekDayOfPray () const
KLocale::WeekNumberSystem weekNumberSystem ()
KLocale::WeekNumberSystem weekNumberSystem () const
int weekStartDay () const
int workingWeekEndDay () const
int workingWeekStartDay () const

Static Public Member Functions

static QString defaultCountry ()
static QString defaultCurrencyCode ()
static QString defaultLanguage ()
static QString langLookup (const QString &fname, const char *rtype="html")
static void setMainCatalog (const char *catalog)
static void splitLocale (const QString &locale, QString &language, QString &country, QString &modifier, QString &charset)

Detailed Description

KLocale provides support for country specific stuff like the national language.

KLocale supports translating, as well as specifying the format for numbers, currency, time, and date.

Use KGlobal::locale() to get pointer to the global KLocale object, containing the applications current locale settings.

For example, to format the date May 17, 1995 in the current locale, use:

QString date = KGlobal::locale()->formatDate(QDate(1995,5,17));
Author:
Stephan Kulow coolo.nosp@m.@kde.nosp@m..org, Preston Brown pbrow.nosp@m.n@kd.nosp@m.e.org, Hans Petter Bieker bieke.nosp@m.r@kd.nosp@m.e.org, Lukas Tinkl lukas.nosp@m..tin.nosp@m.kl@su.nosp@m.se.c.nosp@m.z class for supporting locale settings and national language

Definition at line 69 of file klocale.h.


Member Enumeration Documentation

enum KLocale::BinarySizeUnits

These binary units are used in KDE by the formatByteSize() functions.

NOTE: There are several different units standards: 1) SI (i.e. metric), powers-of-10. 2) IEC, powers-of-2, with specific units KiB, MiB, etc. 3) JEDEC, powers-of-2, used for solid state memory sizing which is why you see flash cards labels as e.g. 4GB. These (ab)use the metric units. Although JEDEC only defines KB, MB, GB, if JEDEC is selected all units will be powers-of-2 with metric prefixes for clarity in the event of sizes larger than 1024 GB.

Although 3 different dialects are possible this enum only uses metric names since adding all 3 different names of essentially the same unit would be pointless. Use BinaryUnitDialect to control the exact units returned.

Since:
4.4
See also:
binaryUnitDialect
Enumerator:
DefaultBinaryUnits 

Auto-choose a unit such that the result is in the range [0, 1000 or 1024)

UnitByte 

B 1 byte.

UnitKiloByte 

KiB/KB/kB 1024/1000 bytes.

UnitMegaByte 

MiB/MB/MB 2^20/10^06 bytes.

UnitGigaByte 

GiB/GB/GB 2^30/10^09 bytes.

UnitTeraByte 

TiB/TB/TB 2^40/10^12 bytes.

UnitPetaByte 

PiB/PB/PB 2^50/10^15 bytes.

UnitExaByte 

EiB/EB/EB 2^60/10^18 bytes.

UnitZettaByte 

ZiB/ZB/ZB 2^70/10^21 bytes.

UnitYottaByte 

YiB/YB/YB 2^80/10^24 bytes.

UnitLastUnit 

Definition at line 621 of file klocale.h.

enum KLocale::BinaryUnitDialect

This enum chooses what dialect is used for binary units.

Note: Although JEDEC abuses the metric prefixes and can therefore be confusing, it has been used to describe memory sizes for quite some time and programs should therefore use either Default, JEDEC, or IEC 60027-2 for memory sizes.

On the other hand network transmission rates are typically in metric so Default, Metric, or IEC (which is unambiguous) should be chosen.

Normally choosing DefaultBinaryDialect is the best option as that uses the user's selection for units.

Since:
4.4
See also:
binaryUnitDialect
setBinaryUnitDialect
Enumerator:
DefaultBinaryDialect 

Used if no specific preference.

IECBinaryDialect 

KDE Default, KiB, MiB, etc. 2^(10*n)

JEDECBinaryDialect 

KDE 3.5 default, KB, MB, etc. 2^(10*n)

MetricBinaryDialect 

SI Units, kB, MB, etc. 10^(3*n)

LastBinaryDialect 

Definition at line 656 of file klocale.h.

enum KLocale::CalendarSystem
Since:
4.6

Available Calendar Systems

See also:
setCalendarSystem()
calendarSystem()
Enumerator:
QDateCalendar 

KDE Default, hybrid of Gregorian and Julian as used by QDate.

CopticCalendar 

Coptic Calendar as used Coptic Church and some parts of Egypt.

EthiopianCalendar 

Ethiopian Calendar, aka Ethiopic Calendar.

GregorianCalendar 

Gregorian Calendar, pure proleptic implementation.

HebrewCalendar 

Hebrew Calendar, aka Jewish Calendar.

IslamicCivilCalendar 

Islamic Civil Calendar, aka Hijri, not the Lunar Calendar.

IndianNationalCalendar 

Indian National Calendar, not the Lunar Calendar.

JalaliCalendar 

Jalali Calendar, aka Persian or Iranian, also used in Afghanistan.

JapaneseCalendar 

Japanese Calendar, Gregorian calculation using Japanese Era (Nengô)

JulianCalendar 

Julian Calendar, as used in Orthodox Churches.

MinguoCalendar 

Minguo Calendar, aka ROC, Republic of China or Taiwanese.

ThaiCalendar 

Thai Calendar, aka Buddhist or Thai Buddhist.

Definition at line 780 of file klocale.h.

enum KLocale::DateFormat

Format for date string.

Enumerator:
ShortDate 

Locale Short date format, e.g.

08-04-2007

LongDate 

Locale Long date format, e.g.

Sunday 08 April 2007

FancyShortDate 

Same as ShortDate for dates a week or more ago.

For more recent dates, it is represented as Today, Yesterday, or the weekday name.

FancyLongDate 

Same as LongDate for dates a week or more ago.

For more recent dates, it is represented as Today, Yesterday, or the weekday name.

IsoDate 

ISO-8601 Date format YYYY-MM-DD, e.g.

2009-12-31

IsoWeekDate 

ISO-8601 Week Date format YYYY-Www-D, e.g.

2009-W01-1

IsoOrdinalDate 

ISO-8601 Ordinal Date format YYYY-DDD, e.g.

2009-001

Definition at line 922 of file klocale.h.

enum KLocale::DateTimeComponent
Since:
4.6

The various Components that make up a Date / Time In the future the Components may be combined as flags for dynamic generation of Date Formats.

See also:
KCalendarSystem
KLocalizedDate
DateTimeComponentFormat
Enumerator:
Year 

The Year portion of a date, may be number or name.

YearName 

The Year Name portion of a date.

Month 

The Month portion of a date, may be number or name.

MonthName 

The Month Name portion of a date.

Day 

The Day portion of a date, may be number or name.

DayName 

The Day Name portion of a date.

JulianDay 

The Julian Day of a date.

EraName 

The Era Name portion of a date.

EraYear 

The Era and Year 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.

DayOfYearName 

The Day Of Year Name portion of a date.

DayOfWeek 

The Day Of Week / Weekday portion of a date, may be number or name.

DayOfWeekName 

The Day Of Week Name / Weekday Name portion of a date.

Week 

The Week Number portion of a date.

WeekYear 

The Week Year portion of a date.

MonthsInYear 

The Months In Year portion of a date.

WeeksInYear 

The Weeks In Year portion of a date.

DaysInYear 

The Days In Year portion of a date.

DaysInMonth 

The Days In Month portion of a date.

DaysInWeek 

The Days In Week portion of a date.

Hour 

The Hours portion of a date.

Minute 

The Minutes portion of a date.

Second 

The Seconds portion of a date.

Millisecond 

The Milliseconds portion of a date.

DayPeriod 

The Day Period portion of a date, e.g.

AM/PM

DayPeriodHour 

The Day Period Hour portion of a date.

Timezone 

The Time Zone portion of a date, may be offset or name.

TimezoneName 

The Time Zone Name portion of a date.

UnixTime 

The UNIX Time portion of a date.

Definition at line 865 of file klocale.h.

enum KLocale::DateTimeComponentFormat
Since:
4.6

Format used for individual Date/Time Components when converted to/from a string Largely equivalent to the UNICODE CLDR format width definitions 1..5

See also:
DateTimeComponentFormat
Enumerator:
DefaultComponentFormat 

The system locale default for the componant.

ShortNumber 

Number at its natural width, e.g.

2 for the 2nd

LongNumber 

Number padded to a required width, e.g.

02 for the 2nd

NarrowName 

Narrow text format, may not be unique, e.g.

M for Monday

ShortName 

Short text format, e.g.

Mon for Monday

LongName 

Long text format, e.g.

Monday for Monday

Definition at line 908 of file klocale.h.

enum KLocale::DateTimeFormatOption

Options for formatting date-time values.

Enumerator:
TimeZone 

Include a time zone string.

Seconds 

Include the seconds value.

Definition at line 967 of file klocale.h.

enum KLocale::DateTimeFormatStandard
Since:
4.4

Standard used for Date Time Format String

Enumerator:
KdeFormat 

KDE Standard.

PosixFormat 

POSIX Standard.

UnicodeFormat 

UNICODE Standard (Qt/Java/OSX/Windows)

Definition at line 829 of file klocale.h.

enum KLocale::DateTimeParseMode
Since:
4.6

Mode to use when parsing a Date Time input string

Enumerator:
LiberalParsing 

Parse Date/Time liberally.

So long as the input string contains at least a reconizable month and day the input will be accepted.

Definition at line 841 of file klocale.h.

enum KLocale::DigitSet
Since:
4.3

The set of digit characters used to display and enter numbers.

Enumerator:
ArabicDigits 

0123456789 (European and some Asian languages and western Arabic dialects)

ArabicIndicDigits 

٠١٢٣٤٥٦٧٨٩ (eastern Arabic dialects)

EasternArabicIndicDigits 

۰۱۲۳۴۵۶۷۸۹ (Persian and Urdu)

DevenagariDigits 

०१२३४५६७८९ (Hindi)

BengaliDigits 

০১২৩৪৫৬৭৮৯ (Bengali and Assamese)

GujaratiDigits 

૦૧૨૩૪૫૬૭૮૯ (Gujarati)

GurmukhiDigits 

੦੧੨੩੪੫੬੭੮੯ (Punjabi)

KannadaDigits 

೦೧೨೩೪೫೬೭೮೯ (Kannada)

KhmerDigits 

០១២៣៤៥៦៧៨៩ (Khmer)

MalayalamDigits 

൦൧൨൩൪൫൬൭൮൯ (Malayalam)

OriyaDigits 

୦୧୨୩୪୫୬୭୮୯ (Oriya)

TamilDigits 

௦௧௨௩௪௫௬௭௮ (Tamil)

TeluguDigits 

౦౧౨౩౪౫౬౭౯ (Telugu)

ThaiDigits 

๐๑๒๓๔๕๖๗๘๙ (Thai)

Definition at line 309 of file klocale.h.

enum KLocale::MeasureSystem

The Metric system will give you information in mm, while the Imperial system will give you information in inches.

Enumerator:
Metric 

Metric system (used e.g. in Europe)

Imperial 

Imperial system (used e.g. in the United States)

Definition at line 1780 of file klocale.h.

enum KLocale::ReadDateFlags

Flags for readDate()

Enumerator:
NormalFormat 

Only accept a date string in the locale LongDate format.

ShortFormat 

Only accept a date string in the locale ShortDate format.

IsoFormat 

Only accept a date string in ISO date format (YYYY-MM-DD)

IsoWeekFormat 

Only accept a date string in ISO Week date format (YYYY-Www-D)

IsoOrdinalFormat 

Only accept a date string in ISO Week date format (YYYY-DDD)

Definition at line 1249 of file klocale.h.

enum KLocale::ReadTimeFlags

Flags for the old version of readTime()

Deprecated:
replaced by TimeFormatOptions
Enumerator:
WithSeconds 

Only accept a time string with seconds. Default (no flag set)

WithoutSeconds 

Only accept a time string without seconds.

Definition at line 1297 of file klocale.h.

enum KLocale::SignPosition

Various positions for where to place the positive or negative sign when they are related to a monetary value.

Enumerator:
ParensAround 

Put parantheses around the quantity, e.g.

"$ (217)"

BeforeQuantityMoney 

Prefix the quantity with the sign, e.g.

"$ -217"

AfterQuantityMoney 

Suffix the quanitity with the sign, e.g.

"$ 217-"

BeforeMoney 

Prefix the currency symbol with the sign, e.g.

"-$ 217"

AfterMoney 

Suffix the currency symbol with the sign, e.g.

"$- 217"

Definition at line 281 of file klocale.h.

enum KLocale::TimeFormatOption
Since:
4.4

Format flags for readLocaleTime() and formatLocaleTime()

Enumerator:
TimeDefault 

Default formatting using seconds and the format as specified by the locale.

TimeWithoutSeconds 

Exclude the seconds part of the time from display.

TimeWithoutAmPm 

Read/format time string without am/pm suffix but keep the 12/24h format as specified by locale time format, eg.

"07.33.05" instead of "07.33.05 pm" for time format "%I.%M.%S %p".

TimeDuration 

Read/format time string as duration.

This will strip the am/pm suffix and read/format times with an hour value of 0-23 hours, eg. "19.33.05" instead of "07.33.05 pm" for time format "%I.%M.%S %p". This automatically implies TimeWithoutAmPm.

TimeFoldHours 

Read/format time string as duration.

This will not not output the hours part of the duration but will add the hours (times sixty) to the number of minutes, eg. "70.23" instead of "01.10.23" for time format "%I.%M.%S %p".

Definition at line 1017 of file klocale.h.

enum KLocale::TimeProcessingOption

Additional processing options for readLocaleTime().

Remarks:
This is currently used as an enum but declared as a flag to be extensible
Enumerator:
ProcessStrict 

Process time in a strict manner, ie.

a read time string has to exactly match the defined time format.

ProcessNonStrict 

Process time in a lax manner, ie.

allow spaces in the time-format to be left out when entering a time string.

Definition at line 1325 of file klocale.h.

enum KLocale::WeekNumberSystem
Since:
4.6

System used for Week Numbers

See also:
setWeekNumberSystem()
weekNumberSystem()
Enumerator:
DefaultWeekNumber 

The system locale default.

IsoWeekNumber 

ISO Week Number.

FirstFullWeek 

Week 1 starts on the first Week Start Day in year ends after 7 days.

FirstPartialWeek 

Week 1 starts Jan 1st ends day before first Week Start Day in year.

SimpleWeek 

Week 1 starts Jan 1st ends after 7 days.

Definition at line 815 of file klocale.h.


Constructor & Destructor Documentation

KLocale::KLocale ( const QString &  catalog,
KSharedConfig::Ptr  config = KSharedConfig::Ptr() 
)
explicit

Constructs a KLocale with the given catalog name.

The constructor looks for an entry Language in the group Locale in the configuration file.

If no configuration 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. Note that a setLocale() will be performed on the config using the current locale language, which may cause a sync() and reparseConfiguration() which will save any changes you have made and load any changes other shared copies have made.

Parameters:
catalogthe name of the main language file
configa configuration file with a Locale group detailing locale-related preferences (such as language and formatting options).

Definition at line 48 of file klocale.cpp.

KLocale::KLocale ( const QString &  catalog,
const QString &  language,
const QString &  country = QString(),
KConfig *  config = 0 
)

Constructs a KLocale with the given catalog name.

Allows you to override the language and, optionally, the country of this locale.

If you specify a configuration file, a setLocale() will be performed on the config using the current locale language, which may cause a sync() and reparseConfiguration() which will save any changes you have made.

Parameters:
catalogthe name of the main language file
languagethe ISO Language Code for the locale, e.g. "en" for English
countrythe ISO Country Code for the locale, e.g. "us" for USA
configa configuration file with a Locale group detailing locale-related preferences (such as language and formatting options).

Definition at line 59 of file klocale.cpp.

KLocale::KLocale ( const KLocale &  rhs)

Copy constructor.

Definition at line 725 of file klocale.cpp.

KLocale::~KLocale ( )
virtual

Destructor.

Definition at line 70 of file klocale.cpp.


Member Function Documentation

QStringList KLocale::allCountriesList ( ) const

Provides list of all known country codes.

Use countryCodeToName(country) to get human readable, localized country names.

Returns:
a list of all country codes
See also:
countryCodeToName

Definition at line 675 of file klocale.cpp.

QList< KLocale::DigitSet > KLocale::allDigitSetsList ( ) const
Since:
4.3

Provides list of all known digit set identifiers.

Returns:
list of all digit set identifiers
See also:
DigitSet
digitSetToName

Definition at line 202 of file klocale.cpp.

QStringList KLocale::allLanguagesList ( ) const

Provides list of all known language codes.

Use languageCodeToName(language) to get human readable, localized language names.

Returns:
list of all language codes
See also:
languageCodeToName
installedLanguages

Definition at line 660 of file klocale.cpp.

KLocale::BinaryUnitDialect KLocale::binaryUnitDialect ( ) const

Returns the user's configured binary unit dialect.

e.g. if MetricBinaryDialect is returned then the values configured for how much a set of bytes are worth would be 10^(3*n) and KB (1000 bytes == 1 KB), in this case.

Will never return DefaultBinaryDialect.

Since:
4.4
Returns:
User's configured binary unit dialect
See also:
BinaryUnitDialect

Definition at line 348 of file klocale.cpp.

const KCalendarSystem * KLocale::calendar ( ) const

Returns a pointer to the calendar system object.

Returns:
the current calendar system instance

Definition at line 705 of file klocale.cpp.

KLocale::CalendarSystem KLocale::calendarSystem ( ) const
Since:
4.6

Returns the type of Calendar System used in this Locale

See also:
KLocale::CalendarSystem
KCalendarSystem
Returns:
the type of Calendar System

Definition at line 700 of file klocale.cpp.

QString KLocale::calendarType ( ) const
Deprecated:
use calendarSystem() instead
   Returns the name of the calendar system that is currently being
   used by the system.

   @see calendarSystem()
   @return the name of the calendar system

Definition at line 695 of file klocale.cpp.

QTextCodec * KLocale::codecForEncoding ( ) const

Returns the user's preferred encoding.

Should never be NULL.

  @return The codec for the preferred encoding

  @see encoding
  @see encodingMib

Definition at line 650 of file klocale.cpp.

QString KLocale::convertDigits ( const QString &  str,
DigitSet  digitSet,
bool  ignoreContext = false 
) const
Since:
4.3

Convert all digits in the string to the given digit set.

Conversion is normally not performed if the given digit set is not appropriate in the current locale and language context. Unconditional conversion may be requested by setting ignoreContext to true.

Parameters:
strthe string to convert
digitSetthe digit set identifier
ignoreContextunconditional conversion if true
Returns:
string with converted digits
See also:
DigitSet

Definition at line 212 of file klocale.cpp.

void KLocale::copyCatalogsTo ( KLocale *  locale)

Copies the catalogs of this object to an other KLocale object.

Parameters:
localethe destination KLocale object

Definition at line 739 of file klocale.cpp.

QString KLocale::country ( ) const

Returns the country code of the country where the user lives.

The returned code complies with the ISO 3166-1 alpha-2 standard, except by KDE convention it is returned in lowercase whereas the official standard is uppercase. See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for details.

defaultCountry() is returned by default, if no other available, this will always be uppercase 'C'.

Use countryCodeToName(country) to get human readable, localized country names.

Returns:
the country code for the user
See also:
countryCodeToName

Definition at line 116 of file klocale.cpp.

QString KLocale::countryCodeToName ( const QString &  country) const

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.

Parameters:
countrythe country code
Returns:
the human readable and localized form of the country name
See also:
country
allCountriesList

Definition at line 680 of file klocale.cpp.

QString KLocale::countryDivisionCode ( ) const
Since:
4.6

Returns the Country Division Code of the Country where the user lives. When no value is set, then the Country Code will be returned.

The returned code complies with the ISO 3166-2 standard. See http://en.wikipedia.org/wiki/ISO_3166-2 for details.

Note that unlike country() this method will return the correct case, i.e. normally uppercase..

In KDE 4.6 it is the apps responsibility to obtain a translation for the code, translation and other services will be priovided in KDE 4.7.

Returns:
the Country Division Code for the user
See also:
setCountryDivisionCode

Definition at line 121 of file klocale.cpp.

KCurrencyCode * KLocale::currency ( ) const
Since:
4.4

Returns the Currency Code object for the current locale

Returns:
The default Currency Code object used by locale.

Definition at line 126 of file klocale.cpp.

QString KLocale::currencyCode ( ) const
Since:
4.4

Returns the ISO 4217 Currency Code for the current locale

Returns:
The default ISO Currency Code used by locale.

Definition at line 131 of file klocale.cpp.

QStringList KLocale::currencyCodeList ( ) const
Since:
4.4

Returns the ISO Currency Codes used in the locale, ordered by decreasing priority.

Use KCurrency::currencyCodeToName(currencyCode) to get human readable, localized language name.

Returns:
list of ISO Currency Codes
See also:
currencyCodeToName

Definition at line 444 of file klocale.cpp.

QString KLocale::currencySymbol ( ) const

Returns what the symbol denoting currency in the current locale as as defined by user settings should look like.

Returns:
The default currency symbol used by locale.

Definition at line 262 of file klocale.cpp.

QString KLocale::dateFormat ( ) const

Returns the currently selected date format.

Returns:
Current date format.
See also:
setDateFormat()

Definition at line 510 of file klocale.cpp.

QString KLocale::dateFormatShort ( ) const

Returns the currently selected short date format.

Returns:
Current short date format.
See also:
setDateFormatShort()

Definition at line 515 of file klocale.cpp.

bool KLocale::dateMonthNamePossessive ( ) const

Use this to determine whether in dates a possessive form of month name is preferred ("of January" rather than "January")

Returns:
If possessive form should be used

Definition at line 222 of file klocale.cpp.

KLocale::DigitSet KLocale::dateTimeDigitSet ( ) const
Since:
4.3

Returns the identifier of the digit set used to display dates and time.

Returns:
the digit set identifier
See also:
DigitSet
digitSetToName

Definition at line 779 of file klocale.cpp.

QString KLocale::dayPeriodText ( const QTime &  time,
DateTimeComponentFormat  format = DefaultComponentFormat 
) const
Since:
4.6

Returns the Day Period matching the time given

Parameters:
timethe time to return the day period for
formatthe format to return teh day period in
Returns:
the Day Period for the given time

Definition at line 434 of file klocale.cpp.

int KLocale::decimalPlaces ( ) const
Since:
4.4

The number of decimal places to include in numeric values (usually 2).

Returns:
Default number of numeric decimal places used by locale.

Definition at line 247 of file klocale.cpp.

QString KLocale::decimalSymbol ( ) const

Returns what a decimal point should look like ("." or "," etc.) according to the current locale or user settings.

Returns:
The decimal symbol used by locale.

Definition at line 252 of file klocale.cpp.

QString KLocale::defaultCountry ( )
static

Returns the code of the default country, i.e.

"C"

  This function will not provide a sensible value to use in your app,
  please use country() instead.

  @see country

  @return Name of the default country

Definition at line 620 of file klocale.cpp.

QString KLocale::defaultCurrencyCode ( )
static
Since:
4.4

Returns the ISO Code of the default currency.

Returns:
ISO Currency Code of the default currency

Definition at line 625 of file klocale.cpp.

QString KLocale::defaultLanguage ( )
static

Returns the name of the internal language.

Returns:
Name of the default language

Definition at line 615 of file klocale.cpp.

KLocale::DigitSet KLocale::digitSet ( ) const
Since:
4.3

Returns the identifier of the digit set used to display numbers.

Returns:
the digit set identifier
See also:
DigitSet
digitSetToName

Definition at line 759 of file klocale.cpp.

QString KLocale::digitSetToName ( KLocale::DigitSet  digitSet,
bool  withDigits = false 
) const
Since:
4.3

Convert a digit set identifier to a human readable, localized name.

Parameters:
digitSetthe digit set identifier
withDigitswhether to add the digits themselves to the name
Returns:
the human readable and localized name of the digit set
See also:
DigitSet

Definition at line 207 of file klocale.cpp.

const QByteArray KLocale::encoding ( ) const

Returns the user's preferred encoding.

Returns:
The name of the preferred encoding
See also:
codecForEncoding
encodingMib

Definition at line 635 of file klocale.cpp.

int KLocale::encodingMib ( ) const

Returns the user's preferred encoding.

Returns:
The Mib of the preferred encoding
See also:
encoding
codecForEncoding

Definition at line 640 of file klocale.cpp.

int KLocale::fileEncodingMib ( ) const

Returns the file encoding.

Returns:
The Mib of the file encoding
See also:
QFile::encodeName
QFile::decodeName

Definition at line 645 of file klocale.cpp.

QString KLocale::formatByteSize ( double  size) const

Converts size from bytes to the string representation using the user's default binary unit dialect.

The default unit dialect is IEC 60027-2.

Example: formatByteSize(1024) returns "1.0 KiB" by default.

Parameters:
sizesize in bytes
Returns:
converted size as a string - e.g. 123.4 KiB , 12.0 MiB
See also:
BinaryUnitDialect
Todo:
KDE 5: Remove in favor of overload added in KDE 4.4.

Definition at line 343 of file klocale.cpp.

QString KLocale::formatByteSize ( double  size,
int  precision,
KLocale::BinaryUnitDialect  dialect = KLocale::DefaultBinaryDialect,
KLocale::BinarySizeUnits  specificUnit = KLocale::DefaultBinaryUnits 
) const
Since:
4.4

Converts size from bytes to the appropriate string representation using the binary unit dialect dialect and the specific units specificUnit.

Example: formatByteSize(1000, unit, KLocale::UnitKiloByte) returns: for KLocale::MetricBinaryDialect, "1.0 kB", for KLocale::IECBinaryDialect, "0.9 KiB", for KLocale::JEDECBinaryDialect, "0.9 KB".

Parameters:
sizesize in bytes
precisionnumber of places after the decimal point to use. KDE uses 1 by default so when in doubt use 1.
dialectbinary unit standard to use. Use DefaultBinaryDialect to use the localized user selection unless you need to use a specific unit type (such as displaying a flash memory size in JEDEC).
specificUnitspecific unit size to use in result. Use DefaultBinaryUnits to automatically select a unit that will return a sanely-sized number.
Returns:
converted size as a translated string including the units. E.g. "1.23 KiB", "2 GB" (JEDEC), "4.2 kB" (Metric).
See also:
BinaryUnitDialect

Definition at line 337 of file klocale.cpp.

QString KLocale::formatDate ( const QDate &  date,
KLocale::DateFormat  format = LongDate 
) const

Returns a string formatted to the current locale's conventions regarding dates.

Parameters:
datethe date to be formatted
formatcategory of date format to use
Returns:
the date as a string

Definition at line 368 of file klocale.cpp.

QString KLocale::formatDateTime ( const QDateTime &  dateTime,
KLocale::DateFormat  format = ShortDate,
bool  includeSecs = false 
) const

Returns a string formatted to the current locale's conventions regarding both date and time.

Parameters:
dateTimethe date and time to be formatted
formatcategory of date format to use
includeSecsif true, the string will include the seconds part of the time; otherwise, the seconds will be omitted
Returns:
the date and time as a string

Definition at line 456 of file klocale.cpp.

QString KLocale::formatDateTime ( const KDateTime &  dateTime,
KLocale::DateFormat  format = ShortDate,
DateTimeFormatOptions  options = 0 
) const

Returns a string formatted to the current locale's conventions regarding both date and time.

Parameters:
dateTimethe date and time to be formatted
formatcategory of date format to use
optionsadditional output options
Returns:
The date and time as a string

Definition at line 461 of file klocale.cpp.

QString KLocale::formatDuration ( unsigned long  mSec) const

Given a number of milliseconds, converts that to a string containing the localized equivalent.

e.g. given formatDuration(60000), returns "1.0 minutes"

Parameters:
mSecTime duration in milliseconds
Returns:
converted duration as a string - e.g. "5.5 seconds" "23.0 minutes"

Definition at line 358 of file klocale.cpp.

QString KLocale::formatLocaleTime ( const QTime &  pTime,
TimeFormatOptions  options = KLocale::TimeDefault 
) const
Since:
4.4

Returns a string formatted to the current locale's conventions regarding times.

Parameters:
pTimethe time to be formatted
optionsformat option to use when formatting the time
Returns:
The time as a string

Definition at line 424 of file klocale.cpp.

QString KLocale::formatLong ( long  num) const

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).

Parameters:
numThe number to convert
Returns:
The number as a localized string

Definition at line 327 of file klocale.cpp.

QString KLocale::formatMoney ( double  num,
const QString &  currency = QString(),
int  precision = -1 
) const

Given a double, converts that to a numeric string containing the localized monetary equivalent.

e.g. given 123456, return "$ 123,456.00".

If precision isn't specified or is < 0, then the default monetaryDecimalPlaces() is used.

Parameters:
numThe number we want to format
currencyThe currency symbol you want.
precisionNumber of decimal places displayed
Returns:
The number of money as a localized string
See also:
monetaryDecimalPlaces()

Definition at line 317 of file klocale.cpp.

QString KLocale::formatNumber ( double  num,
int  precision = -1 
) const

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 or is < 0, then the default decimalPlaces() is used.

This function is a wrapper that is provided for convenience.

Parameters:
numThe number to convert
precisionNumber of decimal places used.
Returns:
The number as a localized string
See also:
formatNumber(const QString, bool, int)
decimalPlaces()

Definition at line 322 of file klocale.cpp.

QString KLocale::formatNumber ( const QString &  numStr,
bool  round = true,
int  precision = -1 
) const

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).

If precision isn't specified or is < 0, then the default decimalPlaces() is used.

Parameters:
numStrThe number to format, as a string.
roundRound fractional digits. (default true)
precisionNumber of fractional digits used for rounding. Unused if round=false.
Returns:
The number as a localized string

Definition at line 332 of file klocale.cpp.

QString KLocale::formatTime ( const QTime &  pTime,
bool  includeSecs = false,
bool  isDuration = false 
) const
Deprecated:
replaced by formatLocaleTime()
   Returns a string formatted to the current locale's conventions
   regarding times.

   @param pTime The time to be formatted.
   @param includeSecs if true, seconds are included in the output,
          otherwise only hours and minutes are formatted.
   @param isDuration if true, the given time is a duration, not a clock time.
   This means "am/pm" shouldn't be displayed.

   @return The time as a string

Definition at line 419 of file klocale.cpp.

int KLocale::fracDigits ( ) const
Deprecated:
use decimalPlaces() or monetaryDecimalPlaces()
   The number of fractional digits to include in monetary values (usually 2).

   @return Default number of fractional digits used by locale.

Definition at line 287 of file klocale.cpp.

void KLocale::insertCatalog ( const QString &  catalog)

Adds another catalog to search for translation lookup.

This function is useful for extern libraries and/or code, that provide their own messages.

If the catalog does not exist for the chosen language, it will be ignored and en_US will be used.

Parameters:
catalogThe catalog to add.

Definition at line 136 of file klocale.cpp.

QStringList KLocale::installedLanguages ( ) const
Since:
4.6

Provides list of all installed KDE Language Translations.

Use languageCodeToName(language) to get human readable, localized language names.

Returns:
list of all installed language codes
See also:
languageCodeToName

Definition at line 665 of file klocale.cpp.

bool KLocale::isApplicationTranslatedInto ( const QString &  language)

Checks whether or not the active catalog is found for the given language.

Parameters:
languagelanguage to check

Definition at line 100 of file klocale.cpp.

QString KLocale::langLookup ( const QString &  fname,
const char *  rtype = "html" 
)
static
Deprecated:
   Finds localized resource in resourceDir( rtype ) + \<lang> + fname.

   Since KDE 4.1, this service is provided in a slightly different form,
   automatically by e.g. KStandardDirs::locate() and other KDE core classes
   dealing with paths. For manual use, it is replaced by localizedFilePath().

   @param fname relative path to find
   @param rtype resource type to use

   @return path to localized resource

   @see localizedFilePath

Definition at line 466 of file klocale.cpp.

QString KLocale::language ( ) const

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.

Returns:
the currently used language code
See also:
languageCodeToName

Definition at line 111 of file klocale.cpp.

QString KLocale::languageCodeToName ( const QString &  language) const

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.

Parameters:
languagethe language code
Returns:
the human readable and localized form if the code is known, empty otherwise
See also:
language
languageList
allLanguagesList
installedLanguages

Definition at line 670 of file klocale.cpp.

QStringList KLocale::languageList ( ) const

Returns the language codes selected by user, ordered by decreasing priority.

Use languageCodeToName(language) to get human readable, localized language name.

Returns:
list of language codes
See also:
languageCodeToName

Definition at line 439 of file klocale.cpp.

QString KLocale::localizedFilePath ( const QString &  filePath) const
Since:
4.1

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).

Parameters:
filePathpath to the original file
Returns:
path to the localized file if found, original path otherwise

Definition at line 744 of file klocale.cpp.

KLocale::MeasureSystem KLocale::measureSystem ( ) const

Returns which measuring system we use.

Returns:
The preferred measuring system

Definition at line 605 of file klocale.cpp.

int KLocale::monetaryDecimalPlaces ( ) const
Since:
4.4

The number of decimal places to include in monetary values (usually 2).

Returns:
Default number of monetary decimal places used by locale.

Definition at line 292 of file klocale.cpp.

QString KLocale::monetaryDecimalSymbol ( ) const

Returns what a decimal point should look like ("." or "," etc.) for monetary values, according to the current locale or user settings.

Returns:
The monetary decimal symbol used by locale.

Definition at line 267 of file klocale.cpp.

KLocale::DigitSet KLocale::monetaryDigitSet ( ) const
Since:
4.3

Retuns the digit set used to display monetary values.

Returns:
the digit set identifier
See also:
DigitSet
digitSetToName

Definition at line 769 of file klocale.cpp.

QString KLocale::monetaryThousandsSeparator ( ) const

Returns what a thousands separator for monetary values should look like ("," or " " etc.) according to the current locale or user settings.

Returns:
The monetary thousands separator used by locale.

Definition at line 272 of file klocale.cpp.

KLocale::SignPosition KLocale::negativeMonetarySignPosition ( ) const

Denotes where to place a negative sign in relation to a monetary value.

Returns:
Where/how to print the negative sign.
See also:
SignPosition

Definition at line 312 of file klocale.cpp.

bool KLocale::negativePrefixCurrencySymbol ( ) const

If and only if the currency symbol precedes a negative value, this will be true.

Returns:
True if the currency symbol precedes negative numbers.

Definition at line 302 of file klocale.cpp.

QString KLocale::negativeSign ( ) const

Returns what a negative sign should look like ("-", etc.) according to the current locale or user settings.

Returns:
The negative sign used by locale.

Definition at line 282 of file klocale.cpp.

bool KLocale::nounDeclension ( ) const
Deprecated:
   Use this to determine whether nouns are declined in
   locale's language. This property should remain
   read-only (no setter function)

   @return If nouns are declined

Definition at line 217 of file klocale.cpp.

KLocale & KLocale::operator= ( const KLocale &  rhs)

Assignment operator.

Definition at line 731 of file klocale.cpp.

int KLocale::pageSize ( ) const

Returns the preferred page size for printing.

Returns:
The preferred page size, cast it to QPrinter::PageSize

Definition at line 595 of file klocale.cpp.

KLocale::SignPosition KLocale::positiveMonetarySignPosition ( ) const

Returns the position of a positive sign in relation to a monetary value.

Returns:
Where/how to print the positive sign.
See also:
SignPosition

Definition at line 307 of file klocale.cpp.

bool KLocale::positivePrefixCurrencySymbol ( ) const

If and only if the currency symbol precedes a positive value, this will be true.

Returns:
Where to print the currency symbol for positive numbers.

Definition at line 297 of file klocale.cpp.

QString KLocale::positiveSign ( ) const

Returns what a positive sign should look like ("+", " ", etc.) according to the current locale or user settings.

Returns:
The positive sign used by locale.

Definition at line 277 of file klocale.cpp.

QString KLocale::prettyFormatDuration ( unsigned long  mSec) const

Given a number of milliseconds, converts that to a pretty string containing the localized equivalent.

e.g. given prettyFormatDuration(60001) returns "1 minute" given prettyFormatDuration(62005) returns "1 minute and 2 seconds" given prettyFormatDuration(90060000) returns "1 day and 1 hour"

Parameters:
mSecTime duration in milliseconds
Returns:
converted duration as a string. Units not interesting to the user, for example seconds or minutes when the first unit is day, are not returned because they are irrelevant. The same applies for seconds when the first unit is hour.
Since:
4.2

Definition at line 363 of file klocale.cpp.

QDate KLocale::readDate ( const QString &  str,
bool *  ok = 0 
) const

Converts a localized date string to a QDate.

This method will try all ReadDateFlag formats in preferred order to read a valid date.

The bool pointed by ok will be invalid if the date entered was not valid.

Parameters:
strthe string we want to convert.
okthe boolean that is set to false if it's not a valid date. If ok is 0, it will be ignored
Returns:
The string converted to a QDate
See also:
KCalendarSystem::readDate()

Definition at line 388 of file klocale.cpp.

QDate KLocale::readDate ( const QString &  intstr,
const QString &  fmt,
bool *  ok = 0 
) const

Converts a localized date string to a QDate, using the specified format.

You will usually not want to use this method.

See also:
KCalendarSystem::readDate()

Definition at line 398 of file klocale.cpp.

QDate KLocale::readDate ( const QString &  str,
ReadDateFlags  flags,
bool *  ok = 0 
) const

Converts a localized date string to a QDate.

This method is stricter than readDate(str,&ok): it will only accept a date in a specific format, depending on flags.

Parameters:
strthe string we want to convert.
flagswhat format the the date string will be in
okthe boolean that is set to false if it's not a valid date. If ok is 0, it will be ignored
Returns:
The string converted to a QDate
See also:
KCalendarSystem::readDate()

Definition at line 393 of file klocale.cpp.

QTime KLocale::readLocaleTime ( const QString &  str,
bool *  ok = 0,
TimeFormatOptions  options = KLocale::TimeDefault,
TimeProcessingOptions  processing = ProcessNonStrict 
) const
Since:
4.4

Converts a localized time string to a QTime. This method is stricter than readTime(str, &ok) in that it will either accept a time with seconds or a time without seconds.

Parameters:
strthe string we want to convert
okthe boolean that is set to false if it's not a valid time. If ok is 0, it will be ignored.
optionsformat option to apply when formatting the time
processingif set to ProcessStrict, checking will be strict and the read time string has to have the exact time format specified. If set to ProcessNonStrict processing the time is lax and spaces in the time string can be left out.
Returns:
The string converted to a QTime

Definition at line 413 of file klocale.cpp.

double KLocale::readMoney ( const QString &  numStr,
bool *  ok = 0 
) const

Converts a localized monetary string to a double.

Parameters:
numStrthe string we want to convert.
okthe boolean that is set to false if it's not a number. If ok is 0, it will be ignored
Returns:
The string converted to a double

Definition at line 383 of file klocale.cpp.

double KLocale::readNumber ( const QString &  numStr,
bool *  ok = 0 
) const

Converts a localized numeric string to a double.

Parameters:
numStrthe string we want to convert.
okthe boolean that is set to false if it's not a number. If ok is 0, it will be ignored
Returns:
The string converted to a double

Definition at line 378 of file klocale.cpp.

QTime KLocale::readTime ( const QString &  str,
bool *  ok = 0 
) const

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.

Parameters:
strthe string we want to convert.
okthe boolean that is set to false if it's not a valid time. If ok is 0, it will be ignored
Returns:
The string converted to a QTime

Definition at line 403 of file klocale.cpp.

QTime KLocale::readTime ( const QString &  str,
KLocale::ReadTimeFlags  flags,
bool *  ok = 0 
) const
Deprecated:
replaced readLocaleTime()
   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.

   @param str the string we want to convert.
   @param flags whether the time string is expected to contain seconds or not.
   @param ok the boolean that is set to false if it's not a valid time.
             If @p ok is 0, it will be ignored

   @return The string converted to a QTime

Definition at line 408 of file klocale.cpp.

QString KLocale::removeAcceleratorMarker ( const QString &  label) const
Since:
4.2

Removes accelerator marker from a UI text label.

Accelerator marker is not always a plain ampersand (&), so it is not enough to just remove it by QString::remove(). The label may contain escaped markers ("&&") which must be resolved and skipped, as well as CJK-style markers ("Foo (&F)") where the whole parenthesis construct should be removed. Therefore always use this function to remove accelerator marker from UI labels.

Parameters:
labelUI label which may contain an accelerator marker
Returns:
label without the accelerator marker

Definition at line 749 of file klocale.cpp.

void KLocale::removeCatalog ( const QString &  catalog)

Removes a catalog for translation lookup.

Parameters:
catalogThe catalog to remove.
See also:
insertCatalog()

Definition at line 141 of file klocale.cpp.

void KLocale::reparseConfiguration ( )
Since:
4.8

Reparse locale configuration files for the current selected language.

Definition at line 784 of file klocale.cpp.

void KLocale::setActiveCatalog ( const QString &  catalog)

Sets the active catalog for translation lookup.

Parameters:
catalogThe catalog to activate.

Definition at line 146 of file klocale.cpp.

void KLocale::setBinaryUnitDialect ( KLocale::BinaryUnitDialect  newDialect)

Sets newDialect to be the default dialect for this locale (and only this locale).

Newly created KLocale objects will continue to default to the user's choice.

Parameters:
newDialectthe new dialect to set as default for this locale object.
Since:
4.4

Definition at line 353 of file klocale.cpp.

void KLocale::setCalendar ( const QString &  calendarType)
Deprecated:
use setCalendarSystem() instead
   Changes the current calendar system to the calendar specified.
   If the calendar system specified is not found, gregorian will be used.

   @see setCalendarSystem()
   @param calendarType the name of the calendar type

Definition at line 685 of file klocale.cpp.

void KLocale::setCalendarSystem ( KLocale::CalendarSystem  calendarSystem)
Since:
4.6

Sets the type of Calendar System to use in this Locale

See also:
KLocale::CalendarSystem
KCalendarSystem
Parameters:
calendarSystemthe Calendar System to use

Definition at line 690 of file klocale.cpp.

bool KLocale::setCountry ( const QString &  country,
KConfig *  config 
)

Changes the current country.

The current country will be left unchanged if failed. It will force a reload of the country specific configuration.

An empty country value will set the country to the system default.

If you specify a configuration file, a setLocale() will be performed on the config using the current locale language, which may cause a sync() and reparseConfiguration() which will save any changes you have made.

Parameters:
countrythe ISO 3166 country code
configa configuration file with a Locale group detailing locale-related preferences (such as language and formatting options).
Returns:
true on success, false on failure

Definition at line 75 of file klocale.cpp.

bool KLocale::setCountryDivisionCode ( const QString &  countryDivision)
Since:
4.6

Sets the Country Division Code of the Country where the user lives.

The code must comply with the ISO 3166-2 standard. See http://en.wikipedia.org/wiki/ISO_3166-2 for details.

In KDE 4.6 it is the apps responsibility to validate the input, full validation and other services will be provided in KDE 4.7.

Parameters:
countryDivisionthe Country Division Code for the user
Returns:
true on success, false on failure
See also:
countryDivisionCode

Definition at line 80 of file klocale.cpp.

void KLocale::setCurrencyCode ( const QString &  newCurrencyCode)
Since:
4.4

Changes the current ISO Currency Code.

Parameters:
newCurrencyCodeThe new Currency Code

Definition at line 95 of file klocale.cpp.

void KLocale::setCurrencySymbol ( const QString &  symbol)

Changes the current currency symbol.

This symbol should be consistant with the selected Currency Code

Parameters:
symbolThe new currency symbol
See also:
currencyCode, KCurrency::currencySymbols

Definition at line 590 of file klocale.cpp.

void KLocale::setDateFormat ( const QString &  format)

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. "2004" for "2004")
  • y with the lower 2 digits of the year (e.g. "04" for "2004")
  • 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".

Parameters:
formatThe new date format

Definition at line 470 of file klocale.cpp.

void KLocale::setDateFormatShort ( const QString &  format)

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".

Parameters:
formatThe new short date format

Definition at line 475 of file klocale.cpp.

void KLocale::setDateMonthNamePossessive ( bool  possessive)

Changes the form of month name used in dates.

Parameters:
possessiveTrue if possessive forms should be used

Definition at line 480 of file klocale.cpp.

void KLocale::setDateTimeDigitSet ( KLocale::DigitSet  digitSet)
Since:
4.3

Set digit characters used to display dates and time.

Parameters:
digitSetthe digit set identifier
See also:
DigitSet

Definition at line 774 of file klocale.cpp.

void KLocale::setDecimalPlaces ( int  digits)
Since:
4.4

Changes the number of decimal places used when formating numbers.

Parameters:
digitsThe default number of digits to use.

Definition at line 525 of file klocale.cpp.

void KLocale::setDecimalSymbol ( const QString &  symbol)

Changes the symbol used to identify the decimal pointer.

Parameters:
symbolThe new decimal symbol.

Definition at line 530 of file klocale.cpp.

void KLocale::setDigitSet ( KLocale::DigitSet  digitSet)
Since:
4.3

Changes the set of digit characters used to display numbers.

Parameters:
digitSetthe digit set identifier
See also:
DigitSet

Definition at line 754 of file klocale.cpp.

bool KLocale::setEncoding ( int  mibEnum)

Changes the current encoding.

Parameters:
mibEnumThe mib of the preferred codec
Returns:
True on success.

Definition at line 655 of file klocale.cpp.

void KLocale::setFracDigits ( int  digits)
Deprecated:
use setDecimalPlaces() or setMonetaryDecimalPlaces()
   Changes the number of digits used when formating numbers.

   @param digits The default number of digits to use.

Definition at line 570 of file klocale.cpp.

bool KLocale::setLanguage ( const QString &  language,
KConfig *  config 
)

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.

If you specify a configuration file, a setLocale() will be performed on the config using the current locale language, which may cause a sync() and reparseConfiguration() which will save any changes you have made.

Parameters:
languagethe language code
configa configuration file with a Locale group detailing locale-related preferences (such as language and formatting options).
Returns:
true on success

Definition at line 85 of file klocale.cpp.

bool KLocale::setLanguage ( const QStringList &  languages)

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.

Parameters:
languagesthe list of language codes
Returns:
true if one of the specified languages were used

Definition at line 90 of file klocale.cpp.

void KLocale::setMainCatalog ( const char *  catalog)
static

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.

Parameters:
catalogCatalog to override all other main Catalogs.

Definition at line 373 of file klocale.cpp.

void KLocale::setMeasureSystem ( KLocale::MeasureSystem  value)

Changes the preferred measuring system.

Returns:
value The preferred measuring system

Definition at line 610 of file klocale.cpp.

void KLocale::setMonetaryDecimalPlaces ( int  digits)
Since:
4.4

Changes the number of decimal places used when formating money.

Parameters:
digitsThe default number of digits to use.

Definition at line 575 of file klocale.cpp.

void KLocale::setMonetaryDecimalSymbol ( const QString &  symbol)

Changes the symbol used to identify the decimal pointer for monetary values.

Parameters:
symbolThe new decimal symbol.

Definition at line 585 of file klocale.cpp.

void KLocale::setMonetaryDigitSet ( KLocale::DigitSet  digitSet)
Since:
4.3

Set digit characters used to display monetary values.

Parameters:
digitSetthe digit set identifier
See also:
DigitSet

Definition at line 764 of file klocale.cpp.

void KLocale::setMonetaryThousandsSeparator ( const QString &  separator)

Changes the separator used to group digits when formating monetary values.

Parameters:
separatorThe new thousands separator.

Definition at line 580 of file klocale.cpp.

void KLocale::setNegativeMonetarySignPosition ( KLocale::SignPosition  signpos)

Changes the sign position used for negative monetary values.

Parameters:
signposThe new sign position

Definition at line 555 of file klocale.cpp.

void KLocale::setNegativePrefixCurrencySymbol ( bool  prefix)

Changes the position where the currency symbol should be printed for negative monetary values.

Parameters:
prefixTrue if the currency symbol should be prefixed instead of postfixed

Definition at line 565 of file klocale.cpp.

void KLocale::setNegativeSign ( const QString &  sign)

Changes the sign used to identify a negative number.

Parameters:
signSign used for negative numbers.

Definition at line 545 of file klocale.cpp.

void KLocale::setPageSize ( int  paperFormat)

Changes the preferred page size when printing.

Parameters:
paperFormatthe new preferred page size in the format QPrinter::PageSize

Definition at line 600 of file klocale.cpp.

void KLocale::setPositiveMonetarySignPosition ( KLocale::SignPosition  signpos)

Changes the sign position used for positive monetary values.

Parameters:
signposThe new sign position

Definition at line 550 of file klocale.cpp.

void KLocale::setPositivePrefixCurrencySymbol ( bool  prefix)

Changes the position where the currency symbol should be printed for positive monetary values.

Parameters:
prefixTrue if the currency symbol should be prefixed instead of postfixed

Definition at line 560 of file klocale.cpp.

void KLocale::setPositiveSign ( const QString &  sign)

Changes the sign used to identify a positive number.

Normally this is left blank.

Parameters:
signSign used for positive numbers.

Definition at line 540 of file klocale.cpp.

void KLocale::setThousandsSeparator ( const QString &  separator)

Changes the separator used to group digits when formating numbers.

Parameters:
separatorThe new thousands separator.

Definition at line 535 of file klocale.cpp.

void KLocale::setTimeFormat ( const QString &  format)

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".

Parameters:
formatThe new time format

Definition at line 485 of file klocale.cpp.

void KLocale::setWeekDayOfPray ( int  day)

Changes how KLocale defines the day reserved for religious observance.

Since:
4.2
Parameters:
dayday of the week for religious observance (None=0,Monday=1..Sunday=7) as integer

Definition at line 505 of file klocale.cpp.

void KLocale::setWeekNumberSystem ( KLocale::WeekNumberSystem  weekNumberSystem)
Since:
4.6

Sets the type of Week Number System to use in this Locale

See also:
Klocale::WeekNumberSystem
weekNumberSystem()
Parameters:
weekNumberSystemthe Week Number System to use

Definition at line 710 of file klocale.cpp.

void KLocale::setWeekStartDay ( int  day)

Changes how KLocale defines the first day in week.

Parameters:
dayfirst day of the week (Monday=1..Sunday=7) as integer

Definition at line 490 of file klocale.cpp.

void KLocale::setWorkingWeekEndDay ( int  day)

Changes how KLocale defines the last working day in week.

Since:
4.2
Parameters:
daylast working day of the week (Monday=1..Sunday=7) as integer

Definition at line 500 of file klocale.cpp.

void KLocale::setWorkingWeekStartDay ( int  day)

Changes how KLocale defines the first working day in week.

Since:
4.2
Parameters:
dayfirst working day of the week (Monday=1..Sunday=7) as integer

Definition at line 495 of file klocale.cpp.

void KLocale::splitLocale ( const QString &  locale,
QString &  language,
QString &  country,
QString &  modifier,
QString &  charset 
)
static

Parses locale string into distinct parts.

The format of locale is langu.nosp@m.age_.nosp@m.COUNT.nosp@m.RY@m.nosp@m.odifi.nosp@m.er.C.nosp@m.HARSE.nosp@m.T

Parameters:
localethe locale string to split
languageset to the language part of the locale
countryset to the country part of the locale
modifierset to the modifer part of the locale
charsetset to the charset part of the locale

Definition at line 105 of file klocale.cpp.

QString KLocale::thousandsSeparator ( ) const

Returns what the thousands separator should look like ("," or "." etc.) according to the current locale or user settings.

Returns:
The thousands separator used by locale.

Definition at line 257 of file klocale.cpp.

QString KLocale::timeFormat ( ) const

Returns the currently selected time format.

Returns:
Current time format.
See also:
setTimeFormat()

Definition at line 520 of file klocale.cpp.

QString KLocale::translateQt ( const char *  context,
const char *  sourceText,
const char *  comment 
) const

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 QString())

Definition at line 197 of file klocale.cpp.

void KLocale::translateRaw ( const char *  msg,
QString *  lang,
QString *  trans 
) const

Like translateRawFrom, with implicit lookup through all loaded catalogs.

Deprecated:
Use translateRawFrom with null or empty catalog name.

Definition at line 163 of file klocale.cpp.

void KLocale::translateRaw ( const char *  ctxt,
const char *  msg,
QString *  lang,
QString *  trans 
) const

Like translateRawFrom, with implicit lookup through all loaded catalogs.

Deprecated:
Use translateRawFrom with null or empty catalog name.

Definition at line 174 of file klocale.cpp.

void KLocale::translateRaw ( const char *  singular,
const char *  plural,
unsigned long  n,
QString *  lang,
QString *  trans 
) const

Like translateRawFrom, with implicit lookup through all loaded catalogs.

Deprecated:
Use translateRawFrom with null or empty catalog name.

Definition at line 185 of file klocale.cpp.

void KLocale::translateRaw ( const char *  ctxt,
const char *  singular,
const char *  plural,
unsigned long  n,
QString *  lang,
QString *  trans 
) const

Like translateRawFrom, with implicit lookup through all loaded catalogs.

Deprecated:
Use translateRawFrom with null or empty catalog name.

Definition at line 191 of file klocale.cpp.

void KLocale::translateRawFrom ( const char *  catname,
const char *  msg,
QString *  lang,
QString *  trans 
) const
Since:
4.5

Raw translation from a message catalog. If catalog name is null or empty, all loaded catalogs are searched for the translation.

Never use this directly to get message translations. See the i18n and ki18n family of calls related to KLocalizedString.

Parameters:
catnamethe catalog name. Must be UTF-8 encoded.
msgthe message. Must not be null or empty. Must be UTF-8 encoded.
langlanguage in which the translation was found. If no translation was found, KLocale::defaultLanguage() is reported. If null, the language is not reported.
transraw translation, or original if not found. If no translation was found, original message is reported. If null, the translation is not reported.
See also:
KLocalizedString

Definition at line 158 of file klocale.cpp.

void KLocale::translateRawFrom ( const char *  catname,
const char *  ctxt,
const char *  msg,
QString *  lang,
QString *  trans 
) const
Since:
4.5

Raw translation from a message catalog, with given context. Context + message are used as the lookup key in the catalog. If catalog name is null or empty, all loaded catalogs are searched for the translation.

Never use this directly to get message translations. See i18n* and ki18n* calls related to KLocalizedString.

Parameters:
catnamethe catalog name. Must be UTF-8 encoded.
ctxtthe context. Must not be null. Must be UTF-8 encoded.
msgthe message. Must not be null or empty. Must be UTF-8 encoded.
langlanguage in which the translation was found. If no translation was found, KLocale::defaultLanguage() is reported. If null, the language is not reported.
transraw translation, or original if not found. If no translation was found, original message is reported. If null, the translation is not reported.
See also:
KLocalizedString

Definition at line 168 of file klocale.cpp.

void KLocale::translateRawFrom ( const char *  catname,
const char *  singular,
const char *  plural,
unsigned long  n,
QString *  lang,
QString *  trans 
) const
Since:
4.5

Raw translation from a message catalog, with given singular/plural form. Singular form is used as the lookup key in the catalog. If catalog name is null or empty, all loaded catalogs are searched for the translation.

Never use this directly to get message translations. See i18n* and ki18n* calls related to KLocalizedString.

Parameters:
catnamethe catalog name. Must be UTF-8 encoded.
singularthe singular form. Must not be null or empty. Must be UTF-8 encoded.
pluralthe plural form. Must not be null. Must be UTF-8 encoded.
nnumber on which the forms are decided.
langlanguage in which the translation was found. If no translation was found, KLocale::defaultLanguage() is reported. If null, the language is not reported.
transraw 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.
See also:
KLocalizedString

Definition at line 179 of file klocale.cpp.

void KLocale::translateRawFrom ( const char *  catname,
const char *  ctxt,
const char *  singular,
const char *  plural,
unsigned long  n,
QString *  lang,
QString *  trans 
) const
Since:
4.5

Raw translation from a message catalog, with given context and singular/plural form. Context + singular form is used as the lookup key in the catalog. If catalog name is null or empty, all loaded catalogs are searched for the translation.

Never use this directly to get message translations. See i18n* and ki18n* calls related to KLocalizedString.

Parameters:
catnamethe catalog name. Must be UTF-8 encoded.
ctxtthe context. Must not be null. Must be UTF-8 encoded.
singularthe singular form. Must not be null or empty. Must be UTF-8 encoded.
pluralthe plural form. Must not be null. Must be UTF-8 encoded.
nnumber on which the forms are decided.
langlanguage in which the translation was found. If no translation was found, KLocale::defaultLanguage() is reported. If null, the language is not reported.
transraw 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.
See also:
KLocalizedString

Definition at line 151 of file klocale.cpp.

bool KLocale::use12Clock ( ) const

Use this to determine if the user wants a 12 hour clock.

Returns:
If the user wants 12h clock

Definition at line 429 of file klocale.cpp.

bool KLocale::useTranscript ( ) const

Reports whether evaluation of translation scripts is enabled.

Returns:
true if script evaluation is enabled, false otherwise.

Definition at line 630 of file klocale.cpp.

int KLocale::weekDayOfPray ( ) const

Use this to determine which day is reserved for religious observance.

Since:
4.2
Returns:
day number (None = 0, Monday = 1, ..., Sunday = 7)

Definition at line 242 of file klocale.cpp.

KLocale::WeekNumberSystem KLocale::weekNumberSystem ( )
Since:
4.6

Returns the type of Week Number System used in this Locale

See also:
Klocale::WeekNumberSystem
setWeekNumberSystem()
Returns:
the Week Number System used

Definition at line 715 of file klocale.cpp.

KLocale::WeekNumberSystem KLocale::weekNumberSystem ( ) const
Since:
4.7

Returns the type of Week Number System used in this Locale

See also:
Klocale::WeekNumberSystem
setWeekNumberSystem()
Returns:
the Week Number System used

Definition at line 720 of file klocale.cpp.

int KLocale::weekStartDay ( ) const

Use this to determine which day is the first day of the week.

Returns:
an integer (Monday=1..Sunday=7)

Definition at line 227 of file klocale.cpp.

int KLocale::workingWeekEndDay ( ) const

Use this to determine which day is the last working day of the week.

Since:
4.2
Returns:
an integer (Monday=1..Sunday=7)

Definition at line 237 of file klocale.cpp.

int KLocale::workingWeekStartDay ( ) const

Use this to determine which day is the first working day of the week.

Since:
4.2
Returns:
an integer (Monday=1..Sunday=7)

Definition at line 232 of file klocale.cpp.


The documentation for this class was generated from the following files:
  • klocale.h
  • klocale.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 21:56:59 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal