tdelocale.cpp
61 TQValueList<KCatalogue> catalogues; // list of all loaded catalogs, contains one instance per catalog name and language
111 // todo: adapt current catalog list: remove unused languages, insert main catalogs, if not already found
137 if (mainCatalogue.contains("desktop") == 0 || mainCatalogue.contains("kdesktop") == 1) { //don't bother if we're looking up desktop translations
422 d->languageList.prepend( language ); // let us consider this language to be the most important one
432 return true; // Maybe the mo-files for this language are empty, but in principle we can speak all languages
440 // 2) duplicate entries like in de:fr:de, where we have to keep the first occurrance of a language in order
442 // 3) languages into which the application is not translated. For those languages we should not even load tdelibs.mo or tdeio.po.
673 // now iterate over all languages and all wanted catalog names and append or create them in the right order
674 // the sequence must be e.g. nds/appname nds/tdelibs nds/tdeio de/appname de/tdelibs de/tdeio etc.
675 // and not nds/appname de/appname nds/tdelibs de/tdelibs etc. Otherwise we would be in trouble with a language
687 initPluralTypes(); // evaluate the plural type for all languages and remember this in each KCatalogue
698 updateCatalogues(); // walk through the KCatalogue instances and weed out everything we no longer need
734 if ( useDefaultLanguage() ) { // shortcut evaluation if en_US is main language: do not consult the catalogs
758 *pluralType = (*it).pluralType(); // remember the plural type information from the catalog that was used
806 kdError() << "translation of \"" << singular << "\" doesn't contain " << x << " different plural forms as expected\n"; \
1454 // e.g. 12,,345,,678,,922 Acceptable positions (from the end) are 5, 10, 15... i.e. (3+thlen)*N
1468 if (lastpos>0 && major.length()-lastpos!=3) // Must have exactly 3 digits after the last separator
1552 // e.g. 12,,345,,678,,922 Acceptable positions (from the end) are 5, 10, 15... i.e. (3+thlen)*N
1565 if (lastpos>0 && major.length()-lastpos!=3) // Must have exactly 3 digits after the last separator
1606 TQString fmt = ((flags & ShortFormat) ? dateFormatShort() : dateFormat()).simplifyWhiteSpace();
virtual bool setYMD(TQDate &date, int y, int m, int d) const =0
Changes the date's year, month and day.
bool weekStartsMonday() const TDE_DEPRECATED
Definition: tdelocale.cpp:1024
TDEConfig * config() const
Returns the general config object ("appnamerc").
Definition: kinstance.cpp:212
void setFracDigits(int digits)
Changes the number of digits used when formating numbers.
Definition: tdelocale.cpp:2205
void setWeekStartDay(int day)
Changes how TDELocale defines the first day in week.
Definition: tdelocale.cpp:2129
TQString timeFormat() const
Returns the currently selected time format.
Definition: tdelocale.cpp:2150
Helper class to facilitate working with TDEConfig / TDESimpleConfig groups.
Definition: tdeconfigbase.h:2082
static TDEStandardDirs * dirs()
Returns the application standard dirs object.
Definition: tdeglobal.cpp:58
bool nounDeclension() const
Use this to determine whether nouns are declined in locale's language.
Definition: tdelocale.cpp:1006
static TQString langLookup(const TQString &fname, const char *rtype="html")
Finds localized resource in resourceDir( rtype ) + <lang> + fname.
Definition: tdelocale.cpp:2019
void setMeasureSystem(MeasureSystem value)
Changes the preferred measuring system.
Definition: tdelocale.cpp:2249
void setMonetaryDecimalSymbol(const TQString &symbol)
Changes the symbol used to identify the decimal pointer for monetary values.
Definition: tdelocale.cpp:2218
virtual int yearStringToInteger(const TQString &sNum, int &iLength) const
Converts a year literal of a part of a string into a integer starting at the beginning of the string.
Definition: kcalendarsystem.cpp:114
static TQString defaultCountry()
Returns the name of the default country.
Definition: tdelocale.cpp:2260
void setActiveCatalogue(const TQString &catalog)
Sets the active catalog for translation lookup.
Definition: tdelocale.cpp:702
void setWeekStartsMonday(bool start) TDE_DEPRECATED
Definition: tdelocale.cpp:2120
void setMonetaryThousandsSeparator(const TQString &separator)
Changes the separator used to group digits when formating monetary values.
Definition: tdelocale.cpp:2211
void setCalendar(const TQString &calendarType)
Changes the current calendar system to the calendar specified.
Definition: tdelocale.cpp:2390
TQDate readDate(const TQString &str, bool *ok=0) const
Converts a localized date string to a TQDate.
Definition: tdelocale.cpp:1596
TQString dateFormatShort() const
Returns the currently selected short date format.
Definition: tdelocale.cpp:2144
void setPositiveMonetarySignPosition(SignPosition signpos)
Changes the sign position used for positive monetary values.
Definition: tdelocale.cpp:2181
void setNegativeMonetarySignPosition(SignPosition signpos)
Changes the sign position used for negative monetary values.
Definition: tdelocale.cpp:2187
TQString translateQt(const char *context, const char *sourceText, const char *message) const
Translates a message as a QTranslator is supposed to.
Definition: tdelocale.cpp:962
TQString monetaryThousandsSeparator() const
Returns what a thousands separator for monetary values should look like ("," or " " etc....
Definition: tdelocale.cpp:1054
double readNumber(const TQString &numStr, bool *ok=0) const
Converts a localized numeric string to a double.
Definition: tdelocale.cpp:1417
void setTimeFormat(const TQString &format)
Changes the current time format.
Definition: tdelocale.cpp:2114
void setPositivePrefixCurrencySymbol(bool prefix)
Changes the position where the currency symbol should be printed for positive monetary values.
Definition: tdelocale.cpp:2193
TQString translate(const char *index) const
Translates the string into the corresponding string in the national language, if available.
Definition: tdelocale.cpp:768
virtual int monthStringToInteger(const TQString &sNum, int &iLength) const
Converts a month literal of a part of a string into a integer starting at the beginning of the string...
Definition: kcalendarsystem.cpp:109
void setPositiveSign(const TQString &sign)
Changes the sign used to identify a positive number.
Definition: tdelocale.cpp:2169
static void splitLocale(const TQString &str, TQString &language, TQString &country, TQString &charset)
Returns the parts of the parameter str understood as language setting the format is language_COUNTRY....
Definition: tdelocale.cpp:520
SignPosition negativeMonetarySignPosition() const
Denotes where to place a negative sign in relation to a monetary value.
Definition: tdelocale.cpp:1096
virtual int dayStringToInteger(const TQString &sNum, int &iLength) const
Converts a day literal of a part of a string into a integer starting at the beginning of the string.
Definition: kcalendarsystem.cpp:104
const KCalendarSystem * calendar() const
Returns a pointer to the calendar system object.
Definition: tdelocale.cpp:2407
TQString formatLong(long num) const
Given an integer, converts that to a numeric string containing the localized numeric equivalent.
Definition: tdelocale.cpp:1202
void setPageSize(int paperFormat)
Changes the preferred page size when printing.
Definition: tdelocale.cpp:2236
TQString formatMoney(double num, const TQString ¤cy=TQString::null, int digits=-1) const
Given a double, converts that to a numeric string containing the localized monetary equivalent.
Definition: tdelocale.cpp:1129
TQString weekDayName(int i, bool shortName=false) const TDE_DEPRECATED
Definition: tdelocale.cpp:639
TQString negativeSign() const
Returns what a negative sign should look like ("-", etc.) according to the current locale or user set...
Definition: tdelocale.cpp:1066
void setNegativePrefixCurrencySymbol(bool prefix)
Changes the position where the currency symbol should be printed for negative monetary values.
Definition: tdelocale.cpp:2199
void insertCatalogue(const TQString &catalog)
Adds another catalog to search for translation lookup.
Definition: tdelocale.cpp:644
void setThousandsSeparator(const TQString &separator)
Changes the separator used to group digits when formating numbers.
Definition: tdelocale.cpp:2162
CalendarSystem abstract class, default derived kde gregorian class and factory class.
Definition: kcalendarsystem.h:42
static void setMainCatalogue(const char *catalog)
Use this as main catalog for all TDELocales, if not the appname will be used.
Definition: tdelocale.cpp:1412
virtual int month(const TQDate &date) const =0
Gets specific calendar type month for a given gregorian date.
void setDateFormatShort(const TQString &format)
Changes the current short date format.
Definition: tdelocale.cpp:2102
TQTime readTime(const TQString &str, bool *ok=0) const
Converts a localized time string to a TQTime.
Definition: tdelocale.cpp:1741
const char * translate(const char *msgid) const
Retrieves a translation of the specified message id.
Definition: kcatalogue.cpp:144
TQString calendarType() const
Returns the name of the calendar system that is currently being used by the system.
Definition: tdelocale.cpp:2400
TQString monthNamePossessive(int i, bool shortName=false) const TDE_DEPRECATED
Definition: tdelocale.cpp:601
void setDateMonthNamePossessive(bool possessive)
Changes the form of month name used in dates.
Definition: tdelocale.cpp:2108
TQStringList resourceDirs(const char *type) const
This function is used internally by almost all other function as it serves and fills the directories ...
Definition: tdestandarddirs.cpp:795
void removeCatalogue(const TQString &catalog)
Removes a catalog for translation lookup.
Definition: tdelocale.cpp:693
TQStringList allCountriesTwoAlpha() const
Returns list of all known country codes.
Definition: tdelocale.cpp:2369
TDELocale(const TQString &catalog, TDEConfig *config=0)
Constructs a TDELocale with the given catalog name.
Definition: tdelocale.cpp:83
TQStringList languageList() const
Returns the languages selected by user.
Definition: tdelocale.cpp:1962
TQStringList findAllResources(const char *type, const TQString &filter=TQString::null, bool recursive=false, bool unique=false) const
Tries to find all resources with the specified type.
Definition: tdestandarddirs.cpp:679
static KCalendarSystem * create(const TQString &calType=TQString::fromLatin1("gregorian"), const TDELocale *locale=0)
Gets specific calendar type number of days in previous month for a given date.
Definition: kcalendarsystemfactory.cpp:43
int fracDigits() const
The number of fractional digits to include in numeric/monetary values (usually 2).
Definition: tdelocale.cpp:1072
bool use12Clock() const
Use this to determine if the user wants a 12 hour clock.
Definition: tdelocale.cpp:1948
static TQString defaultLanguage()
Returns the name of the internal language.
Definition: tdelocale.cpp:2255
TDELocale provides support for country specific stuff like the national language.
Definition: tdelocale.h:123
TQString positiveSign() const
Returns what a positive sign should look like ("+", " ", etc.) according to the current locale or use...
Definition: tdelocale.cpp:1060
MeasureSystem
The Metric system will give you information in mm, while the Imperial system will give you informatio...
Definition: tdelocale.h:1011
double readMoney(const TQString &numStr, bool *ok=0) const
Converts a localized monetary string to a double.
Definition: tdelocale.cpp:1482
bool hasKey(const TQString &key) const
Checks whether the key has an entry in the currently active group.
Definition: tdeconfigbase.cpp:109
TQString dateFormat() const
Returns the currently selected date format.
Definition: tdelocale.cpp:2138
MeasureSystem measureSystem() const
Returns which measuring system we use.
Definition: tdelocale.cpp:2243
virtual TQString weekDayName(int weekDay, bool shortName=false) const =0
Gets specific calendar type week day name If an invalid week day is specified, TQString::null is retu...
Definition: kcalendarsystem.cpp:119
SignPosition positiveMonetarySignPosition() const
Returns the position of a positive sign in relation to a monetary value.
Definition: tdelocale.cpp:1090
void setCurrencySymbol(const TQString &symbol)
Changes the current currency symbol.
Definition: tdelocale.cpp:2224
TQString monthName(int i, bool shortName=false) const TDE_DEPRECATED
Definition: tdelocale.cpp:563
bool positivePrefixCurrencySymbol() const
If and only if the currency symbol precedes a positive value, this will be true.
Definition: tdelocale.cpp:1078
TQString decimalSymbol() const
Returns what a decimal point should look like ("." or "," etc.) according to the current locale or us...
Definition: tdelocale.cpp:1030
virtual TQString monthName(int month, int year, bool shortName=false) const =0
Gets specific calendar type month name for a given month number If an invalid month is specified,...
void setNegativeSign(const TQString &sign)
Changes the sign used to identify a negative number.
Definition: tdelocale.cpp:2175
TQString thousandsSeparator() const
Returns what the thousands separator should look like ("," or "." etc.) according to the current loca...
Definition: tdelocale.cpp:1036
SignPosition
Various positions for where to place the positive or negative sign when they are related to a monetar...
Definition: tdelocale.h:266
TQString formatDateTime(const TQDateTime &pDateTime, bool shortFormat=true, bool includeSecs=false) const
Returns a string formated to the current locale's conventions regarding both date and time.
Definition: tdelocale.cpp:1967
TQString twoAlphaToCountryName(const TQString &code) const
Convert a country code to a human readable form.
Definition: tdelocale.cpp:2383
bool setCharset(const TQString &charset) TDE_DEPRECATED
Definition: tdelocale.cpp:2457
TQString country() const
Returns the country code of the country where the user lives.
Definition: tdelocale.cpp:558
TQString currencySymbol() const
Returns what the symbol denoting currency in the current locale as as defined by user settings should...
Definition: tdelocale.cpp:1042
TQTextCodec * codecForEncoding() const
Returns the user's preferred encoding.
Definition: tdelocale.cpp:2294
TQString formatNumber(double num, int precision=-1) const
Given a double, converts that to a numeric string containing the localized numeric equivalent.
Definition: tdelocale.cpp:1195
void setDecimalSymbol(const TQString &symbol)
Changes the symbol used to identify the decimal pointer.
Definition: tdelocale.cpp:2156
TQString formatTime(const TQTime &pTime, bool includeSecs, bool isDuration) const
Returns a string formatted to the current locale's conventions regarding times.
Definition: tdelocale.cpp:1862
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: tdeconfigbase.cpp:79
int readListEntry(const TQString &pKey, TQStrList &list, char sep=',') const
Reads a list of strings.
Definition: tdeconfigbase.cpp:467
bool negativePrefixCurrencySymbol() const
If and only if the currency symbol precedes a negative value, this will be true.
Definition: tdelocale.cpp:1084
void setDateFormat(const TQString &format)
Changes the current date format.
Definition: tdelocale.cpp:2096
TQString monetaryDecimalSymbol() const
Returns what a decimal point should look like ("." or "," etc.) for monetary values,...
Definition: tdelocale.cpp:1048
virtual TQString monthNamePossessive(int month, int year, bool shortName=false) const =0
Returns a string containing the possessive form of the month name.
TQString twoAlphaToLanguageName(const TQString &code) const
Convert a ISO 639-1 code to a human readable form.
Definition: tdelocale.cpp:2356
bool dateMonthNamePossessive() const
Use this to determine whether in dates a possessive form of month name is preferred ("of January" rat...
Definition: tdelocale.cpp:1012
int weekStartDay() const
Use this to determine which day is the first day of the week.
Definition: tdelocale.cpp:1018
TQString formatDate(const TQDate &pDate, bool shortFormat=false) const
Returns a string formatted to the current locale's conventions regarding dates.
Definition: tdelocale.cpp:1337
TQStringList allLanguagesTwoAlpha() const
Returns list of all known ISO 639-1 codes.
Definition: tdelocale.cpp:2348
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: tdeconfigbase.cpp:221
TQStringList languagesTwoAlpha() const
Returns the preferred languages as ISO 639-1 codes.
Definition: tdelocale.cpp:2308
bool setLanguage(const TQString &language)
Changes the current language.
Definition: tdelocale.cpp:417
virtual int year(const TQDate &date) const =0
Gets specific calendar type year for a given gregorian date.