tdelocale.cpp
62 TQValueList<KCatalogue> catalogues; // list of all loaded catalogs, contains one instance per catalog name and language
112 // todo: adapt current catalog list: remove unused languages, insert main catalogs, if not already found
138 if (mainCatalogue.contains("desktop") == 0 || mainCatalogue.contains("kdesktop") == 1) { //don't bother if we're looking up desktop translations
423 d->languageList.prepend( language ); // let us consider this language to be the most important one
433 return true; // Maybe the mo-files for this language are empty, but in principle we can speak all languages
441 // 2) duplicate entries like in de:fr:de, where we have to keep the first occurrance of a language in order
443 // 3) languages into which the application is not translated. For those languages we should not even load tdelibs.mo or tdeio.po.
674 // now iterate over all languages and all wanted catalog names and append or create them in the right order
675 // the sequence must be e.g. nds/appname nds/tdelibs nds/tdeio de/appname de/tdelibs de/tdeio etc.
676 // and not nds/appname de/appname nds/tdelibs de/tdelibs etc. Otherwise we would be in trouble with a language
688 initPluralTypes(); // evaluate the plural type for all languages and remember this in each KCatalogue
699 updateCatalogues(); // walk through the KCatalogue instances and weed out everything we no longer need
735 if ( useDefaultLanguage() ) { // shortcut evaluation if en_US is main language: do not consult the catalogs
759 *pluralType = (*it).pluralType(); // remember the plural type information from the catalog that was used
807 kdError() << "translation of \"" << singular << "\" doesn't contain " << x << " different plural forms as expected\n"; \
1455 // e.g. 12,,345,,678,,922 Acceptable positions (from the end) are 5, 10, 15... i.e. (3+thlen)*N
1469 if (lastpos>0 && major.length()-lastpos!=3) // Must have exactly 3 digits after the last separator
1553 // e.g. 12,,345,,678,,922 Acceptable positions (from the end) are 5, 10, 15... i.e. (3+thlen)*N
1566 if (lastpos>0 && major.length()-lastpos!=3) // Must have exactly 3 digits after the last separator
1607 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.
TDEConfig * config() const
Returns the general config object ("appnamerc").
Definition: kinstance.cpp:210
void setFracDigits(int digits)
Changes the number of digits used when formating numbers.
Definition: tdelocale.cpp:2216
void setWeekStartDay(int day)
Changes how TDELocale defines the first day in week.
Definition: tdelocale.cpp:2140
TQString timeFormat() const
Returns the currently selected time format.
Definition: tdelocale.cpp:2161
Helper class to facilitate working with TDEConfig / KSimpleConfig groups.
Definition: tdeconfigbase.h:2082
TQString monthName(int i, bool shortName=false) const KDE_DEPRECATED
Definition: tdelocale.cpp:564
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:1007
static TQString langLookup(const TQString &fname, const char *rtype="html")
Finds localized resource in resourceDir( rtype ) + <lang> + fname.
Definition: tdelocale.cpp:2020
void setMeasureSystem(MeasureSystem value)
Changes the preferred measuring system.
Definition: tdelocale.cpp:2260
void setMonetaryDecimalSymbol(const TQString &symbol)
Changes the symbol used to identify the decimal pointer for monetary values.
Definition: tdelocale.cpp:2229
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:2271
void setActiveCatalogue(const TQString &catalog)
Sets the active catalog for translation lookup.
Definition: tdelocale.cpp:703
void setMonetaryThousandsSeparator(const TQString &separator)
Changes the separator used to group digits when formating monetary values.
Definition: tdelocale.cpp:2222
void setCalendar(const TQString &calendarType)
Changes the current calendar system to the calendar specified.
Definition: tdelocale.cpp:2401
TQDate readDate(const TQString &str, bool *ok=0) const
Converts a localized date string to a TQDate.
Definition: tdelocale.cpp:1597
TQString dateFormatShort() const
Returns the currently selected short date format.
Definition: tdelocale.cpp:2155
void setPositiveMonetarySignPosition(SignPosition signpos)
Changes the sign position used for positive monetary values.
Definition: tdelocale.cpp:2192
void setNegativeMonetarySignPosition(SignPosition signpos)
Changes the sign position used for negative monetary values.
Definition: tdelocale.cpp:2198
TQString translateQt(const char *context, const char *sourceText, const char *message) const
Translates a message as a QTranslator is supposed to.
Definition: tdelocale.cpp:963
TQString monetaryThousandsSeparator() const
Returns what a thousands separator for monetary values should look like ("," or " " etc....
Definition: tdelocale.cpp:1055
double readNumber(const TQString &numStr, bool *ok=0) const
Converts a localized numeric string to a double.
Definition: tdelocale.cpp:1418
void setTimeFormat(const TQString &format)
Changes the current time format.
Definition: tdelocale.cpp:2125
void setPositivePrefixCurrencySymbol(bool prefix)
Changes the position where the currency symbol should be printed for positive monetary values.
Definition: tdelocale.cpp:2204
TQString translate(const char *index) const
Translates the string into the corresponding string in the national language, if available.
Definition: tdelocale.cpp:769
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:2180
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:521
SignPosition negativeMonetarySignPosition() const
Denotes where to place a negative sign in relation to a monetary value.
Definition: tdelocale.cpp:1097
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:2418
TQString formatLong(long num) const
Given an integer, converts that to a numeric string containing the localized numeric equivalent.
Definition: tdelocale.cpp:1203
bool setCharset(const TQString &charset) KDE_DEPRECATED
Definition: tdelocale.cpp:2468
void setWeekStartsMonday(bool start) KDE_DEPRECATED
Definition: tdelocale.cpp:2131
void setPageSize(int paperFormat)
Changes the preferred page size when printing.
Definition: tdelocale.cpp:2247
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:1130
TQString negativeSign() const
Returns what a negative sign should look like ("-", etc.) according to the current locale or user set...
Definition: tdelocale.cpp:1067
void setNegativePrefixCurrencySymbol(bool prefix)
Changes the position where the currency symbol should be printed for negative monetary values.
Definition: tdelocale.cpp:2210
void insertCatalogue(const TQString &catalog)
Adds another catalog to search for translation lookup.
Definition: tdelocale.cpp:645
void setThousandsSeparator(const TQString &separator)
Changes the separator used to group digits when formating numbers.
Definition: tdelocale.cpp:2173
TQString weekDayName(int i, bool shortName=false) const KDE_DEPRECATED
Definition: tdelocale.cpp:640
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:1413
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:2113
TQTime readTime(const TQString &str, bool *ok=0) const
Converts a localized time string to a TQTime.
Definition: tdelocale.cpp:1742
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:2411
void setDateMonthNamePossessive(bool possessive)
Changes the form of month name used in dates.
Definition: tdelocale.cpp:2119
TQStringList resourceDirs(const char *type) const
This function is used internally by almost all other function as it serves and fills the directories ...
Definition: kstandarddirs.cpp:795
void removeCatalogue(const TQString &catalog)
Removes a catalog for translation lookup.
Definition: tdelocale.cpp:694
TQStringList allCountriesTwoAlpha() const
Returns list of all known country codes.
Definition: tdelocale.cpp:2380
TDELocale(const TQString &catalog, TDEConfig *config=0)
Constructs a TDELocale with the given catalog name.
Definition: tdelocale.cpp:84
TQStringList languageList() const
Returns the languages selected by user.
Definition: tdelocale.cpp:1963
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: kstandarddirs.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:1073
bool use12Clock() const
Use this to determine if the user wants a 12 hour clock.
Definition: tdelocale.cpp:1949
static TQString defaultLanguage()
Returns the name of the internal language.
Definition: tdelocale.cpp:2266
TDELocale provides support for country specific stuff like the national language.
Definition: tdelocale.h:124
TQString positiveSign() const
Returns what a positive sign should look like ("+", " ", etc.) according to the current locale or use...
Definition: tdelocale.cpp:1061
MeasureSystem
The Metric system will give you information in mm, while the Imperial system will give you informatio...
Definition: tdelocale.h:1012
double readMoney(const TQString &numStr, bool *ok=0) const
Converts a localized monetary string to a double.
Definition: tdelocale.cpp:1483
bool hasKey(const TQString &key) const
Checks whether the key has an entry in the currently active group.
Definition: tdeconfigbase.cpp:110
TQString dateFormat() const
Returns the currently selected date format.
Definition: tdelocale.cpp:2149
MeasureSystem measureSystem() const
Returns which measuring system we use.
Definition: tdelocale.cpp:2254
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:1091
void setCurrencySymbol(const TQString &symbol)
Changes the current currency symbol.
Definition: tdelocale.cpp:2235
bool positivePrefixCurrencySymbol() const
If and only if the currency symbol precedes a positive value, this will be true.
Definition: tdelocale.cpp:1079
TQString decimalSymbol() const
Returns what a decimal point should look like ("." or "," etc.) according to the current locale or us...
Definition: tdelocale.cpp:1031
bool weekStartsMonday() const KDE_DEPRECATED
Definition: tdelocale.cpp:1025
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:2186
TQString thousandsSeparator() const
Returns what the thousands separator should look like ("," or "." etc.) according to the current loca...
Definition: tdelocale.cpp:1037
SignPosition
Various positions for where to place the positive or negative sign when they are related to a monetar...
Definition: tdelocale.h:267
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:1968
TQString twoAlphaToCountryName(const TQString &code) const
Convert a country code to a human readable form.
Definition: tdelocale.cpp:2394
TQString country() const
Returns the country code of the country where the user lives.
Definition: tdelocale.cpp:559
TQString monthNamePossessive(int i, bool shortName=false) const KDE_DEPRECATED
Definition: tdelocale.cpp:602
TQString currencySymbol() const
Returns what the symbol denoting currency in the current locale as as defined by user settings should...
Definition: tdelocale.cpp:1043
TQTextCodec * codecForEncoding() const
Returns the user's preferred encoding.
Definition: tdelocale.cpp:2305
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:1196
void setDecimalSymbol(const TQString &symbol)
Changes the symbol used to identify the decimal pointer.
Definition: tdelocale.cpp:2167
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:1863
void setGroup(const TQString &group)
Specifies the group in which keys will be read and written.
Definition: tdeconfigbase.cpp:80
int readListEntry(const TQString &pKey, TQStrList &list, char sep=',') const
Reads a list of strings.
Definition: tdeconfigbase.cpp:490
bool negativePrefixCurrencySymbol() const
If and only if the currency symbol precedes a negative value, this will be true.
Definition: tdelocale.cpp:1085
void setDateFormat(const TQString &format)
Changes the current date format.
Definition: tdelocale.cpp:2107
TQString monetaryDecimalSymbol() const
Returns what a decimal point should look like ("." or "," etc.) for monetary values,...
Definition: tdelocale.cpp:1049
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:2367
bool dateMonthNamePossessive() const
Use this to determine whether in dates a possessive form of month name is preferred ("of January" rat...
Definition: tdelocale.cpp:1013
int weekStartDay() const
Use this to determine which day is the first day of the week.
Definition: tdelocale.cpp:1019
TQString formatDate(const TQDate &pDate, bool shortFormat=false) const
Returns a string formatted to the current locale's conventions regarding dates.
Definition: tdelocale.cpp:1338
TQStringList allLanguagesTwoAlpha() const
Returns list of all known ISO 639-1 codes.
Definition: tdelocale.cpp:2359
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:222
TQStringList languagesTwoAlpha() const
Returns the preferred languages as ISO 639-1 codes.
Definition: tdelocale.cpp:2319
bool setLanguage(const TQString &language)
Changes the current language.
Definition: tdelocale.cpp:418
virtual int year(const TQDate &date) const =0
Gets specific calendar type year for a given gregorian date.
Trinity API Reference