.TH "KLocale" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KLocale \- KLocale provides support for country specific stuff like the national language. class for supporting locale settings and national language.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <klocale.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBSignPosition\fP { \fBParensAround\fP =  0, \fBBeforeQuantityMoney\fP =  1, \fBAfterQuantityMoney\fP =  2, \fBBeforeMoney\fP =  3, \fBAfterMoney\fP =  4 }"
.br
.RI "\fIVarious positions for where to place the positive or negative sign when they are related to a monetary value. \fP"
.ti -1c
.RI "enum \fBMeasureSystem\fP { \fBMetric\fP, \fBImperial\fP }"
.br
.RI "\fIThe Metric system will give you information in mm, while the Imperial system will give you information in inches. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKLocale\fP (const  \fBQString\fP &catalogue, \fBKConfig\fP *config=0)"
.br
.RI "\fIConstructs a KLocale with the given catalogue name. \fP"
.ti -1c
.RI "\fBKLocale\fP (const  \fBKLocale\fP &rhs)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "\fBKLocale\fP & \fBoperator=\fP (const  \fBKLocale\fP &rhs)"
.br
.RI "\fIAssignment operator. \fP"
.ti -1c
.RI "\fB~KLocale\fP ()"
.br
.RI "\fIDestructor. \fP"
.ti -1c
.RI "\fBQString\fP \fBtranslate\fP (const  char *index) const "
.br
.RI "\fITranslates the string into the corresponding string in the national language, if available. \fP"
.ti -1c
.RI "\fBQString\fP \fBtranslate\fP (const  char *index, const  char *fallback) const "
.br
.RI "\fITranslates the string into the corresponding string in the national language, if available. \fP"
.ti -1c
.RI "\fBQString\fP \fBtranslate\fP (const  char *singular, const  char *plural, unsigned long n) const "
.br
.RI "\fIUsed to get the correct, translated singular or plural of a word. \fP"
.ti -1c
.RI "bool \fBsetCharset\fP (const  \fBQString\fP &charset)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Changes the current charset used for fonts. \fP"
.ti -1c
.RI "bool \fBsetEncoding\fP (int mibEnum)"
.br
.RI "\fIChanges the current encoding. \fP"
.ti -1c
.RI "bool \fBsetLanguage\fP (const  \fBQString\fP &language)"
.br
.RI "\fIChanges the current language. \fP"
.ti -1c
.RI "bool \fBsetLanguage\fP (const  \fBQStringList\fP &languages)"
.br
.RI "\fIChanges the list of prefed languages for the locale. \fP"
.ti -1c
.RI "bool \fBsetCountry\fP (const  \fBQString\fP &country)"
.br
.RI "\fIChanges the current country. \fP"
.ti -1c
.RI "\fBQString\fP \fBdecimalSymbol\fP () const "
.br
.RI "\fIReturns what a decimal point should look like ('.' or ',' etc.) according to the current locale or user settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBthousandsSeparator\fP () const "
.br
.RI "\fIReturns what the thousands separator should look like (',' or '.' etc.) according to the current locale or user settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBcurrencySymbol\fP () const "
.br
.RI "\fIReturns what the symbol denoting currency in the current locale as as defined by user settings should look like. \fP"
.ti -1c
.RI "\fBQString\fP \fBmonetaryDecimalSymbol\fP () const "
.br
.RI "\fIReturns what a decimal point should look like ('.' or ',' etc.) for monetary values, according to the current locale or user settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBmonetaryThousandsSeparator\fP () const "
.br
.RI "\fIReturns what a thousands separator for monetary values should look like (',' or ' ' etc.) according to the current locale or user settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBpositiveSign\fP () const "
.br
.RI "\fIReturns what a positive sign should look like ('+', ' ', etc.) according to the current locale or user settings. \fP"
.ti -1c
.RI "\fBQString\fP \fBnegativeSign\fP () const "
.br
.RI "\fIReturns what a negative sign should look like ('-', etc.) according to the current locale or user settings. \fP"
.ti -1c
.RI "int \fBfracDigits\fP () const "
.br
.RI "\fIThe number of fractional digits to include in numeric/monetary values (usually 2). \fP"
.ti -1c
.RI "bool \fBpositivePrefixCurrencySymbol\fP () const "
.br
.RI "\fIIf and only if the currency symbol precedes a positive value, this will be true. \fP"
.ti -1c
.RI "bool \fBnegativePrefixCurrencySymbol\fP () const "
.br
.RI "\fIIf and only if the currency symbol precedes a negative value, this will be true. \fP"
.ti -1c
.RI "\fBSignPosition\fP \fBpositiveMonetarySignPosition\fP () const "
.br
.RI "\fIReturns the position of a positive sign in relation to a monetary value. \fP"
.ti -1c
.RI "\fBSignPosition\fP \fBnegativeMonetarySignPosition\fP () const "
.br
.RI "\fIDenotes where to place a negative sign in relation to a monetary value. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatMoney\fP (double num, const  \fBQString\fP &currency=QString::null, int digits=-1) const "
.br
.RI "\fIGiven a double, converts that to a numeric string containing the localized monetary equivalent. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatMoney\fP (const  \fBQString\fP &numStr) const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP This function differs from the above only in that it can take a \fBQString\fP as the argument for convenience. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatNumber\fP (double num, int precision=-1) const "
.br
.RI "\fIGiven a double, converts that to a numeric string containing the localized numeric equivalent. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatNumber\fP (const  \fBQString\fP &numStr) const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP This function differs from the above only in that it can take a \fBQString\fP as the argument for convenience. \fP"
.ti -1c
.RI "bool \fBnounDeclension\fP () const "
.br
.RI "\fIUse this to determine whether nouns are declined in locale's language. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatDate\fP (const  \fBQDate\fP &pDate, bool shortFormat=false) const "
.br
.RI "\fIReturns a string formatted to the current locale's conventions regarding dates. \fP"
.ti -1c
.RI "bool \fBdateMonthNamePossessive\fP () const "
.br
.RI "\fIUse this to determine whether in dates a possessive form of month name is preferred ('of January' rather than 'January'). \fP"
.ti -1c
.RI "\fBQString\fP \fBformatTime\fP (const  \fBQTime\fP &pTime, bool includeSecs=false) const "
.br
.RI "\fIReturns a string formatted to the current locale's conventions regarding times. \fP"
.ti -1c
.RI "bool \fBuse12Clock\fP () const "
.br
.RI "\fIUse this to determine if the user wants a 12 hour clock. \fP"
.ti -1c
.RI "bool \fBweekStartsMonday\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fP"
.ti -1c
.RI "int \fBweekStartDay\fP () const "
.br
.RI "\fIUse this to determine which day is the first day of the week. \fP"
.ti -1c
.RI "\fBQString\fP \fBmonthName\fP (int i, bool shortName=false) const "
.br
.RI "\fIReturns a string containing the name of the month name. \fP"
.ti -1c
.RI "\fBQString\fP \fBmonthNamePossessive\fP (int i, bool shortName=false) const "
.br
.RI "\fIReturns a string containing the possessive form of the month name. \fP"
.ti -1c
.RI "\fBQString\fP \fBweekDayName\fP (int i, bool shortName=false) const "
.br
.RI "\fIReturns a string containing the name of the week day. \fP"
.ti -1c
.RI "\fBQString\fP \fBformatDateTime\fP (const  \fBQDateTime\fP &pDateTime, bool shortFormat=true, bool includeSecs=false) const "
.br
.RI "\fIReturns a string formated to the current locale's conventions regarding both date and time. \fP"
.ti -1c
.RI "double \fBreadMoney\fP (const  \fBQString\fP &numStr, bool *ok=0) const "
.br
.RI "\fIConverts a localized monetary string to a double. \fP"
.ti -1c
.RI "double \fBreadNumber\fP (const  \fBQString\fP &numStr, bool *ok=0) const "
.br
.RI "\fIConverts a localized numeric string to a double. \fP"
.ti -1c
.RI "\fBQDate\fP \fBreadDate\fP (const  \fBQString\fP &str, bool *ok=0) const "
.br
.RI "\fIConverts a localized date string to a \fBQDate\fP. \fP"
.ti -1c
.RI "\fBQDate\fP \fBreadDate\fP (const  \fBQString\fP &intstr, const  \fBQString\fP &fmt, bool *ok=0) const "
.br
.RI "\fIConverts a localized date string to a \fBQDate\fP, using the specified format. \fP"
.ti -1c
.RI "\fBQTime\fP \fBreadTime\fP (const  \fBQString\fP &str, bool *ok=0) const "
.br
.RI "\fIConverts a localized time string to a \fBQTime\fP. \fP"
.ti -1c
.RI "\fBQString\fP \fBlanguage\fP () const "
.br
.RI "\fIReturns the language used by this object. \fP"
.ti -1c
.RI "\fBQString\fP \fBcountry\fP () const "
.br
.RI "\fIReturns the country code of the country where the user lives. \fP"
.ti -1c
.RI "\fBQString\fP \fBlanguages\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Returns the languages selected by user. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBlanguagesTwoAlpha\fP () const "
.br
.RI "\fIReturns the preferred languages as ISO 639-1 codes. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBlanguageList\fP () const "
.br
.RI "\fIReturns the languages selected by user. \fP"
.ti -1c
.RI "\fBQString\fP \fBcharset\fP () const "
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP Returns the charset name by selected locale. \fP"
.ti -1c
.RI "const  char * \fBencoding\fP () const "
.br
.RI "\fIReturns the user's preferred encoding. \fP"
.ti -1c
.RI "int \fBencodingMib\fP () const "
.br
.RI "\fIReturns the user's preferred encoding. \fP"
.ti -1c
.RI "\fBQTextCodec\fP * \fBcodecForEncoding\fP () const "
.br
.RI "\fIReturns the user's preferred encoding. \fP"
.ti -1c
.RI "void \fBsetDateFormat\fP (const  \fBQString\fP &format)"
.br
.RI "\fIChanges the current date format. \fP"
.ti -1c
.RI "void \fBsetDateFormatShort\fP (const  \fBQString\fP &format)"
.br
.RI "\fIChanges the current short date format. \fP"
.ti -1c
.RI "void \fBsetDateMonthNamePossessive\fP (bool possessive)"
.br
.RI "\fIChanges the form of month name used in dates. \fP"
.ti -1c
.RI "void \fBsetTimeFormat\fP (const  \fBQString\fP &format)"
.br
.RI "\fIChanges the current time format. \fP"
.ti -1c
.RI "void \fBsetWeekStartsMonday\fP (bool start)"
.br
.RI "\fI\fBThis class or method is obsolete, it is provided for compatibility only.\fP \fP"
.ti -1c
.RI "void \fBsetWeekStartDay\fP (int day)"
.br
.RI "\fIChanges how KLocale defines the first day in week. \fP"
.ti -1c
.RI "\fBQString\fP \fBdateFormat\fP () const "
.br
.RI "\fIReturns the currently selected date format. \fP"
.ti -1c
.RI "\fBQString\fP \fBdateFormatShort\fP () const "
.br
.RI "\fIReturns the currently selected short date format. \fP"
.ti -1c
.RI "\fBQString\fP \fBtimeFormat\fP () const "
.br
.RI "\fIReturns the currently selected time format. \fP"
.ti -1c
.RI "void \fBsetDecimalSymbol\fP (const  \fBQString\fP &symbol)"
.br
.RI "\fIChanges the symbol used to identify the decimal pointer. \fP"
.ti -1c
.RI "void \fBsetThousandsSeparator\fP (const  \fBQString\fP &separator)"
.br
.RI "\fIChanges the separator used to group digits when formating numbers. \fP"
.ti -1c
.RI "void \fBsetPositiveSign\fP (const  \fBQString\fP &sign)"
.br
.RI "\fIChanges the sign used to identify a positive number. \fP"
.ti -1c
.RI "void \fBsetNegativeSign\fP (const  \fBQString\fP &sign)"
.br
.RI "\fIChanges the sign used to identify a negative number. \fP"
.ti -1c
.RI "void \fBsetPositiveMonetarySignPosition\fP (\fBSignPosition\fP signpos)"
.br
.RI "\fIChanges the sign position used for positive monetary values. \fP"
.ti -1c
.RI "void \fBsetNegativeMonetarySignPosition\fP (\fBSignPosition\fP signpos)"
.br
.RI "\fIChanges the sign position used for negative monetary values. \fP"
.ti -1c
.RI "void \fBsetPositivePrefixCurrencySymbol\fP (bool prefix)"
.br
.RI "\fIChanges the position where the currency symbol should be printed for positive monetary values. \fP"
.ti -1c
.RI "void \fBsetNegativePrefixCurrencySymbol\fP (bool prefix)"
.br
.RI "\fIChanges the position where the currency symbol should be printed for negative monetary values. \fP"
.ti -1c
.RI "void \fBsetFracDigits\fP (int digits)"
.br
.RI "\fIChanges the number of digits used when formating numbers. \fP"
.ti -1c
.RI "void \fBsetMonetaryThousandsSeparator\fP (const  \fBQString\fP &separator)"
.br
.RI "\fIChanges the separator used to group digits when formating monetary values. \fP"
.ti -1c
.RI "void \fBsetMonetaryDecimalSymbol\fP (const  \fBQString\fP &symbol)"
.br
.RI "\fIChanges the symbol used to identify the decimal pointer for monetary values. \fP"
.ti -1c
.RI "void \fBsetCurrencySymbol\fP (const  \fBQString\fP &symbol)"
.br
.RI "\fIChanges the current currency symbol. \fP"
.ti -1c
.RI "int \fBpageSize\fP () const "
.br
.RI "\fIReturns the preferred page size for printing. \fP"
.ti -1c
.RI "void \fBsetPageSize\fP (int paperFormat)"
.br
.RI "\fIChanges the preferred page size when printing. \fP"
.ti -1c
.RI "\fBMeasureSystem\fP \fBmeasureSystem\fP () const "
.br
.RI "\fIReturns which measuring system we use. \fP"
.ti -1c
.RI "void \fBsetMeasureSystem\fP (\fBMeasureSystem\fP value)"
.br
.RI "\fIChanges the preferred measuring system. \fP"
.ti -1c
.RI "void \fBinsertCatalogue\fP (const  \fBQString\fP &catalogue)"
.br
.RI "\fIAdds another catalogue to search for translation lookup. \fP"
.ti -1c
.RI "void \fBremoveCatalogue\fP (const  \fBQString\fP &catalogue)"
.br
.RI "\fIRemoves a catalog for translation lookup. \fP"
.ti -1c
.RI "void \fBsetActiveCatalogue\fP (const  \fBQString\fP &catalogue)"
.br
.RI "\fISets the active catalog for translation lookup. \fP"
.ti -1c
.RI "\fBQString\fP \fBtranslateQt\fP (const  char *context, const  char *sourceText, const  char *message) const "
.br
.RI "\fITranslates a message as a \fBQTranslator\fP is supposed to. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBallLanguagesTwoAlpha\fP () const "
.br
.RI "\fIReturns list of all known ISO 639-1 codes. \fP"
.ti -1c
.RI "\fBQString\fP \fBtwoAlphaToLanguageName\fP (const  \fBQString\fP &code) const "
.br
.RI "\fIConvert a ISO 639-1 code to a human readable form. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBallCountriesTwoAlpha\fP () const "
.br
.RI "\fIReturns list of all known country codes. \fP"
.ti -1c
.RI "\fBQString\fP \fBtwoAlphaToCountryName\fP (const  \fBQString\fP &code) const "
.br
.RI "\fIConvert a country code to a human readable form. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "void \fBsplitLocale\fP (const  \fBQString\fP &str, \fBQString\fP &language, \fBQString\fP &country, \fBQString\fP &charset)"
.br
.RI "\fIReturns the parts of the parameter str understood as language setting the format is language_COUNTRY.charset. \fP"
.ti -1c
.RI "void \fBsetMainCatalogue\fP (const  char *catalogue)"
.br
.RI "\fIUse this to as main catalogue for *all* KLocales, if not the appname will be used. \fP"
.ti -1c
.RI "\fBQString\fP \fBlangLookup\fP (const  \fBQString\fP &fname, const  char *rtype='html')"
.br
.RI "\fIFinds localized resource in resourceDir( rtype ) +  + fname. \fP"
.ti -1c
.RI "\fBQString\fP \fBdefaultLanguage\fP ()"
.br
.RI "\fIReturns the name of the internal language. \fP"
.ti -1c
.RI "\fBQString\fP \fBdefaultCountry\fP ()"
.br
.RI "\fIReturns the name of the default country. \fP"
.ti -1c
.RI "\fBQString\fP \fB_initLanguage\fP (\fBKConfigBase\fP *config)"
.br
.in -1c
.SS "Static Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinitInstance\fP ()"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKGlobal\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
KLocale provides support for country specific stuff like the national language. class for supporting locale settings and national language. 

KLocale supports translating, as well as specifying the format for numbers, currency, time, and date.
.PP
\fBAuthor:\fP
.RS 4
Stephan Kulow <coolo@kde.org>, Preston Brown <pbrown@kde.org>, Hans Petter Bieker <bieker@kde.org>, Lukas Tinkl <lukas.tinkl@suse.cz> 
.RE
.PP

.PP
Definition at line 92 of file klocale.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBKLocale::SignPosition\fP"
.PP
Various positions for where to place the positive or negative sign when they are related to a monetary value. Definition at line 246 of file klocale.h.
.PP
Referenced by negativeMonetarySignPosition(), and positiveMonetarySignPosition().
.SS "enum \fBKLocale::MeasureSystem\fP"
.PP
The Metric system will give you information in mm, while the Imperial system will give you information in inches. Definition at line 873 of file klocale.h.
.PP
Referenced by measureSystem().
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KLocale::KLocale (const \fBQString\fP & catalogue, \fBKConfig\fP * config = 0)"
.PP
Constructs a KLocale with the given catalogue name. The constructor looks for an entry Locale/Language in the configuration file. If no config file is specified, it will also look for languages using the environment variables (KDE_LANG, LC_MESSAGES, LC_ALL, LANG), as well as the global configuration fie. If we were not able to use non of the specified languages, the default language (en_US) will be used.
.PP
If you specify a configuration file, it has to be valid until the KLocale object is destroyed.
.PP
\fBParameters:\fP
.RS 4
\fIcatalogue\fP The name of the main language file 
.br
\fIconfig\fP The configuration file to use. 
.RE
.PP
Definition at line 70 of file klocale.cpp.
.PP
References KInstance::config(), KGlobal::instance(), and QString::isEmpty().
.SS "KLocale::KLocale (const \fBKLocale\fP & rhs)"
.PP
Copy constructor. Definition at line 2087 of file klocale.cpp.
.SS "KLocale::~\fBKLocale\fP ()"
.PP
Destructor. Definition at line 600 of file klocale.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBKLocale\fP & KLocale::operator= (const \fBKLocale\fP & rhs)"
.PP
Assignment operator. Definition at line 2094 of file klocale.cpp.
.PP
References d, m_country, m_currencySymbol, m_dateFormat, m_dateFormatShort, m_decimalSymbol, m_fracDigits, m_language, m_monetaryDecimalSymbol, m_monetaryThousandsSeparator, m_negativeMonetarySignPosition, m_negativePrefixCurrencySymbol, m_negativeSign, m_positiveMonetarySignPosition, m_positivePrefixCurrencySymbol, m_positiveSign, m_thousandsSeparator, and m_timeFormat.
.SS "\fBQString\fP KLocale::translate (const char * index) const"
.PP
Translates the string into the corresponding string in the national language, if available. If not, returns the string itself. There is a \fBKDE\fP wide message file that contains the most often used phrases, so we can avoid duplicating the translation of these phrases. If a phrase is not found in the catalogue given to the constructor, it will search in the system catalog. This makes it possible to override some phrases for your needs.
.PP
The argument must be an UTF-8 encoded string (If you only use characters that are in US-ASCII you're on the safe side. But for e.g. german umlauts or french accents should be recoded to UTF-8)
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP The lookup text and default text, if not found. 
.RE
.PP
Definition at line 640 of file klocale.cpp.
.PP
Referenced by formatDateTime(), formatTime(), monthName(), monthNamePossessive(), and weekDayName().
.SS "\fBQString\fP KLocale::translate (const char * index, const char * fallback) const"
.PP
Translates the string into the corresponding string in the national language, if available. The real contents of the string is in the argument fallback, but the meaning of it is coded into the argument index. In some cases you'll need this function, when english is too ambiguous to express it.
.PP
Most of the times the translators will tell you if it can't be translated as it, but think of cases as 'New', where the translations differs depending on what is New. Or simple cases as 'Open', that can be used to express something is open or it can be used to express that you want something to open... There are tons of such examples.
.PP
If translate('Open') is not enough to translate it well, use translate('To Open', 'Open') or translate('Is Open', 'Open'). The english user will see 'Open' in both cases, but the translated version may vary. Of course you can also use i18n()
.PP
\fBParameters:\fP
.RS 4
\fIindex\fP The lookup text 
.br
\fIfallback\fP the default text, if not found 
.RE
.PP
\fBReturns:\fP
.RS 4
translation 
.RE
.PP
Definition at line 645 of file klocale.cpp.
.PP
References QString::fromUtf8().
.SS "\fBQString\fP KLocale::translate (const char * singular, const char * plural, unsigned long n) const"
.PP
Used to get the correct, translated singular or plural of a word. \fBParameters:\fP
.RS 4
\fIsingular\fP the singular form of the word, for example 'file'. 
.br
\fIplural\fP the plural form of the word. Must contain a '%n' that will be replaced by the number 
.br
, for example '%n files' 
.br
\fIn\fP the number 
.RE
.PP
\fBReturns:\fP
.RS 4
the correct singular or plural for the selected language, depending on n 
.RE
.PP
Definition at line 681 of file klocale.cpp.
.PP
References QString::find(), QString::fromUtf8(), QString::isEmpty(), and QStringList::split().
.SS "bool KLocale::setCharset (const \fBQString\fP & charset)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Changes the current charset used for fonts. \fBParameters:\fP
.RS 4
\fIcharset\fP The new charset
.RE
.PP
\fBReturns:\fP
.RS 4
True on success. 
.RE
.PP

.SS "bool KLocale::setEncoding (int mibEnum)"
.PP
Changes the current encoding. \fBParameters:\fP
.RS 4
\fImibEnum\fP The mib of the preferred codec
.RE
.PP
\fBReturns:\fP
.RS 4
True on success. 
.RE
.PP
Definition at line 1999 of file klocale.cpp.
.PP
References QTextCodec::codecForMib().
.SS "bool KLocale::setLanguage (const \fBQString\fP & language)"
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIlanguage\fP The language code.
.RE
.PP
\fBReturns:\fP
.RS 4
True on success. 
.RE
.PP
Definition at line 378 of file klocale.cpp.
.PP
Referenced by setLanguage().
.SS "bool KLocale::setLanguage (const \fBQStringList\fP & languages)"
.PP
Changes the list of prefed languages for the locale. The first valid language in the list will be used, or the default (en_US) language will be used if non of the specified languages were available.
.PP
\fBParameters:\fP
.RS 4
\fIlanguages\fP The list of language codes.
.RE
.PP
\fBReturns:\fP
.RS 4
True if one of the specified languages were used. 
.RE
.PP
Definition at line 392 of file klocale.cpp.
.PP
References defaultLanguage(), languageList(), and setLanguage().
.SS "bool KLocale::setCountry (const \fBQString\fP & country)"
.PP
Changes the current country. The current country will be left unchanged if failed. It will force a reload of the country specific configuration.
.PP
\fBParameters:\fP
.RS 4
\fIcountry\fP The ISO 3166 country code.
.RE
.PP
\fBReturns:\fP
.RS 4
True on success. 
.RE
.PP
Definition at line 335 of file klocale.cpp.
.PP
References QString::isEmpty().
.SS "\fBQString\fP KLocale::decimalSymbol () const"
.PP
Returns what a decimal point should look like ('.' or ',' etc.) according to the current locale or user settings. \fBReturns:\fP
.RS 4
The decimal symbol used by locale. 
.RE
.PP
Definition at line 896 of file klocale.cpp.
.PP
Referenced by formatNumber(), and readNumber().
.SS "\fBQString\fP KLocale::thousandsSeparator () const"
.PP
Returns what the thousands separator should look like (',' or '.' etc.) according to the current locale or user settings. \fBReturns:\fP
.RS 4
The thousands separator used by locale. 
.RE
.PP
Definition at line 902 of file klocale.cpp.
.PP
Referenced by formatNumber(), and readNumber().
.SS "\fBQString\fP KLocale::currencySymbol () const"
.PP
Returns what the symbol denoting currency in the current locale as as defined by user settings should look like. \fBReturns:\fP
.RS 4
The default currency symbol used by locale. 
.RE
.PP
Definition at line 908 of file klocale.cpp.
.PP
Referenced by formatMoney(), and readMoney().
.SS "\fBQString\fP KLocale::monetaryDecimalSymbol () const"
.PP
Returns what a decimal point should look like ('.' or ',' etc.) for monetary values, according to the current locale or user settings. \fBReturns:\fP
.RS 4
The monetary decimal symbol used by locale. 
.RE
.PP
Definition at line 914 of file klocale.cpp.
.PP
Referenced by formatMoney(), and readMoney().
.SS "\fBQString\fP KLocale::monetaryThousandsSeparator () const"
.PP
Returns what a thousands separator for monetary values should look like (',' or ' ' etc.) according to the current locale or user settings. \fBReturns:\fP
.RS 4
The monetary thousands separator used by locale. 
.RE
.PP
Definition at line 920 of file klocale.cpp.
.PP
Referenced by formatMoney(), and readMoney().
.SS "\fBQString\fP KLocale::positiveSign () const"
.PP
Returns what a positive sign should look like ('+', ' ', etc.) according to the current locale or user settings. \fBReturns:\fP
.RS 4
The positive sign used by locale. 
.RE
.PP
Definition at line 926 of file klocale.cpp.
.PP
Referenced by formatMoney(), and formatNumber().
.SS "\fBQString\fP KLocale::negativeSign () const"
.PP
Returns what a negative sign should look like ('-', etc.) according to the current locale or user settings. \fBReturns:\fP
.RS 4
The negative sign used by locale. 
.RE
.PP
Definition at line 932 of file klocale.cpp.
.PP
Referenced by formatMoney(), formatNumber(), readMoney(), and readNumber().
.SS "int KLocale::fracDigits () const"
.PP
The number of fractional digits to include in numeric/monetary values (usually 2). \fBReturns:\fP
.RS 4
Default number of fractional digits used by locale. 
.RE
.PP
Definition at line 938 of file klocale.cpp.
.PP
Referenced by formatMoney().
.SS "bool KLocale::positivePrefixCurrencySymbol () const"
.PP
If and only if the currency symbol precedes a positive value, this will be true. \fBReturns:\fP
.RS 4
Where to print the currency symbol for positive numbers. 
.RE
.PP
Definition at line 944 of file klocale.cpp.
.PP
Referenced by formatMoney().
.SS "bool KLocale::negativePrefixCurrencySymbol () const"
.PP
If and only if the currency symbol precedes a negative value, this will be true. \fBReturns:\fP
.RS 4
True if the currency symbol precedes negative numbers. 
.RE
.PP
Definition at line 950 of file klocale.cpp.
.PP
Referenced by formatMoney().
.SS "\fBKLocale::SignPosition\fP KLocale::positiveMonetarySignPosition () const"
.PP
Returns the position of a positive sign in relation to a monetary value. \fBReturns:\fP
.RS 4
Where/how to print the positive sign. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBSignPosition\fP 
.RE
.PP
Definition at line 956 of file klocale.cpp.
.PP
References SignPosition.
.PP
Referenced by formatMoney().
.SS "\fBKLocale::SignPosition\fP KLocale::negativeMonetarySignPosition () const"
.PP
Denotes where to place a negative sign in relation to a monetary value. \fBReturns:\fP
.RS 4
Where/how to print the negative sign. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBSignPosition\fP 
.RE
.PP
Definition at line 962 of file klocale.cpp.
.PP
References SignPosition.
.PP
Referenced by formatMoney(), and readMoney().
.SS "\fBQString\fP KLocale::formatMoney (double num, const \fBQString\fP & currency = QString::null, int digits = -1) const"
.PP
Given a double, converts that to a numeric string containing the localized monetary equivalent. e.g. given 123456, return '$ 123,456.00'.
.PP
\fBParameters:\fP
.RS 4
\fInum\fP The number we want to format 
.br
\fIcurrency\fP The currency symbol you want. 
.br
\fIdigits\fP Number of fractional digits, or -1 for the default value
.RE
.PP
\fBReturns:\fP
.RS 4
The number of money as a localized string 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBfracDigits()\fP 
.RE
.PP
Definition at line 980 of file klocale.cpp.
.PP
References QString::append(), currencySymbol(), QString::find(), fracDigits(), QString::insert(), QString::isNull(), QString::length(), monetaryDecimalSymbol(), monetaryThousandsSeparator(), negativeMonetarySignPosition(), negativePrefixCurrencySymbol(), negativeSign(), QString::number(), positiveMonetarySignPosition(), positivePrefixCurrencySymbol(), positiveSign(), QString::prepend(), and QString::replace().
.PP
Referenced by formatMoney().
.SS "\fBQString\fP KLocale::formatMoney (const \fBQString\fP & numStr) const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP This function differs from the above only in that it can take a \fBQString\fP as the argument for convenience. \fBParameters:\fP
.RS 4
\fInumStr\fP The string you want to reformat.
.RE
.PP
\fBReturns:\fP
.RS 4
The number of money as a localized string 
.RE
.PP
Definition at line 1041 of file klocale.cpp.
.PP
References formatMoney(), and QString::toDouble().
.SS "\fBQString\fP KLocale::formatNumber (double num, int precision = -1) const"
.PP
Given a double, converts that to a numeric string containing the localized numeric equivalent. e.g. given 123456.78, return '123,456.78' (for some European country). If precision isn't specified, 2 is used.
.PP
\fBParameters:\fP
.RS 4
\fInum\fP The number to convert 
.br
\fIprecision\fP Number of fractional digits used.
.RE
.PP
\fBReturns:\fP
.RS 4
The number as a localized string 
.RE
.PP
Definition at line 1046 of file klocale.cpp.
.PP
References decimalSymbol(), QString::find(), QString::insert(), QString::length(), negativeSign(), QString::number(), positiveSign(), QString::prepend(), QString::replace(), and thousandsSeparator().
.PP
Referenced by formatNumber().
.SS "\fBQString\fP KLocale::formatNumber (const \fBQString\fP & numStr) const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP This function differs from the above only in that it can take a \fBQString\fP as the argument for convenience. \fBParameters:\fP
.RS 4
\fInumStr\fP The string you want to convert.
.RE
.PP
\fBReturns:\fP
.RS 4
The number as a formated string 
.RE
.PP
Definition at line 1064 of file klocale.cpp.
.PP
References formatNumber(), and QString::toDouble().
.SS "bool KLocale::nounDeclension () const"
.PP
Use this to determine whether nouns are declined in locale's language. This property should remain read-only (no setter function)
.PP
\fBReturns:\fP
.RS 4
If nouns are declined 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 872 of file klocale.cpp.
.SS "\fBQString\fP KLocale::formatDate (const \fBQDate\fP & pDate, bool shortFormat = false) const"
.PP
Returns a string formatted to the current locale's conventions regarding dates. \fBParameters:\fP
.RS 4
\fIpDate\fP The date to be formated. 
.br
\fIshortFormat\fP True for non text dates.
.RE
.PP
\fBReturns:\fP
.RS 4
The date as a string 
.RE
.PP
Definition at line 1069 of file klocale.cpp.
.PP
References QString::at(), dateFormat(), dateFormatShort(), QDate::day(), QDate::dayOfWeek(), QString::length(), QDate::month(), monthName(), monthNamePossessive(), weekDayName(), and QDate::year().
.PP
Referenced by formatDateTime().
.SS "bool KLocale::dateMonthNamePossessive () const"
.PP
Use this to determine whether in dates a possessive form of month name is preferred ('of January' rather than 'January'). \fBReturns:\fP
.RS 4
If possessive form should be used 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 878 of file klocale.cpp.
.SS "\fBQString\fP KLocale::formatTime (const \fBQTime\fP & pTime, bool includeSecs = false) const"
.PP
Returns a string formatted to the current locale's conventions regarding times. \fBParameters:\fP
.RS 4
\fIpTime\fP The time to be formated. 
.br
\fIincludeSecs\fP if true, seconds are included in the output, otherwise only hours and minutes are formatted.
.RE
.PP
\fBReturns:\fP
.RS 4
The time as a string 
.RE
.PP
Definition at line 1584 of file klocale.cpp.
.PP
References QString::at(), QTime::hour(), QString::length(), QTime::minute(), QTime::second(), timeFormat(), and translate().
.PP
Referenced by formatDateTime().
.SS "bool KLocale::use12Clock () const"
.PP
Use this to determine if the user wants a 12 hour clock. \fBReturns:\fP
.RS 4
If the user wants 12h clock 
.RE
.PP
Definition at line 1663 of file klocale.cpp.
.PP
References QString::contains(), QString::fromLatin1(), and timeFormat().
.SS "bool KLocale::weekStartsMonday () const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Please use the \fBweekStartDay\fP method instead.
.PP
Use this to determine if the user wants the week to start on Monday.
.PP
\fBReturns:\fP
.RS 4
true if the week starts on Monday 
.RE
.PP
Definition at line 890 of file klocale.cpp.
.SS "int KLocale::weekStartDay () const"
.PP
Use this to determine which day is the first day of the week. \fBReturns:\fP
.RS 4
an integer (Monday=1..Sunday=7) 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 884 of file klocale.cpp.
.SS "\fBQString\fP KLocale::monthName (int i, bool shortName = false) const"
.PP
Returns a string containing the name of the month name. \fBParameters:\fP
.RS 4
\fIi\fP the month number of the year starting at 1/January. 
.br
\fIshortName\fP we will return the short version of the string.
.RE
.PP
\fBReturns:\fP
.RS 4
The name of the month 
.RE
.PP
Definition at line 463 of file klocale.cpp.
.PP
References translate().
.PP
Referenced by formatDate(), and readDate().
.SS "\fBQString\fP KLocale::monthNamePossessive (int i, bool shortName = false) const"
.PP
Returns a string containing the possessive form of the month name. ('of January', 'of February', etc.) It's needed in long format dates in some languages.
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the month number of the year starting at 1/January. 
.br
\fIshortName\fP we will return the short version of the string.
.RE
.PP
\fBReturns:\fP
.RS 4
The possessive form of the name of the month 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 501 of file klocale.cpp.
.PP
References translate().
.PP
Referenced by formatDate(), and readDate().
.SS "\fBQString\fP KLocale::weekDayName (int i, bool shortName = false) const"
.PP
Returns a string containing the name of the week day. \fBParameters:\fP
.RS 4
\fIi\fP the day number of the week starting at 1/Monday. 
.br
\fIshortName\fP we will return the short version of the string.
.RE
.PP
\fBReturns:\fP
.RS 4
The name of the day 
.RE
.PP
Definition at line 539 of file klocale.cpp.
.PP
References translate().
.PP
Referenced by formatDate(), and readDate().
.SS "\fBQString\fP KLocale::formatDateTime (const \fBQDateTime\fP & pDateTime, bool shortFormat = true, bool includeSecs = false) const"
.PP
Returns a string formated to the current locale's conventions regarding both date and time. \fBParameters:\fP
.RS 4
\fIpDateTime\fP The date and time to be formated. 
.br
\fIshortFormat\fP using the short date format. 
.br
\fIincludeSeconds\fP using the short date format.
.RE
.PP
\fBReturns:\fP
.RS 4
The date and time as a string 
.RE
.PP
Definition at line 1682 of file klocale.cpp.
.PP
References QString::arg(), QDateTime::date(), formatDate(), formatTime(), QDateTime::time(), and translate().
.SS "double KLocale::readMoney (const \fBQString\fP & numStr, bool * ok = 0) const"
.PP
Converts a localized monetary string to a double. \fBParameters:\fP
.RS 4
\fInumStr\fP the string we want to convert. 
.br
\fIok\fP the boolean that is set to false if it's not a number. If \fCok\fP is 0, it will be ignored
.RE
.PP
\fBReturns:\fP
.RS 4
The string converted to a double 
.RE
.PP
Definition at line 1217 of file klocale.cpp.
.PP
References currencySymbol(), QString::find(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), monetaryDecimalSymbol(), monetaryThousandsSeparator(), negativeMonetarySignPosition(), negativeSign(), QString::remove(), QString::stripWhiteSpace(), and QString::toDouble().
.SS "double KLocale::readNumber (const \fBQString\fP & numStr, bool * ok = 0) const"
.PP
Converts a localized numeric string to a double. \fBParameters:\fP
.RS 4
\fInumStr\fP the string we want to convert. 
.br
\fIok\fP the boolean that is set to false if it's not a number. If \fCok\fP is 0, it will be ignored
.RE
.PP
\fBReturns:\fP
.RS 4
The string converted to a double 
.RE
.PP
Definition at line 1152 of file klocale.cpp.
.PP
References decimalSymbol(), QString::find(), QString::left(), QString::length(), QString::mid(), negativeSign(), QString::remove(), QString::stripWhiteSpace(), thousandsSeparator(), and QString::toDouble().
.SS "\fBQDate\fP KLocale::readDate (const \fBQString\fP & str, bool * ok = 0) const"
.PP
Converts a localized date string to a \fBQDate\fP. The bool pointed by ok will be invalid if the date entered was not valid.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string we want to convert. 
.br
\fIok\fP the boolean that is set to false if it's not a valid date. If \fCok\fP is 0, it will be ignored
.RE
.PP
\fBReturns:\fP
.RS 4
The string converted to a \fBQDate\fP 
.RE
.PP
Definition at line 1331 of file klocale.cpp.
.PP
References QDate::isValid().
.SS "\fBQDate\fP KLocale::readDate (const \fBQString\fP & intstr, const \fBQString\fP & fmt, bool * ok = 0) const"
.PP
Converts a localized date string to a \fBQDate\fP, using the specified format. You will usually not want to use this method. Definition at line 1345 of file klocale.cpp.
.PP
References QString::at(), QDate::currentDate(), QChar::isSpace(), QString::length(), QString::lower(), QString::mid(), monthName(), monthNamePossessive(), QString::simplifyWhiteSpace(), and weekDayName().
.SS "\fBQTime\fP KLocale::readTime (const \fBQString\fP & str, bool * ok = 0) const"
.PP
Converts a localized time string to a \fBQTime\fP. The bool pointed by ok will be false if the time entered was not valid.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string we want to convert. 
.br
\fIok\fP the boolean that is set to false if it's not a valid time. If \fCok\fP is 0, it will be ignored
.RE
.PP
\fBReturns:\fP
.RS 4
The string converted to a \fBQTime\fP 
.RE
.PP
Definition at line 1471 of file klocale.cpp.
.PP
References QTime::isValid().
.SS "\fBQString\fP KLocale::language () const"
.PP
Returns the language used by this object. The domain AND the library translation must be available in this language. 'en_US' is default, if no other available.
.PP
\fBReturns:\fP
.RS 4
The currently used language. 
.RE
.PP
Definition at line 453 of file klocale.cpp.
.PP
Referenced by KConfigBase::setLocale().
.SS "\fBQString\fP KLocale::country () const"
.PP
Returns the country code of the country where the user lives. 'C' is default, if no other available
.PP
\fBReturns:\fP
.RS 4
The country code for the user. 
.RE
.PP
Definition at line 458 of file klocale.cpp.
.SS "\fBQString\fP KLocale::languages () const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Returns the languages selected by user. \fBReturns:\fP
.RS 4
String containing language codes separated by colons 
.RE
.PP
Definition at line 1672 of file klocale.cpp.
.PP
References QString::fromLatin1().
.SS "\fBQStringList\fP KLocale::languagesTwoAlpha () const"
.PP
Returns the preferred languages as ISO 639-1 codes. This means that information about country is removed. If the internal language code might be represented by more than one 639-1 code, they will all be listed (but only once).
.PP
If the selected languages are 'nn, nb, pt_BR', you will get: 'nn, no, nb, pt'.
.PP
\fBReturns:\fP
.RS 4
List of language codes
.RE
.PP
\fBSee also:\fP
.RS 4
\fBlanguageList\fP 
.RE
.PP
Definition at line 2008 of file klocale.cpp.
.PP
References QString::find(), QString::fromLatin1(), KConfigBase::hasKey(), languageList(), KConfigBase::readListEntry(), KConfigBase::setGroup(), and QString::truncate().
.SS "\fBQStringList\fP KLocale::languageList () const"
.PP
Returns the languages selected by user. The codes returned here is the internal language codes.
.PP
\fBReturns:\fP
.RS 4
List of language codes
.RE
.PP
\fBSee also:\fP
.RS 4
\fBlanguagesTwoAlpha\fP 
.RE
.PP
Definition at line 1677 of file klocale.cpp.
.PP
Referenced by langLookup(), languagesTwoAlpha(), and setLanguage().
.SS "\fBQString\fP KLocale::charset () const"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Returns the charset name by selected locale. This will be the charset defined in the config file. NOTE: This is no longer the same as encoding. 'iso-8859-1' is default
.PP
\fBReturns:\fP
.RS 4
Name of the preferred charset for fonts
.RE
.PP
\fBSee also:\fP
.RS 4
\fBencoding\fP 
.RE
.PP

.SS "const  char * KLocale::encoding () const"
.PP
Returns the user's preferred encoding. \fBReturns:\fP
.RS 4
The name of the preferred encoding
.RE
.PP
\fBSee also:\fP
.RS 4
\fBcodecForEncoding\fP 
.PP
\fBencodingMib\fP 
.RE
.PP
Definition at line 1984 of file klocale.cpp.
.PP
References codecForEncoding(), and QTextCodec::name().
.SS "int KLocale::encodingMib () const"
.PP
Returns the user's preferred encoding. \fBReturns:\fP
.RS 4
The Mib of the preferred encoding
.RE
.PP
\fBSee also:\fP
.RS 4
\fBencoding\fP 
.PP
\fBcodecForEncoding\fP 
.RE
.PP
Definition at line 1989 of file klocale.cpp.
.PP
References codecForEncoding(), and QTextCodec::mibEnum().
.SS "\fBQTextCodec\fP * KLocale::codecForEncoding () const"
.PP
Returns the user's preferred encoding. Should never be NULL.
.PP
\fBReturns:\fP
.RS 4
The codec for the preferred encoding
.RE
.PP
\fBSee also:\fP
.RS 4
\fBencoding\fP 
.PP
\fBencodingMib\fP 
.RE
.PP
Definition at line 1994 of file klocale.cpp.
.PP
Referenced by KCharsets::codecForName(), encoding(), and encodingMib().
.SS "void KLocale::setDateFormat (const \fBQString\fP & format)"
.PP
Changes the current date format. The format of the date is a string which contains variables that will be replaced: 
.IP "\(bu" 2
Y with the century (e.g. '19' for '1984') 
.IP "\(bu" 2
y with the lower 2 digits of the year (e.g. '84' for '1984') 
.IP "\(bu" 2
n with the month (January='1', December='12') 
.IP "\(bu" 2
m with the month with two digits (January='01', December='12') 
.IP "\(bu" 2
e with the day of the month (e.g. '1' on the first of march) 
.IP "\(bu" 2
d with the day of the month with two digits(e.g. '01' on the first of march) 
.IP "\(bu" 2
b with the short form of the month (e.g. 'Jan' for January) 
.IP "\(bu" 2
a with the short form of the weekday (e.g. 'Wed' for Wednesday) 
.IP "\(bu" 2
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'.
.PP
\fBParameters:\fP
.RS 4
\fIformat\fP The new date format 
.RE
.PP
Definition at line 1815 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setDateFormatShort (const \fBQString\fP & format)"
.PP
Changes the current short date format. The format of the date is a string which contains variables that will be replaced: 
.IP "\(bu" 2
Y with the century (e.g. '19' for '1984') 
.IP "\(bu" 2
y with the lower 2 digits of the year (e.g. '84' for '1984') 
.IP "\(bu" 2
n with the month (January='1', December='12') 
.IP "\(bu" 2
m with the month with two digits (January='01', December='12') 
.IP "\(bu" 2
e with the day of the month (e.g. '1' on the first of march) 
.IP "\(bu" 2
d with the day of the month with two digits(e.g. '01' on the first of march) 
.IP "\(bu" 2
b with the short form of the month (e.g. 'Jan' for January) 
.IP "\(bu" 2
a with the short form of the weekday (e.g. 'Wed' for Wednesday) 
.IP "\(bu" 2
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'.
.PP
\fBParameters:\fP
.RS 4
\fIformat\fP The new short date format 
.RE
.PP
Definition at line 1821 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setDateMonthNamePossessive (bool possessive)"
.PP
Changes the form of month name used in dates. \fBParameters:\fP
.RS 4
\fIpossessive\fP True if possessive forms should be used 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1827 of file klocale.cpp.
.SS "void KLocale::setTimeFormat (const \fBQString\fP & format)"
.PP
Changes the current time format. The format of the time is string a which contains variables that will be replaced: 
.IP "\(bu" 2
H with the hour in 24h format and 2 digits (e.g. 5pm is '17', 5am is '05') 
.IP "\(bu" 2
k with the hour in 24h format and one digits (e.g. 5pm is '17', 5am is '5') 
.IP "\(bu" 2
I with the hour in 12h format and 2 digits (e.g. 5pm is '05', 5am is '05') 
.IP "\(bu" 2
l with the hour in 12h format and one digits (e.g. 5pm is '5', 5am is '5') 
.IP "\(bu" 2
M with the minute with 2 digits (e.g. the minute of 07:02:09 is '02') 
.IP "\(bu" 2
S with the seconds with 2 digits (e.g. the minute of 07:02:09 is '09') 
.IP "\(bu" 2
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'.
.PP
\fBParameters:\fP
.RS 4
\fIformat\fP The new time format 
.RE
.PP
Definition at line 1833 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setWeekStartsMonday (bool start)"
.PP
\fBThis class or method is obsolete, it is provided for compatibility only.\fP Please use \fBsetWeekStartDay\fP instead.
.PP
Changes how KLocale defines the first day in week.
.PP
\fBParameters:\fP
.RS 4
\fIstart\fP True if Monday is the first day in the week 
.RE
.PP
Definition at line 1839 of file klocale.cpp.
.SS "void KLocale::setWeekStartDay (int day)"
.PP
Changes how KLocale defines the first day in week. \fBParameters:\fP
.RS 4
\fIday\fP first day of the week (Monday=1..Sunday=7) as integer 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 1848 of file klocale.cpp.
.SS "\fBQString\fP KLocale::dateFormat () const"
.PP
Returns the currently selected date format. \fBReturns:\fP
.RS 4
Current date format. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetDateFormat()\fP 
.RE
.PP
Definition at line 1857 of file klocale.cpp.
.PP
Referenced by formatDate().
.SS "\fBQString\fP KLocale::dateFormatShort () const"
.PP
Returns the currently selected short date format. \fBReturns:\fP
.RS 4
Current short date format. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetDateFormatShort()\fP 
.RE
.PP
Definition at line 1863 of file klocale.cpp.
.PP
Referenced by formatDate().
.SS "\fBQString\fP KLocale::timeFormat () const"
.PP
Returns the currently selected time format. \fBReturns:\fP
.RS 4
Current time format. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetTimeFormat()\fP 
.RE
.PP
Definition at line 1869 of file klocale.cpp.
.PP
Referenced by formatTime(), and use12Clock().
.SS "void KLocale::setDecimalSymbol (const \fBQString\fP & symbol)"
.PP
Changes the symbol used to identify the decimal pointer. \fBParameters:\fP
.RS 4
\fIsymbol\fP The new decimal symbol. 
.RE
.PP
Definition at line 1875 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setThousandsSeparator (const \fBQString\fP & separator)"
.PP
Changes the separator used to group digits when formating numbers. \fBParameters:\fP
.RS 4
\fIseparator\fP The new thousands separator. 
.RE
.PP
Definition at line 1881 of file klocale.cpp.
.SS "void KLocale::setPositiveSign (const \fBQString\fP & sign)"
.PP
Changes the sign used to identify a positive number. Normally this is left blank.
.PP
\fBParameters:\fP
.RS 4
\fIsign\fP Sign used for positive numbers. 
.RE
.PP
Definition at line 1888 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setNegativeSign (const \fBQString\fP & sign)"
.PP
Changes the sign used to identify a negative number. \fBParameters:\fP
.RS 4
\fIsign\fP Sign used for negative numbers. 
.RE
.PP
Definition at line 1894 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setPositiveMonetarySignPosition (\fBSignPosition\fP signpos)"
.PP
Changes the sign position used for positive monetary values. \fBParameters:\fP
.RS 4
\fIsignpos\fP The new sign position 
.RE
.PP
Definition at line 1900 of file klocale.cpp.
.SS "void KLocale::setNegativeMonetarySignPosition (\fBSignPosition\fP signpos)"
.PP
Changes the sign position used for negative monetary values. \fBParameters:\fP
.RS 4
\fIsignpos\fP The new sign position 
.RE
.PP
Definition at line 1906 of file klocale.cpp.
.SS "void KLocale::setPositivePrefixCurrencySymbol (bool prefix)"
.PP
Changes the position where the currency symbol should be printed for positive monetary values. \fBParameters:\fP
.RS 4
\fIprefix\fP True if the currency symbol should be prefixed instead of postfixed 
.RE
.PP
Definition at line 1912 of file klocale.cpp.
.SS "void KLocale::setNegativePrefixCurrencySymbol (bool prefix)"
.PP
Changes the position where the currency symbol should be printed for negative monetary values. \fBParameters:\fP
.RS 4
\fIprefix\fP True if the currency symbol should be prefixed instead of postfixed 
.RE
.PP
Definition at line 1918 of file klocale.cpp.
.SS "void KLocale::setFracDigits (int digits)"
.PP
Changes the number of digits used when formating numbers. \fBParameters:\fP
.RS 4
\fIdigits\fP The default number of digits to use. 
.RE
.PP
Definition at line 1924 of file klocale.cpp.
.SS "void KLocale::setMonetaryThousandsSeparator (const \fBQString\fP & separator)"
.PP
Changes the separator used to group digits when formating monetary values. \fBParameters:\fP
.RS 4
\fIseparator\fP The new thousands separator. 
.RE
.PP
Definition at line 1930 of file klocale.cpp.
.SS "void KLocale::setMonetaryDecimalSymbol (const \fBQString\fP & symbol)"
.PP
Changes the symbol used to identify the decimal pointer for monetary values. \fBParameters:\fP
.RS 4
\fIsymbol\fP The new decimal symbol. 
.RE
.PP
Definition at line 1937 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "void KLocale::setCurrencySymbol (const \fBQString\fP & symbol)"
.PP
Changes the current currency symbol. \fBParameters:\fP
.RS 4
\fIsymbol\fP The new currency symbol 
.RE
.PP
Definition at line 1943 of file klocale.cpp.
.PP
References QString::stripWhiteSpace().
.SS "int KLocale::pageSize () const"
.PP
Returns the preferred page size for printing. \fBReturns:\fP
.RS 4
The preferred page size, cast it to QPrinter::PageSize 
.RE
.PP
Definition at line 1949 of file klocale.cpp.
.SS "void KLocale::setPageSize (int paperFormat)"
.PP
Changes the preferred page size when printing. \fBParameters:\fP
.RS 4
\fIThe\fP new preferred page size in the format QPrinter::PageSize 
.RE
.PP
Definition at line 1955 of file klocale.cpp.
.SS "\fBKLocale::MeasureSystem\fP KLocale::measureSystem () const"
.PP
Returns which measuring system we use. \fBReturns:\fP
.RS 4
The preferred measuring system 
.RE
.PP
Definition at line 1962 of file klocale.cpp.
.PP
References MeasureSystem.
.SS "void KLocale::setMeasureSystem (\fBMeasureSystem\fP value)"
.PP
Changes the preferred measuring system. \fBReturns:\fP
.RS 4
value The preferred measuring system 
.RE
.PP
Definition at line 1968 of file klocale.cpp.
.SS "void KLocale::insertCatalogue (const \fBQString\fP & catalogue)"
.PP
Adds another catalogue to search for translation lookup. This function is useful for extern libraries and/or code, that provides its own messages.
.PP
If the catalogue does not exist for the chosen language, it will be ignored and en_US will be used.
.PP
\fBParameters:\fP
.RS 4
\fIcatalogue\fP The catalogue to add. 
.RE
.PP
Definition at line 567 of file klocale.cpp.
.SS "void KLocale::removeCatalogue (const \fBQString\fP & catalogue)"
.PP
Removes a catalog for translation lookup. \fBParameters:\fP
.RS 4
\fIcatalogue\fP The catalogue to remove. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBinsertCatalogue()\fP 
.RE
.PP
Definition at line 576 of file klocale.cpp.
.SS "void KLocale::setActiveCatalogue (const \fBQString\fP & catalogue)"
.PP
Sets the active catalog for translation lookup. \fBParameters:\fP
.RS 4
\fIcatalogue\fP The catalogue to activate. 
.RE
.PP
Definition at line 587 of file klocale.cpp.
.PP
References KStdAction::save().
.PP
Referenced by KGlobal::setActiveInstance().
.SS "\fBQString\fP KLocale::translateQt (const char * context, const char * sourceText, const char * message) const"
.PP
Translates a message as a \fBQTranslator\fP is supposed to. The parameters are similar to i18n(), but the result value has other semantics (it can be QString::null) 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 828 of file klocale.cpp.
.SS "\fBQStringList\fP KLocale::allLanguagesTwoAlpha () const"
.PP
Returns list of all known ISO 639-1 codes. \fBReturns:\fP
.RS 4
a list of all language codes 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2048 of file klocale.cpp.
.SS "\fBQString\fP KLocale::twoAlphaToLanguageName (const \fBQString\fP & code) const"
.PP
Convert a ISO 639-1 code to a human readable form. \fBParameters:\fP
.RS 4
\fIcode\fP the language ISO 639-1 code 
.RE
.PP
\fBReturns:\fP
.RS 4
the human readable form 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2056 of file klocale.cpp.
.PP
References QString::lower().
.SS "\fBQStringList\fP KLocale::allCountriesTwoAlpha () const"
.PP
Returns list of all known country codes. \fBReturns:\fP
.RS 4
a list of all country codes 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2065 of file klocale.cpp.
.PP
References KGlobal::dirs(), and KStandardDirs::findAllResources().
.SS "\fBQString\fP KLocale::twoAlphaToCountryName (const \fBQString\fP & code) const"
.PP
Convert a country code to a human readable form. \fBParameters:\fP
.RS 4
\fIcode\fP the country code 
.RE
.PP
\fBReturns:\fP
.RS 4
the human readable form of the country name 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 2079 of file klocale.cpp.
.PP
References QString::lower(), KConfigBase::readEntry(), and KConfigBase::setGroup().
.SS "void KLocale::splitLocale (const \fBQString\fP & str, \fBQString\fP & language, \fBQString\fP & country, \fBQString\fP & charset)\fC [static]\fP"
.PP
Returns the parts of the parameter str understood as language setting the format is language_COUNTRY.charset. \fBParameters:\fP
.RS 4
\fIstr\fP The string to split. 
.br
\fIlanguage\fP This will be set to the language part of the string. 
.br
\fIcountry\fP This will be set to the country part of the string. 
.br
\fIcharset\fP This will be set to the charset part of the string. 
.RE
.PP
Definition at line 420 of file klocale.cpp.
.PP
References QString::find(), QString::mid(), and QString::truncate().
.SS "void KLocale::setMainCatalogue (const char * catalogue)\fC [static]\fP"
.PP
Use this to as main catalogue 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 (and this is in common \fBKDE\fP applications quite early).
.PP
\fBParameters:\fP
.RS 4
\fIcatalogue\fP Catalogue to override all other main catalogues. 
.RE
.PP
Definition at line 1147 of file klocale.cpp.
.SS "\fBQString\fP KLocale::langLookup (const \fBQString\fP & fname, const char * rtype = 'html')\fC [static]\fP"
.PP
Finds localized resource in resourceDir( rtype ) +  + fname. \fBParameters:\fP
.RS 4
\fIfname\fP relative path to find 
.br
\fIrtype\fP resource type to use 
.RE
.PP
Definition at line 1734 of file klocale.cpp.
.PP
References defaultLanguage(), KGlobal::dirs(), QFileInfo::exists(), QFileInfo::isFile(), QFileInfo::isReadable(), languageList(), KGlobal::locale(), and KStandardDirs::resourceDirs().
.SS "\fBQString\fP KLocale::defaultLanguage ()\fC [static]\fP"
.PP
Returns the name of the internal language. \fBReturns:\fP
.RS 4
Name of the default language 
.RE
.PP
Definition at line 1974 of file klocale.cpp.
.PP
References QString::fromLatin1().
.PP
Referenced by langLookup(), setLanguage(), and KConfigBase::setLocale().
.SS "\fBQString\fP KLocale::defaultCountry ()\fC [static]\fP"
.PP
Returns the name of the default country. \fBReturns:\fP
.RS 4
Name of the default country 
.RE
.PP
Definition at line 1979 of file klocale.cpp.
.PP
References QString::fromLatin1().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
