File indexing completed on 2024-04-28 07:43:03
0001 /* This file is part of the KDE libraries 0002 SPDX-FileCopyrightText: 2006, 2013 Chusslove Illich <caslav.ilic@gmx.net> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #ifndef KLOCALIZEDSTRING_H 0007 #define KLOCALIZEDSTRING_H 0008 0009 #include <ki18n_export.h> 0010 0011 #include <QChar> 0012 #include <QLatin1Char> 0013 #include <QSet> 0014 #include <QString> 0015 #include <QStringList> 0016 0017 #include <memory> 0018 0019 #include <kuitsetup.h> 0020 0021 // enforce header to be parsed before redefining i18n* with preprocessor macros 0022 // depending on TRANSLATION_DOMAIN (see bottom of file) 0023 #include <klocalizedcontext.h> 0024 0025 class KLocalizedStringPrivate; 0026 class KLazyLocalizedString; 0027 0028 /** 0029 * \file klocalizedstring.h 0030 */ 0031 0032 /** 0033 * @class KLocalizedString klocalizedstring.h <KLocalizedString> 0034 * 0035 * \short Class for producing and handling localized messages 0036 * 0037 * \c KLocalizedString handles translation and 0038 * argument substitution and formatting of user-visible text. 0039 * 0040 * \c KLocalizedString instances are usually not constructed directly, 0041 * but through one of the wrapper \c \*i18n\* calls. 0042 * 0043 * For detailed information on how to use KI18n functions please refer 0044 * to \ref prg_guide. 0045 */ 0046 class KI18N_EXPORT KLocalizedString 0047 { 0048 friend class KLocalizedStringPrivate; 0049 friend class KLazyLocalizedString; 0050 0051 friend KLocalizedString KI18N_EXPORT ki18n(const char *text); 0052 friend KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text); 0053 friend KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural); 0054 friend KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural); 0055 friend KLocalizedString KI18N_EXPORT ki18nd(const char *domain, const char *text); 0056 friend KLocalizedString KI18N_EXPORT ki18ndc(const char *domain, const char *context, const char *text); 0057 friend KLocalizedString KI18N_EXPORT ki18ndp(const char *domain, const char *singular, const char *plural); 0058 friend KLocalizedString KI18N_EXPORT ki18ndcp(const char *domain, const char *context, const char *singular, const char *plural); 0059 0060 friend KLocalizedString KI18N_EXPORT kxi18n(const char *text); 0061 friend KLocalizedString KI18N_EXPORT kxi18nc(const char *context, const char *text); 0062 friend KLocalizedString KI18N_EXPORT kxi18np(const char *singular, const char *plural); 0063 friend KLocalizedString KI18N_EXPORT kxi18ncp(const char *context, const char *singular, const char *plural); 0064 friend KLocalizedString KI18N_EXPORT kxi18nd(const char *domain, const char *text); 0065 friend KLocalizedString KI18N_EXPORT kxi18ndc(const char *domain, const char *context, const char *text); 0066 friend KLocalizedString KI18N_EXPORT kxi18ndp(const char *domain, const char *singular, const char *plural); 0067 friend KLocalizedString KI18N_EXPORT kxi18ndcp(const char *domain, const char *context, const char *singular, const char *plural); 0068 0069 public: 0070 /** 0071 * Construct an empty message. 0072 * 0073 * Direct construction is used when another \c KLocalizedString instance, 0074 * obtained by one of \c ki18n\* calls, should later be assigned 0075 * to directly constructed instance. 0076 * Before the assignment happens, directly constructed instance 0077 * is not valid for finalization by \c toString methods. 0078 * 0079 * \see isEmpty 0080 */ 0081 explicit KLocalizedString(); 0082 0083 /** 0084 * Copy constructor. 0085 */ 0086 KLocalizedString(const KLocalizedString &rhs); 0087 0088 /** 0089 * Assignment operator. 0090 */ 0091 KLocalizedString &operator=(const KLocalizedString &rhs); 0092 0093 /** 0094 * Destructor. 0095 */ 0096 ~KLocalizedString(); 0097 0098 /** 0099 * Check whether the message is empty. 0100 * 0101 * The message is considered empty if the object was constructed 0102 * via the default constructor. 0103 * 0104 * Empty messages are not valid for finalization. 0105 * The behavior of calling \c toString on them is undefined. 0106 * In debug mode, an error mark may appear in the returned string. 0107 * 0108 * \return \c true if the message is empty, \c false otherwise 0109 */ 0110 bool isEmpty() const; 0111 0112 /** 0113 * Finalize the translation. 0114 * 0115 * Creates translated \c QString, with placeholders substituted 0116 * by arguments given by \c KLocalizedString::subs methods. 0117 * Translated text is searched for and arguments are formatted 0118 * based on the global locale. 0119 * 0120 * If there was any mismatch between placeholders and arguments, 0121 * in debug mode the returned string may contain error marks. 0122 * 0123 * \return finalized translation 0124 */ 0125 Q_REQUIRED_RESULT QString toString() const; 0126 0127 /** 0128 * Like \c toString, but look for translation only in given languages. 0129 * 0130 * Given languages override languages defined by the global locale, 0131 * and any languages set earlier using \c withLanguages. 0132 * If \p languages is empty, original message is returned. 0133 * 0134 * \param languages list of language codes (by decreasing priority) 0135 * \return finalized translation 0136 */ 0137 Q_REQUIRED_RESULT QString toString(const QStringList &languages) const; 0138 0139 #if 0 // until locale system is ready 0140 /** 0141 * Like \c toString, but look for translation based on given locale. 0142 * 0143 * Given locale overrides any set earlier using \c withLocale. 0144 * If \p locale is \c NULL, original message is returned. 0145 * 0146 * \param locale the locale for which translations are made 0147 * \return finalized translation 0148 */ 0149 QString toString(const KLocale *locale) const; 0150 #endif 0151 0152 /** 0153 * Like \c toString, but look for translation in the given domain. 0154 * 0155 * Given domain overrides any set earlier using \c withDomain. 0156 * 0157 * \param domain the translation domain 0158 * \return finalized translation 0159 */ 0160 Q_REQUIRED_RESULT QString toString(const char *domain) const; 0161 0162 /** 0163 * Like \c toString, but resolve KUIT markup into given visual format. 0164 * 0165 * Given visual format overrides that implied by the context UI marker 0166 * or set earlier using \c withFormat. 0167 * If the message is not markup-aware, 0168 * this is same as \c toString without arguments. 0169 * 0170 * \param format the target visual format 0171 * \return finalized translation 0172 */ 0173 Q_REQUIRED_RESULT QString toString(Kuit::VisualFormat format) const; 0174 0175 /** 0176 * Indicate to look for translation only in given languages. 0177 * 0178 * \param languages list of language codes (by decreasing priority) 0179 * \return updated \c KLocalizedString 0180 */ 0181 Q_REQUIRED_RESULT KLocalizedString withLanguages(const QStringList &languages) const; 0182 0183 #if 0 // until locale system is ready 0184 /** 0185 * Indicate to look for translation based on given locale. 0186 * 0187 * \param locale the locale for which translations are made 0188 * \return updated \c KLocalizedString 0189 */ 0190 KLocalizedString withLocale(const KLocale *locale) const; 0191 #endif 0192 0193 /** 0194 * Indicate to look for translation in the given domain. 0195 * 0196 * \param domain the translation domain 0197 * \return updated \c KLocalizedString 0198 */ 0199 Q_REQUIRED_RESULT KLocalizedString withDomain(const char *domain) const; 0200 0201 /** 0202 * Indicate to resolve KUIT markup into given visual format. 0203 * 0204 * If the message is not markup-aware, this has no effect. 0205 * 0206 * \param format the target visual format 0207 * \return updated \c KLocalizedString 0208 */ 0209 Q_REQUIRED_RESULT KLocalizedString withFormat(Kuit::VisualFormat format) const; 0210 0211 /** 0212 * Substitute an int argument into the message. 0213 * 0214 * \param a the argument 0215 * \param fieldWidth width of the formatted field, padded by spaces. 0216 * Positive value aligns right, negative aligns left 0217 * \param base the radix used to represent the number as a string. 0218 * Valid values range from 2 to 36 0219 * \param fillChar the character used to fill up the empty places when 0220 * field width is greater than argument width 0221 * \return updated \c KLocalizedString 0222 */ 0223 Q_REQUIRED_RESULT KLocalizedString subs(int a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0224 0225 /** 0226 * Substitute an unsigned int argument into the message. 0227 * 0228 * \param a the argument 0229 * \param fieldWidth width of the formatted field, padded by spaces. 0230 * Positive value aligns right, negative aligns left 0231 * \param base the radix used to represent the number as a string. 0232 * Valid values range from 2 to 36 0233 * \param fillChar the character used to fill up the empty places when 0234 * field width is greater than argument width 0235 * \return updated \c KLocalizedString 0236 */ 0237 Q_REQUIRED_RESULT KLocalizedString subs(uint a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0238 0239 /** 0240 * Substitute a long argument into the message. 0241 * 0242 * \param a the argument 0243 * \param fieldWidth width of the formatted field, padded by spaces. 0244 * Positive value aligns right, negative aligns left 0245 * \param base the radix used to represent the number as a string. 0246 * Valid values range from 2 to 36 0247 * \param fillChar the character used to fill up the empty places when 0248 * field width is greater than argument width 0249 * \return updated \c KLocalizedString 0250 */ 0251 Q_REQUIRED_RESULT KLocalizedString subs(long a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0252 0253 /** 0254 * Substitute an unsigned long argument into the message. 0255 * 0256 * \param a the argument 0257 * \param fieldWidth width of the formatted field, padded by spaces. 0258 * Positive value aligns right, negative aligns left 0259 * \param base the radix used to represent the number as a string. 0260 * Valid values range from 2 to 36 0261 * \param fillChar the character used to fill up the empty places when 0262 * field width is greater than argument width 0263 * \return updated \c KLocalizedString 0264 */ 0265 Q_REQUIRED_RESULT KLocalizedString subs(ulong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0266 0267 /** 0268 * Substitute a long long argument into the message. 0269 * 0270 * \param a the argument 0271 * \param fieldWidth width of the formatted field, padded by spaces. 0272 * Positive value aligns right, negative aligns left 0273 * \param base the radix used to represent the number as a string. 0274 * Valid values range from 2 to 36 0275 * \param fillChar the character used to fill up the empty places when 0276 * field width is greater than argument width 0277 * \return updated \c KLocalizedString 0278 */ 0279 Q_REQUIRED_RESULT KLocalizedString subs(qlonglong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0280 0281 /** 0282 * Substitute an unsigned long long argument into the message. 0283 * 0284 * \param a the argument 0285 * \param fieldWidth width of the formatted field, padded by spaces. 0286 * Positive value aligns right, negative aligns left 0287 * \param base the radix used to represent the number as a string. 0288 * Valid values range from 2 to 36 0289 * \param fillChar the character used to fill up the empty places when 0290 * field width is greater than argument width 0291 * \return updated \c KLocalizedString 0292 */ 0293 Q_REQUIRED_RESULT KLocalizedString subs(qulonglong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const; 0294 0295 /** 0296 * Substitute a double argument into the message. 0297 * 0298 * \param a the argument 0299 * \param fieldWidth width of the formatted field, padded by spaces. 0300 * Positive value aligns right, negative aligns left 0301 * \param format type of floating point formatting, like in QString::arg 0302 * \param precision number of digits after the decimal separator 0303 * \param fillChar the character used to fill up the empty places when 0304 * field width is greater than argument width 0305 * \return updated \c KLocalizedString 0306 */ 0307 Q_REQUIRED_RESULT KLocalizedString subs(double a, int fieldWidth = 0, char format = 'g', int precision = -1, QChar fillChar = QLatin1Char(' ')) const; 0308 0309 /** 0310 * Substitute a \c QChar argument into the message. 0311 * 0312 * \param a the argument 0313 * \param fieldWidth width of the formatted field, padded by spaces. 0314 * Positive value aligns right, negative aligns left 0315 * \param fillChar the character used to fill up the empty places when 0316 * field width is greater than argument width 0317 * \return updated \c KLocalizedString 0318 */ 0319 Q_REQUIRED_RESULT KLocalizedString subs(QChar a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const; 0320 0321 /** 0322 * Substitute a \c QString argument into the message. 0323 * 0324 * \param a the argument 0325 * \param fieldWidth width of the formatted field, padded by spaces. 0326 * Positive value aligns right, negative aligns left 0327 * \param fillChar the character used to fill up the empty places when 0328 * field width is greater than argument width 0329 * \return updated \c KLocalizedString 0330 */ 0331 Q_REQUIRED_RESULT KLocalizedString subs(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const; 0332 0333 /** 0334 * Substitute another \c KLocalizedString into the message. 0335 * 0336 * \param a the argument 0337 * \param fieldWidth width of the formatted field, padded by spaces. 0338 * Positive value aligns right, negative aligns left 0339 * \param fillChar the character used to fill up the empty places when 0340 * field width is greater than argument width 0341 * \return updated \c KLocalizedString 0342 */ 0343 Q_REQUIRED_RESULT KLocalizedString subs(const KLocalizedString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const; 0344 0345 /** 0346 * Add dynamic context to the message. 0347 * 0348 * See \ref dyn_ctxt for use cases. 0349 * 0350 * \param key context key 0351 * \param value context value 0352 * \return updated \c KLocalizedString 0353 */ 0354 Q_REQUIRED_RESULT KLocalizedString inContext(const QString &key, const QString &value) const; 0355 0356 /** 0357 * Relax matching between placeholders and arguments. 0358 * 0359 * Normally the placeholders should start from %1 and have no gaps, 0360 * and on finalization there must be exactly as many arguments 0361 * supplied through \c subs methods as there are unique plaecholders. 0362 * If this is not satisfied, in debug mode warnings are printed 0363 * and the finalized string may contain error marks. 0364 * 0365 * This method relaxes the placeholder-argument matching, 0366 * such that there must only be an argument available for 0367 * every present unique placeholder (taking placeholder numbers 0368 * to be 1-based indices into the argument list). 0369 * This can come useful in some situations. 0370 * 0371 * \return updated \c KLocalizedString 0372 */ 0373 Q_REQUIRED_RESULT KLocalizedString relaxSubs() const; 0374 0375 /** 0376 * Do not resolve KUIT markup. 0377 * 0378 * If the message is markup-aware 0379 * (constructed by one of \c \*xi18n\* calls), 0380 * this function can be used to make it non-markup-aware. 0381 * This may be useful for debugging markup. 0382 * 0383 * \return updated \c KLocalizedString 0384 */ 0385 Q_REQUIRED_RESULT KLocalizedString ignoreMarkup() const; 0386 0387 /** 0388 * Returns the untranslated text. 0389 * 0390 * \since 5.64 0391 */ 0392 Q_REQUIRED_RESULT QByteArray untranslatedText() const; 0393 0394 /** 0395 * Set the given domain as application's main domain. 0396 * 0397 * This function must be called in applications, in order to have 0398 * any translations at all. It should never be called in libraries. 0399 * This allows to check whether the application is translated 0400 * into a given language, so that if it is not, translations from 0401 * underlying libraries will not appear even if they are translated. 0402 * This prevents mixing of translated and untranslated text 0403 * in the user interface. 0404 * 0405 * This function should be called right after creating the instance 0406 * of QCoreApplication or one of its subclasses. At that time the locale 0407 * setup has been made, including what is hooked into the 0408 * QCoreApplication startup, like KXMLGUI's language switching support. 0409 * So the initialisation done by this function sees all the data it should. 0410 * 0411 * \param domain the translation domain of the application 0412 */ 0413 static void setApplicationDomain(const QByteArray &domain); 0414 0415 /** 0416 * Get the application's main translation domain. 0417 * 0418 * Returns the domain set by \c setApplicationDomain. 0419 */ 0420 static QByteArray applicationDomain(); 0421 0422 #if 0 // until locale system is ready 0423 /** 0424 * Set the locale for which translations will be made. 0425 * 0426 * Locale determines from which languages (and in which order) 0427 * to draw translations, formatting of number arguments, etc. 0428 * 0429 * \param locale the locale 0430 * \see setLanguages 0431 */ 0432 static void setLocale(const KLocale &locale); 0433 #endif 0434 0435 /** 0436 * Get the languages for which translations will be made. 0437 * 0438 * Returned languages are ordered with decreasing priority. 0439 * 0440 * \return languages ordered list of language codes 0441 * \see setLanguages 0442 * \see clearLanguages 0443 * 0444 * \since 5.20.0 0445 */ 0446 static QStringList languages(); 0447 0448 /** 0449 * Set the languages for which translations will be made. 0450 * 0451 * This overrides the languages provided by the locale. 0452 * Languages should be ordered with decreasing priority. 0453 * 0454 * \param languages ordered list of language codes 0455 * \see setLocale 0456 * \see clearLanguages 0457 * \see languages 0458 */ 0459 static void setLanguages(const QStringList &languages); 0460 0461 /** 0462 * Clear override languages. 0463 * 0464 * This clears the override languages, going back to those 0465 * provided by the locale. 0466 * 0467 * \see setLanguages 0468 * \see languages 0469 */ 0470 static void clearLanguages(); 0471 0472 /** 0473 * Check whether the translation catalog file in the given language 0474 * for the set application translation domain exists. 0475 * 0476 * \param language the language code to check 0477 * \return \c true if the translation catalog for \p language exits, 0478 * \c false otherwise 0479 * \see setApplicationDomain 0480 */ 0481 static bool isApplicationTranslatedInto(const QString &language); 0482 0483 /** 0484 * @since 5.0 0485 * 0486 * Get the languages for which there exists the translation catalog file 0487 * for the set application translation domain. 0488 * 0489 * The application domain is set by \c setApplicationDomain. 0490 * If the application domain was not set, empty set is returned. 0491 * If the application domain was set, the language set will always 0492 * contain at least the source code language (<tt>en_US</tt>). 0493 * 0494 * \return set of language codes for existing translation catalogs 0495 * \see setApplicationDomain 0496 */ 0497 static QSet<QString> availableApplicationTranslations(); 0498 0499 /** 0500 * @since 5.0 0501 * 0502 * Get the languages for which a translation catalog file 0503 * for the passed translation domain exists. 0504 * 0505 * If the translation domain was not specified in the 0506 * domain parameter an empty set is returned. 0507 * 0508 * If the application domain was set, the language set will always 0509 * contain at least the source code language (<tt>en_US</tt>). 0510 * 0511 * \param domain query for translations of a specific domain, if an empty 0512 * QByteArray is passed, an empty set will be returned 0513 * 0514 * \return set of language codes for existing translation catalogs 0515 * \see setApplicationDomain 0516 * \see availableApplicationTranslations 0517 */ 0518 static QSet<QString> availableDomainTranslations(const QByteArray &domain); 0519 0520 /** 0521 * Load locales for a domain from a specific location 0522 * This is useful for resources which have their translation files 0523 * outside of the usual $XDG_DATA_DIRS/locales location 0524 * 0525 * \param the domain to load resources from 0526 * \path the full file path to the locale directory 0527 */ 0528 static void addDomainLocaleDir(const QByteArray &domain, const QString &path); 0529 0530 /** 0531 * Find a path to the localized file for the given original path. 0532 * 0533 * This is intended mainly for non-text resources (images, sounds, etc). 0534 * Text resources should be handled in more specific ways. 0535 * 0536 * Possible localized paths are checked in turn by priority of set 0537 * languages, in form of <tt>\<dirname\>/l10n/\<lang\>/\<basename\></tt>, 0538 * where <tt>\<dirname\></tt> and <tt>\<basename\></tt> are those of 0539 * the original path, and <tt>\<lang\></tt> is the language code. 0540 * 0541 * \param filePath path to the original file 0542 * 0543 * \return path to the localized file if found, original path otherwise 0544 */ 0545 Q_REQUIRED_RESULT static QString localizedFilePath(const QString &filePath); 0546 0547 /** 0548 * Remove accelerator marker from a UI text label. 0549 * 0550 * Accelerator marker is not always a plain ampersand (&), 0551 * so it is not enough to just remove it by \c QString::remove. 0552 * The label may contain escaped markers ("&&") which must be resolved 0553 * and skipped, as well as CJK-style markers ("Foo (&F)") where 0554 * the whole parenthesis construct should be removed. 0555 * Therefore always use this function to remove accelerator marker 0556 * from UI labels. 0557 * 0558 * \param label UI label which may contain an accelerator marker 0559 * \return label without the accelerator marker 0560 */ 0561 Q_REQUIRED_RESULT static QString removeAcceleratorMarker(const QString &label); 0562 0563 private: 0564 // exported because called from inline KLazyLocalizedString::operator KLocalizedString() 0565 KLocalizedString(const char *domain, const char *context, const char *text, const char *plural, bool markupAware); 0566 0567 private: 0568 std::unique_ptr<KLocalizedStringPrivate> const d; 0569 }; 0570 0571 // Do not document every multi-argument i18n* call separately, 0572 // but provide special quasi-calls that only Doxygen sees. 0573 // Placed in front of ki18n* calls, because i18n* are more basic. 0574 #ifdef K_DOXYGEN 0575 0576 /** 0577 * Translate a string and substitute any arguments. 0578 * 0579 * \param text string to translate 0580 * \param arg arguments to insert (0 to 9), 0581 * admissible types according to \c KLocalizedString::subs methods 0582 * \return translated string 0583 */ 0584 QString i18n(const char *text, const TYPE &arg...); 0585 0586 /** 0587 * Translate a string with context and substitute any arguments. 0588 * 0589 * \param context context of the string 0590 * \param text string to translate 0591 * \param arg arguments to insert (0 to 9), 0592 * admissible types according to \c KLocalizedString::subs methods 0593 * \return translated string 0594 */ 0595 QString i18nc(const char *context, const char *text, const TYPE &arg...); 0596 0597 /** 0598 * Translate a string with plural and substitute any arguments. 0599 * 0600 * \param singular singular form of the string to translate 0601 * \param plural plural form of the string to translate 0602 * \param arg arguments to insert (0 to 9), 0603 * admissible types according to \c KLocalizedString::subs methods 0604 * \return translated string 0605 */ 0606 QString i18np(const char *singular, const char *plural, const TYPE &arg...); 0607 0608 /** 0609 * Translate a string with context and plural and substitute any arguments. 0610 * 0611 * \param context context of the string 0612 * \param singular singular form of the string to translate 0613 * \param plural plural form of the string to translate 0614 * \param arg arguments to insert (0 to 9), 0615 * admissible types according to \c KLocalizedString::subs methods 0616 * \return translated string 0617 */ 0618 QString i18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...); 0619 0620 /** 0621 * Translate a string from domain and substitute any arguments. 0622 * 0623 * \param domain domain in which to look for translations 0624 * \param text string to translate 0625 * \param arg arguments to insert (0 to 9), 0626 * admissible types according to \c KLocalizedString::subs methods 0627 * \return translated string 0628 */ 0629 QString i18nd(const char *domain, const char *text, const TYPE &arg...); 0630 0631 /** 0632 * Translate a string from domain with context and substitute any arguments. 0633 * 0634 * \param domain domain in which to look for translations 0635 * \param context context of the string 0636 * \param text string to translate 0637 * \param arg arguments to insert (0 to 9), 0638 * admissible types according to \c KLocalizedString::subs methods 0639 * \return translated string 0640 */ 0641 QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...); 0642 0643 /** 0644 * Translate a string from domain with plural and substitute any arguments. 0645 * 0646 * \param domain domain in which to look for translations 0647 * \param singular singular form of the string to translate 0648 * \param plural plural form of the string to translate 0649 * \param arg arguments to insert (0 to 9), 0650 * admissible types according to \c KLocalizedString::subs methods 0651 * \return translated string 0652 */ 0653 QString i18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...); 0654 0655 /** 0656 * Translate a string from domain with context and plural 0657 * and substitute any arguments. 0658 * 0659 * \param domain domain in which to look for translations 0660 * \param context context of the string 0661 * \param singular singular form of the string to translate 0662 * \param plural plural form of the string to translate 0663 * \param arg arguments to insert (0 to 9), 0664 * admissible types according to \c KLocalizedString::subs methods 0665 * \return translated string 0666 */ 0667 QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...); 0668 0669 /** 0670 * Translate a markup-aware string and substitute any arguments. 0671 * 0672 * \param text string to translate 0673 * \param arg arguments to insert (0 to 9), 0674 * admissible types according to \c KLocalizedString::subs methods 0675 * \return translated string 0676 */ 0677 QString xi18n(const char *text, const TYPE &arg...); 0678 0679 /** 0680 * Translate a markup-aware string with context and substitute any arguments. 0681 * 0682 * \param context context of the string 0683 * \param text string to translate 0684 * \param arg arguments to insert (0 to 9), 0685 * admissible types according to \c KLocalizedString::subs methods 0686 * \return translated string 0687 */ 0688 QString xi18nc(const char *context, const char *text, const TYPE &arg...); 0689 0690 /** 0691 * Translate a markup-aware string with plural and substitute any arguments. 0692 * 0693 * \param singular singular form of the string to translate 0694 * \param plural plural form of the string to translate 0695 * \param arg arguments to insert (0 to 9), 0696 * admissible types according to \c KLocalizedString::subs methods 0697 * \return translated string 0698 */ 0699 QString xi18np(const char *singular, const char *plural, const TYPE &arg...); 0700 0701 /** 0702 * Translate a markup-aware string with context and plural 0703 * and substitute any arguments. 0704 * 0705 * \param context context of the string 0706 * \param singular singular form of the string to translate 0707 * \param plural plural form of the string to translate 0708 * \param arg arguments to insert (0 to 9), 0709 * admissible types according to \c KLocalizedString::subs methods 0710 * \return translated string 0711 */ 0712 QString xi18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...); 0713 0714 /** 0715 * Translate a markup-aware string from domain and substitute any arguments. 0716 * 0717 * \param domain domain in which to look for translations 0718 * \param text string to translate 0719 * \param arg arguments to insert (0 to 9), 0720 * admissible types according to \c KLocalizedString::subs methods 0721 * \return translated string 0722 */ 0723 QString xi18nd(const char *domain, const char *text, const TYPE &arg...); 0724 0725 /** 0726 * Translate a markup-aware string from domain with context 0727 * and substitute any arguments. 0728 * 0729 * \param domain domain in which to look for translations 0730 * \param context context of the string 0731 * \param text string to translate 0732 * \param arg arguments to insert (0 to 9), 0733 * admissible types according to \c KLocalizedString::subs methods 0734 * \return translated string 0735 */ 0736 QString xi18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...); 0737 0738 /** 0739 * Translate a markup-aware string from domain with plural 0740 * and substitute any arguments. 0741 * 0742 * \param domain domain in which to look for translations 0743 * \param singular singular form of the string to translate 0744 * \param plural plural form of the string to translate 0745 * \param arg arguments to insert (0 to 9), 0746 * admissible types according to \c KLocalizedString::subs methods 0747 * \return translated string 0748 */ 0749 QString xi18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...); 0750 0751 /** 0752 * Translate a markup-aware string from domain with context and plural 0753 * and substitute any arguments. 0754 * 0755 * \param domain domain in which to look for translations 0756 * \param context context of the string 0757 * \param singular singular form of the string to translate 0758 * \param plural plural form of the string to translate 0759 * \param arg arguments to insert (0 to 9), 0760 * admissible types according to \c KLocalizedString::subs methods 0761 * \return translated string 0762 */ 0763 QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...); 0764 0765 #endif // K_DOXYGEN 0766 0767 /** 0768 * Create non-finalized translated string. 0769 * 0770 * \param text string to translate 0771 * \return non-finalized translated string 0772 */ 0773 KLocalizedString KI18N_EXPORT ki18n(const char *text); 0774 0775 /** 0776 * Create non-finalized translated string with context. 0777 * 0778 * \param context context of the string 0779 * \param text string to translate 0780 * \return non-finalized translated string 0781 */ 0782 KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text); 0783 0784 /** 0785 * Create non-finalized translated string with plural. 0786 * 0787 * \param singular singular form of the string to translate 0788 * \param plural plural form of the string to translate 0789 * \return non-finalized translated string 0790 */ 0791 KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural); 0792 0793 /** 0794 * Create non-finalized translated string with context and plural. 0795 * 0796 * \param context context of the string 0797 * \param singular singular form of the string to translate 0798 * \param plural plural form of the string to translate 0799 * \return non-finalized translated string 0800 */ 0801 KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural); 0802 0803 /** 0804 * Create non-finalized translated string from domain. 0805 * 0806 * \param domain domain in which to look for translations 0807 * \param text string to translate 0808 * \return non-finalized translated string 0809 */ 0810 KLocalizedString KI18N_EXPORT ki18nd(const char *domain, const char *text); 0811 0812 /** 0813 * Create non-finalized translated string from domain with context. 0814 * 0815 * \param domain domain in which to look for translations 0816 * \param context context of the string 0817 * \param text string to translate 0818 * \return non-finalized translated string 0819 */ 0820 KLocalizedString KI18N_EXPORT ki18ndc(const char *domain, const char *context, const char *text); 0821 0822 /** 0823 * Create non-finalized translated string from domain with plural. 0824 * 0825 * \param domain domain in which to look for translations 0826 * \param singular singular form of the string to translate 0827 * \param plural plural form of the string to translate 0828 * \return non-finalized translated string 0829 */ 0830 KLocalizedString KI18N_EXPORT ki18ndp(const char *domain, const char *singular, const char *plural); 0831 0832 /** 0833 * Create non-finalized translated string from domain with context and plural. 0834 * 0835 * \param domain domain in which to look for translations 0836 * \param context context of the string 0837 * \param singular singular form of the string to translate 0838 * \param plural plural form of the string to translate 0839 * \return non-finalized translated string 0840 */ 0841 KLocalizedString KI18N_EXPORT ki18ndcp(const char *domain, const char *context, const char *singular, const char *plural); 0842 0843 /** 0844 * Create non-finalized markup-aware translated string. 0845 * 0846 * \param text string to translate 0847 * \return non-finalized translated string 0848 */ 0849 KLocalizedString KI18N_EXPORT kxi18n(const char *text); 0850 0851 /** 0852 * Create non-finalized markup-aware translated string with context. 0853 * 0854 * \param context context of the string 0855 * \param text string to translate 0856 * \return non-finalized translated string 0857 */ 0858 KLocalizedString KI18N_EXPORT kxi18nc(const char *context, const char *text); 0859 0860 /** 0861 * Create non-finalized markup-aware translated string with plural. 0862 * 0863 * \param singular singular form of the string to translate 0864 * \param plural plural form of the string to translate 0865 * \return non-finalized translated string 0866 */ 0867 KLocalizedString KI18N_EXPORT kxi18np(const char *singular, const char *plural); 0868 0869 /** 0870 * Create non-finalized markup-aware translated string. 0871 * with context and plural. 0872 * 0873 * \param context context of the string 0874 * \param singular singular form of the string to translate 0875 * \param plural plural form of the string to translate 0876 * \return non-finalized translated string 0877 */ 0878 KLocalizedString KI18N_EXPORT kxi18ncp(const char *context, const char *singular, const char *plural); 0879 0880 /** 0881 * Create non-finalized markup-aware translated string from domain. 0882 * 0883 * \param domain domain in which to look for translations 0884 * \param text string to translate 0885 * \return non-finalized translated string 0886 */ 0887 KLocalizedString KI18N_EXPORT kxi18nd(const char *domain, const char *text); 0888 0889 /** 0890 * Create non-finalized markup-aware translated string from domain with context. 0891 * 0892 * \param domain domain in which to look for translations 0893 * \param context context of the string 0894 * \param text string to translate 0895 * \return non-finalized translated string 0896 */ 0897 KLocalizedString KI18N_EXPORT kxi18ndc(const char *domain, const char *context, const char *text); 0898 0899 /** 0900 * Create non-finalized markup-aware translated string from domain with plural. 0901 * 0902 * \param domain domain in which to look for translations 0903 * \param singular singular form of the string to translate 0904 * \param plural plural form of the string to translate 0905 * \return non-finalized translated string 0906 */ 0907 KLocalizedString KI18N_EXPORT kxi18ndp(const char *domain, const char *singular, const char *plural); 0908 0909 /** 0910 * Create non-finalized markup-aware translated string from domain 0911 * with context and plural. 0912 * 0913 * \param domain domain in which to look for translations 0914 * \param context context of the string 0915 * \param singular singular form of the string to translate 0916 * \param plural plural form of the string to translate 0917 * \return non-finalized translated string 0918 */ 0919 KLocalizedString KI18N_EXPORT kxi18ndcp(const char *domain, const char *context, const char *singular, const char *plural); 0920 0921 /** 0922 * Redirect Qt's <tt>uic</tt>-generated translation calls to Ki18n. 0923 * 0924 * Use <tt>-tr tr2i18n</tt> option to \c uic to have it redirect calls. 0925 * 0926 * \param text string to translate 0927 * \param comment Qt equivalent of disambiguation context 0928 * \return translated string 0929 */ 0930 inline QString tr2i18n(const char *text, const char *comment = nullptr) 0931 { 0932 if (comment && comment[0] && text && text[0]) { 0933 return ki18nc(comment, text).toString(); 0934 } else if (text && text[0]) { 0935 return ki18n(text).toString(); 0936 } else { 0937 return QString(); 0938 } 0939 } 0940 0941 /** 0942 * Like \c tr2i18n, but look for translation in a specific domain. 0943 * 0944 * Use <tt>-tr tr2i18nd</tt> option to \c uic to have it redirect calls. 0945 * 0946 * \param domain domain in which to look for translations 0947 * \param text string to translate 0948 * \param comment Qt equivalent of disambiguation context 0949 * \return translated string 0950 */ 0951 inline QString tr2i18nd(const char *domain, const char *text, const char *comment = nullptr) 0952 { 0953 if (comment && comment[0] && text && text[0]) { 0954 return ki18ndc(domain, comment, text).toString(); 0955 } else if (text && text[0]) { 0956 return ki18nd(domain, text).toString(); 0957 } else { 0958 return QString(); 0959 } 0960 } 0961 0962 /** 0963 * Like \c tr2i18n, but when UI strings are KUIT markup-aware. 0964 * 0965 * Use <tt>-tr tr2xi18n</tt> option to \c uic to have it redirect calls. 0966 * 0967 * \param text markup-aware string to translate 0968 * \param comment Qt equivalent of disambiguation context 0969 * \return translated string 0970 */ 0971 inline QString tr2xi18n(const char *text, const char *comment = nullptr) 0972 { 0973 if (comment && comment[0] && text && text[0]) { 0974 return kxi18nc(comment, text).toString(); 0975 } else if (text && text[0]) { 0976 return kxi18n(text).toString(); 0977 } else { 0978 return QString(); 0979 } 0980 } 0981 0982 /** 0983 * Like \c tr2xi18n, but look for translation in a specific domain. 0984 * 0985 * Use <tt>-tr tr2xi18nd</tt> option to \c uic to have it redirect calls. 0986 * 0987 * \param domain domain in which to look for translations 0988 * \param text markup-aware string to translate 0989 * \param comment Qt equivalent of disambiguation context 0990 * \return translated string 0991 */ 0992 inline QString tr2xi18nd(const char *domain, const char *text, const char *comment = nullptr) 0993 { 0994 if (comment && comment[0] && text && text[0]) { 0995 return kxi18ndc(domain, comment, text).toString(); 0996 } else if (text && text[0]) { 0997 return kxi18nd(domain, text).toString(); 0998 } else { 0999 return QString(); 1000 } 1001 } 1002 1003 #ifndef K_DOXYGEN 1004 1005 #ifndef NDEBUG 1006 #define I18N_ERR_MSG String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np 1007 template<typename T, int s> 1008 class I18nTypeCheck 1009 { 1010 public: 1011 static void I18N_ERR_MSG() 1012 { 1013 } 1014 }; 1015 template<int s> 1016 class I18nTypeCheck<char[s], s> 1017 { 1018 }; 1019 #define STATIC_ASSERT_NOT_LITERAL_STRING(T) I18nTypeCheck<T, sizeof(T)>::I18N_ERR_MSG(); 1020 #else 1021 #define STATIC_ASSERT_NOT_LITERAL_STRING(T) 1022 #endif 1023 1024 // >>>>> Basic calls 1025 // Autogenerated; contact maintainer for batch changes. 1026 inline QString i18n(const char *text) 1027 { 1028 return ki18n(text).toString(); 1029 } 1030 template<typename A1> 1031 inline QString i18n(const char *text, const A1 &a1) 1032 { 1033 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1034 return ki18n(text).subs(a1).toString(); 1035 } 1036 template<typename A1, typename A2> 1037 inline QString i18n(const char *text, const A1 &a1, const A2 &a2) 1038 { 1039 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1040 return ki18n(text).subs(a1).subs(a2).toString(); 1041 } 1042 template<typename A1, typename A2, typename A3> 1043 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1044 { 1045 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1046 return ki18n(text).subs(a1).subs(a2).subs(a3).toString(); 1047 } 1048 template<typename A1, typename A2, typename A3, typename A4> 1049 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1050 { 1051 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1052 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1053 } 1054 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1055 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1056 { 1057 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1058 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1059 } 1060 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1061 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1062 { 1063 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1064 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1065 } 1066 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1067 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1068 { 1069 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1070 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1071 } 1072 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1073 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1074 { 1075 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1076 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1077 } 1078 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1079 inline QString 1080 i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) 1081 { 1082 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1083 return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1084 } 1085 // <<<<<<< End of basic calls 1086 1087 // >>>>> Context calls 1088 // Autogenerated; contact maintainer for batch changes. 1089 inline QString i18nc(const char *context, const char *text) 1090 { 1091 return ki18nc(context, text).toString(); 1092 } 1093 template<typename A1> 1094 inline QString i18nc(const char *context, const char *text, const A1 &a1) 1095 { 1096 return ki18nc(context, text).subs(a1).toString(); 1097 } 1098 template<typename A1, typename A2> 1099 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2) 1100 { 1101 return ki18nc(context, text).subs(a1).subs(a2).toString(); 1102 } 1103 template<typename A1, typename A2, typename A3> 1104 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1105 { 1106 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).toString(); 1107 } 1108 template<typename A1, typename A2, typename A3, typename A4> 1109 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1110 { 1111 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1112 } 1113 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1114 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1115 { 1116 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1117 } 1118 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1119 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1120 { 1121 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1122 } 1123 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1124 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1125 { 1126 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1127 } 1128 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1129 inline QString 1130 i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1131 { 1132 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1133 } 1134 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1135 inline QString i18nc(const char *context, 1136 const char *text, 1137 const A1 &a1, 1138 const A2 &a2, 1139 const A3 &a3, 1140 const A4 &a4, 1141 const A5 &a5, 1142 const A6 &a6, 1143 const A7 &a7, 1144 const A8 &a8, 1145 const A9 &a9) 1146 { 1147 return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1148 } 1149 // <<<<< End of context calls 1150 1151 // >>>>> Plural calls 1152 // Autogenerated; contact maintainer for batch changes. 1153 template<typename A1> 1154 inline QString i18np(const char *singular, const char *plural, const A1 &a1) 1155 { 1156 return ki18np(singular, plural).subs(a1).toString(); 1157 } 1158 template<typename A1, typename A2> 1159 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1160 { 1161 return ki18np(singular, plural).subs(a1).subs(a2).toString(); 1162 } 1163 template<typename A1, typename A2, typename A3> 1164 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1165 { 1166 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1167 } 1168 template<typename A1, typename A2, typename A3, typename A4> 1169 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1170 { 1171 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1172 } 1173 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1174 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1175 { 1176 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1177 } 1178 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1179 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1180 { 1181 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1182 } 1183 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1184 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1185 { 1186 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1187 } 1188 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1189 inline QString 1190 i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1191 { 1192 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1193 } 1194 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1195 inline QString i18np(const char *singular, 1196 const char *plural, 1197 const A1 &a1, 1198 const A2 &a2, 1199 const A3 &a3, 1200 const A4 &a4, 1201 const A5 &a5, 1202 const A6 &a6, 1203 const A7 &a7, 1204 const A8 &a8, 1205 const A9 &a9) 1206 { 1207 return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1208 } 1209 // <<<<< End of plural calls 1210 1211 // >>>>> Context-plural calls 1212 // Autogenerated; contact maintainer for batch changes. 1213 template<typename A1> 1214 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1) 1215 { 1216 return ki18ncp(context, singular, plural).subs(a1).toString(); 1217 } 1218 template<typename A1, typename A2> 1219 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1220 { 1221 return ki18ncp(context, singular, plural).subs(a1).subs(a2).toString(); 1222 } 1223 template<typename A1, typename A2, typename A3> 1224 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1225 { 1226 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1227 } 1228 template<typename A1, typename A2, typename A3, typename A4> 1229 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1230 { 1231 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1232 } 1233 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1234 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1235 { 1236 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1237 } 1238 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1239 inline QString 1240 i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1241 { 1242 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1243 } 1244 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1245 inline QString i18ncp(const char *context, 1246 const char *singular, 1247 const char *plural, 1248 const A1 &a1, 1249 const A2 &a2, 1250 const A3 &a3, 1251 const A4 &a4, 1252 const A5 &a5, 1253 const A6 &a6, 1254 const A7 &a7) 1255 { 1256 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1257 } 1258 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1259 inline QString i18ncp(const char *context, 1260 const char *singular, 1261 const char *plural, 1262 const A1 &a1, 1263 const A2 &a2, 1264 const A3 &a3, 1265 const A4 &a4, 1266 const A5 &a5, 1267 const A6 &a6, 1268 const A7 &a7, 1269 const A8 &a8) 1270 { 1271 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1272 } 1273 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1274 inline QString i18ncp(const char *context, 1275 const char *singular, 1276 const char *plural, 1277 const A1 &a1, 1278 const A2 &a2, 1279 const A3 &a3, 1280 const A4 &a4, 1281 const A5 &a5, 1282 const A6 &a6, 1283 const A7 &a7, 1284 const A8 &a8, 1285 const A9 &a9) 1286 { 1287 return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1288 } 1289 // <<<<< End of context-plural calls 1290 1291 // >>>>> Basic calls with domain 1292 // Autogenerated; contact maintainer for batch changes. 1293 inline QString i18nd(const char *domain, const char *text) 1294 { 1295 return ki18nd(domain, text).toString(); 1296 } 1297 template<typename A1> 1298 inline QString i18nd(const char *domain, const char *text, const A1 &a1) 1299 { 1300 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1301 return ki18nd(domain, text).subs(a1).toString(); 1302 } 1303 template<typename A1, typename A2> 1304 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2) 1305 { 1306 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1307 return ki18nd(domain, text).subs(a1).subs(a2).toString(); 1308 } 1309 template<typename A1, typename A2, typename A3> 1310 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1311 { 1312 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1313 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).toString(); 1314 } 1315 template<typename A1, typename A2, typename A3, typename A4> 1316 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1317 { 1318 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1319 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1320 } 1321 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1322 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1323 { 1324 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1325 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1326 } 1327 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1328 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1329 { 1330 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1331 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1332 } 1333 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1334 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1335 { 1336 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1337 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1338 } 1339 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1340 inline QString 1341 i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1342 { 1343 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1344 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1345 } 1346 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1347 inline QString i18nd(const char *domain, 1348 const char *text, 1349 const A1 &a1, 1350 const A2 &a2, 1351 const A3 &a3, 1352 const A4 &a4, 1353 const A5 &a5, 1354 const A6 &a6, 1355 const A7 &a7, 1356 const A8 &a8, 1357 const A9 &a9) 1358 { 1359 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1360 return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1361 } 1362 // <<<<<<< End of basic calls with domain 1363 1364 // >>>>> Context calls with domain 1365 // Autogenerated; contact maintainer for batch changes. 1366 inline QString i18ndc(const char *domain, const char *context, const char *text) 1367 { 1368 return ki18ndc(domain, context, text).toString(); 1369 } 1370 template<typename A1> 1371 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1) 1372 { 1373 return ki18ndc(domain, context, text).subs(a1).toString(); 1374 } 1375 template<typename A1, typename A2> 1376 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2) 1377 { 1378 return ki18ndc(domain, context, text).subs(a1).subs(a2).toString(); 1379 } 1380 template<typename A1, typename A2, typename A3> 1381 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1382 { 1383 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).toString(); 1384 } 1385 template<typename A1, typename A2, typename A3, typename A4> 1386 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1387 { 1388 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1389 } 1390 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1391 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1392 { 1393 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1394 } 1395 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1396 inline QString 1397 i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1398 { 1399 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1400 } 1401 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1402 inline QString i18ndc(const char *domain, 1403 const char *context, 1404 const char *text, 1405 const A1 &a1, 1406 const A2 &a2, 1407 const A3 &a3, 1408 const A4 &a4, 1409 const A5 &a5, 1410 const A6 &a6, 1411 const A7 &a7) 1412 { 1413 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1414 } 1415 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1416 inline QString i18ndc(const char *domain, 1417 const char *context, 1418 const char *text, 1419 const A1 &a1, 1420 const A2 &a2, 1421 const A3 &a3, 1422 const A4 &a4, 1423 const A5 &a5, 1424 const A6 &a6, 1425 const A7 &a7, 1426 const A8 &a8) 1427 { 1428 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1429 } 1430 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1431 inline QString i18ndc(const char *domain, 1432 const char *context, 1433 const char *text, 1434 const A1 &a1, 1435 const A2 &a2, 1436 const A3 &a3, 1437 const A4 &a4, 1438 const A5 &a5, 1439 const A6 &a6, 1440 const A7 &a7, 1441 const A8 &a8, 1442 const A9 &a9) 1443 { 1444 return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1445 } 1446 // <<<<< End of context calls with domain 1447 1448 // >>>>> Plural calls with domain 1449 // Autogenerated; contact maintainer for batch changes. 1450 template<typename A1> 1451 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1) 1452 { 1453 return ki18ndp(domain, singular, plural).subs(a1).toString(); 1454 } 1455 template<typename A1, typename A2> 1456 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1457 { 1458 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).toString(); 1459 } 1460 template<typename A1, typename A2, typename A3> 1461 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1462 { 1463 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1464 } 1465 template<typename A1, typename A2, typename A3, typename A4> 1466 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1467 { 1468 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1469 } 1470 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1471 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1472 { 1473 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1474 } 1475 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1476 inline QString 1477 i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1478 { 1479 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1480 } 1481 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1482 inline QString i18ndp(const char *domain, 1483 const char *singular, 1484 const char *plural, 1485 const A1 &a1, 1486 const A2 &a2, 1487 const A3 &a3, 1488 const A4 &a4, 1489 const A5 &a5, 1490 const A6 &a6, 1491 const A7 &a7) 1492 { 1493 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1494 } 1495 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1496 inline QString i18ndp(const char *domain, 1497 const char *singular, 1498 const char *plural, 1499 const A1 &a1, 1500 const A2 &a2, 1501 const A3 &a3, 1502 const A4 &a4, 1503 const A5 &a5, 1504 const A6 &a6, 1505 const A7 &a7, 1506 const A8 &a8) 1507 { 1508 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1509 } 1510 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1511 inline QString i18ndp(const char *domain, 1512 const char *singular, 1513 const char *plural, 1514 const A1 &a1, 1515 const A2 &a2, 1516 const A3 &a3, 1517 const A4 &a4, 1518 const A5 &a5, 1519 const A6 &a6, 1520 const A7 &a7, 1521 const A8 &a8, 1522 const A9 &a9) 1523 { 1524 return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1525 } 1526 // <<<<< End of plural calls with domain 1527 1528 // >>>>> Context-plural calls with domain 1529 // Autogenerated; contact maintainer for batch changes. 1530 template<typename A1> 1531 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1) 1532 { 1533 return ki18ndcp(domain, context, singular, plural).subs(a1).toString(); 1534 } 1535 template<typename A1, typename A2> 1536 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1537 { 1538 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).toString(); 1539 } 1540 template<typename A1, typename A2, typename A3> 1541 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1542 { 1543 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1544 } 1545 template<typename A1, typename A2, typename A3, typename A4> 1546 inline QString 1547 i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1548 { 1549 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1550 } 1551 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1552 inline QString 1553 i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1554 { 1555 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1556 } 1557 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1558 inline QString i18ndcp(const char *domain, 1559 const char *context, 1560 const char *singular, 1561 const char *plural, 1562 const A1 &a1, 1563 const A2 &a2, 1564 const A3 &a3, 1565 const A4 &a4, 1566 const A5 &a5, 1567 const A6 &a6) 1568 { 1569 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1570 } 1571 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1572 inline QString i18ndcp(const char *domain, 1573 const char *context, 1574 const char *singular, 1575 const char *plural, 1576 const A1 &a1, 1577 const A2 &a2, 1578 const A3 &a3, 1579 const A4 &a4, 1580 const A5 &a5, 1581 const A6 &a6, 1582 const A7 &a7) 1583 { 1584 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1585 } 1586 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1587 inline QString i18ndcp(const char *domain, 1588 const char *context, 1589 const char *singular, 1590 const char *plural, 1591 const A1 &a1, 1592 const A2 &a2, 1593 const A3 &a3, 1594 const A4 &a4, 1595 const A5 &a5, 1596 const A6 &a6, 1597 const A7 &a7, 1598 const A8 &a8) 1599 { 1600 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1601 } 1602 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1603 inline QString i18ndcp(const char *domain, 1604 const char *context, 1605 const char *singular, 1606 const char *plural, 1607 const A1 &a1, 1608 const A2 &a2, 1609 const A3 &a3, 1610 const A4 &a4, 1611 const A5 &a5, 1612 const A6 &a6, 1613 const A7 &a7, 1614 const A8 &a8, 1615 const A9 &a9) 1616 { 1617 return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1618 } 1619 // <<<<< End of context-plural calls with domain 1620 1621 // >>>>> Markup-aware basic calls 1622 // Autogenerated; contact maintainer for batch changes. 1623 inline QString xi18n(const char *text) 1624 { 1625 return kxi18n(text).toString(); 1626 } 1627 template<typename A1> 1628 inline QString xi18n(const char *text, const A1 &a1) 1629 { 1630 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1631 return kxi18n(text).subs(a1).toString(); 1632 } 1633 template<typename A1, typename A2> 1634 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2) 1635 { 1636 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1637 return kxi18n(text).subs(a1).subs(a2).toString(); 1638 } 1639 template<typename A1, typename A2, typename A3> 1640 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1641 { 1642 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1643 return kxi18n(text).subs(a1).subs(a2).subs(a3).toString(); 1644 } 1645 template<typename A1, typename A2, typename A3, typename A4> 1646 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1647 { 1648 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1649 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1650 } 1651 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1652 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1653 { 1654 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1655 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1656 } 1657 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1658 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1659 { 1660 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1661 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1662 } 1663 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1664 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1665 { 1666 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1667 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1668 } 1669 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1670 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1671 { 1672 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1673 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1674 } 1675 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1676 inline QString 1677 xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) 1678 { 1679 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1680 return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1681 } 1682 // <<<<<<< End of markup-aware basic calls 1683 1684 // >>>>> Markup-aware context calls 1685 // Autogenerated; contact maintainer for batch changes. 1686 inline QString xi18nc(const char *context, const char *text) 1687 { 1688 return kxi18nc(context, text).toString(); 1689 } 1690 template<typename A1> 1691 inline QString xi18nc(const char *context, const char *text, const A1 &a1) 1692 { 1693 return kxi18nc(context, text).subs(a1).toString(); 1694 } 1695 template<typename A1, typename A2> 1696 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2) 1697 { 1698 return kxi18nc(context, text).subs(a1).subs(a2).toString(); 1699 } 1700 template<typename A1, typename A2, typename A3> 1701 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1702 { 1703 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).toString(); 1704 } 1705 template<typename A1, typename A2, typename A3, typename A4> 1706 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1707 { 1708 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1709 } 1710 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1711 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1712 { 1713 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1714 } 1715 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1716 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1717 { 1718 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1719 } 1720 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1721 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1722 { 1723 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1724 } 1725 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1726 inline QString 1727 xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1728 { 1729 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1730 } 1731 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1732 inline QString xi18nc(const char *context, 1733 const char *text, 1734 const A1 &a1, 1735 const A2 &a2, 1736 const A3 &a3, 1737 const A4 &a4, 1738 const A5 &a5, 1739 const A6 &a6, 1740 const A7 &a7, 1741 const A8 &a8, 1742 const A9 &a9) 1743 { 1744 return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1745 } 1746 // <<<<< End of markup-aware context calls 1747 1748 // >>>>> Markup-aware plural calls 1749 // Autogenerated; contact maintainer for batch changes. 1750 template<typename A1> 1751 inline QString xi18np(const char *singular, const char *plural, const A1 &a1) 1752 { 1753 return kxi18np(singular, plural).subs(a1).toString(); 1754 } 1755 template<typename A1, typename A2> 1756 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1757 { 1758 return kxi18np(singular, plural).subs(a1).subs(a2).toString(); 1759 } 1760 template<typename A1, typename A2, typename A3> 1761 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1762 { 1763 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1764 } 1765 template<typename A1, typename A2, typename A3, typename A4> 1766 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1767 { 1768 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1769 } 1770 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1771 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1772 { 1773 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1774 } 1775 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1776 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1777 { 1778 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1779 } 1780 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1781 inline QString 1782 xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1783 { 1784 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1785 } 1786 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1787 inline QString 1788 xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1789 { 1790 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1791 } 1792 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1793 inline QString xi18np(const char *singular, 1794 const char *plural, 1795 const A1 &a1, 1796 const A2 &a2, 1797 const A3 &a3, 1798 const A4 &a4, 1799 const A5 &a5, 1800 const A6 &a6, 1801 const A7 &a7, 1802 const A8 &a8, 1803 const A9 &a9) 1804 { 1805 return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1806 } 1807 // <<<<< End of markup-aware plural calls 1808 1809 // >>>>> Markup-aware context-plural calls 1810 // Autogenerated; contact maintainer for batch changes. 1811 template<typename A1> 1812 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1) 1813 { 1814 return kxi18ncp(context, singular, plural).subs(a1).toString(); 1815 } 1816 template<typename A1, typename A2> 1817 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 1818 { 1819 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).toString(); 1820 } 1821 template<typename A1, typename A2, typename A3> 1822 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 1823 { 1824 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 1825 } 1826 template<typename A1, typename A2, typename A3, typename A4> 1827 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1828 { 1829 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1830 } 1831 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1832 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1833 { 1834 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1835 } 1836 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1837 inline QString 1838 xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1839 { 1840 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1841 } 1842 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1843 inline QString xi18ncp(const char *context, 1844 const char *singular, 1845 const char *plural, 1846 const A1 &a1, 1847 const A2 &a2, 1848 const A3 &a3, 1849 const A4 &a4, 1850 const A5 &a5, 1851 const A6 &a6, 1852 const A7 &a7) 1853 { 1854 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1855 } 1856 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1857 inline QString xi18ncp(const char *context, 1858 const char *singular, 1859 const char *plural, 1860 const A1 &a1, 1861 const A2 &a2, 1862 const A3 &a3, 1863 const A4 &a4, 1864 const A5 &a5, 1865 const A6 &a6, 1866 const A7 &a7, 1867 const A8 &a8) 1868 { 1869 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1870 } 1871 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1872 inline QString xi18ncp(const char *context, 1873 const char *singular, 1874 const char *plural, 1875 const A1 &a1, 1876 const A2 &a2, 1877 const A3 &a3, 1878 const A4 &a4, 1879 const A5 &a5, 1880 const A6 &a6, 1881 const A7 &a7, 1882 const A8 &a8, 1883 const A9 &a9) 1884 { 1885 return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1886 } 1887 // <<<<< End of markup-aware context-plural calls 1888 1889 // >>>>> Markup-aware basic calls with domain 1890 // Autogenerated; contact maintainer for batch changes. 1891 inline QString xi18nd(const char *domain, const char *text) 1892 { 1893 return kxi18nd(domain, text).toString(); 1894 } 1895 template<typename A1> 1896 inline QString xi18nd(const char *domain, const char *text, const A1 &a1) 1897 { 1898 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1899 return kxi18nd(domain, text).subs(a1).toString(); 1900 } 1901 template<typename A1, typename A2> 1902 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2) 1903 { 1904 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1905 return kxi18nd(domain, text).subs(a1).subs(a2).toString(); 1906 } 1907 template<typename A1, typename A2, typename A3> 1908 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1909 { 1910 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1911 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).toString(); 1912 } 1913 template<typename A1, typename A2, typename A3, typename A4> 1914 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1915 { 1916 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1917 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1918 } 1919 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1920 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1921 { 1922 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1923 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1924 } 1925 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1926 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1927 { 1928 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1929 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1930 } 1931 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 1932 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) 1933 { 1934 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1935 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 1936 } 1937 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 1938 inline QString 1939 xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) 1940 { 1941 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1942 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 1943 } 1944 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 1945 inline QString xi18nd(const char *domain, 1946 const char *text, 1947 const A1 &a1, 1948 const A2 &a2, 1949 const A3 &a3, 1950 const A4 &a4, 1951 const A5 &a5, 1952 const A6 &a6, 1953 const A7 &a7, 1954 const A8 &a8, 1955 const A9 &a9) 1956 { 1957 STATIC_ASSERT_NOT_LITERAL_STRING(A1) 1958 return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 1959 } 1960 // <<<<<<< End of markup-aware basic calls with domain 1961 1962 // >>>>> Markup-aware context calls with domain 1963 // Autogenerated; contact maintainer for batch changes. 1964 inline QString xi18ndc(const char *domain, const char *context, const char *text) 1965 { 1966 return kxi18ndc(domain, context, text).toString(); 1967 } 1968 template<typename A1> 1969 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1) 1970 { 1971 return kxi18ndc(domain, context, text).subs(a1).toString(); 1972 } 1973 template<typename A1, typename A2> 1974 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2) 1975 { 1976 return kxi18ndc(domain, context, text).subs(a1).subs(a2).toString(); 1977 } 1978 template<typename A1, typename A2, typename A3> 1979 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3) 1980 { 1981 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).toString(); 1982 } 1983 template<typename A1, typename A2, typename A3, typename A4> 1984 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 1985 { 1986 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 1987 } 1988 template<typename A1, typename A2, typename A3, typename A4, typename A5> 1989 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 1990 { 1991 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 1992 } 1993 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 1994 inline QString 1995 xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 1996 { 1997 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 1998 } 1999 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 2000 inline QString xi18ndc(const char *domain, 2001 const char *context, 2002 const char *text, 2003 const A1 &a1, 2004 const A2 &a2, 2005 const A3 &a3, 2006 const A4 &a4, 2007 const A5 &a5, 2008 const A6 &a6, 2009 const A7 &a7) 2010 { 2011 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 2012 } 2013 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 2014 inline QString xi18ndc(const char *domain, 2015 const char *context, 2016 const char *text, 2017 const A1 &a1, 2018 const A2 &a2, 2019 const A3 &a3, 2020 const A4 &a4, 2021 const A5 &a5, 2022 const A6 &a6, 2023 const A7 &a7, 2024 const A8 &a8) 2025 { 2026 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 2027 } 2028 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 2029 inline QString xi18ndc(const char *domain, 2030 const char *context, 2031 const char *text, 2032 const A1 &a1, 2033 const A2 &a2, 2034 const A3 &a3, 2035 const A4 &a4, 2036 const A5 &a5, 2037 const A6 &a6, 2038 const A7 &a7, 2039 const A8 &a8, 2040 const A9 &a9) 2041 { 2042 return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 2043 } 2044 // <<<<< End of markup-aware context calls with domain 2045 2046 // >>>>> Markup-aware plural calls with domain 2047 // Autogenerated; contact maintainer for batch changes. 2048 template<typename A1> 2049 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1) 2050 { 2051 return kxi18ndp(domain, singular, plural).subs(a1).toString(); 2052 } 2053 template<typename A1, typename A2> 2054 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 2055 { 2056 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).toString(); 2057 } 2058 template<typename A1, typename A2, typename A3> 2059 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 2060 { 2061 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 2062 } 2063 template<typename A1, typename A2, typename A3, typename A4> 2064 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 2065 { 2066 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 2067 } 2068 template<typename A1, typename A2, typename A3, typename A4, typename A5> 2069 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) 2070 { 2071 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 2072 } 2073 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 2074 inline QString 2075 xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) 2076 { 2077 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 2078 } 2079 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 2080 inline QString xi18ndp(const char *domain, 2081 const char *singular, 2082 const char *plural, 2083 const A1 &a1, 2084 const A2 &a2, 2085 const A3 &a3, 2086 const A4 &a4, 2087 const A5 &a5, 2088 const A6 &a6, 2089 const A7 &a7) 2090 { 2091 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 2092 } 2093 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 2094 inline QString xi18ndp(const char *domain, 2095 const char *singular, 2096 const char *plural, 2097 const A1 &a1, 2098 const A2 &a2, 2099 const A3 &a3, 2100 const A4 &a4, 2101 const A5 &a5, 2102 const A6 &a6, 2103 const A7 &a7, 2104 const A8 &a8) 2105 { 2106 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 2107 } 2108 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 2109 inline QString xi18ndp(const char *domain, 2110 const char *singular, 2111 const char *plural, 2112 const A1 &a1, 2113 const A2 &a2, 2114 const A3 &a3, 2115 const A4 &a4, 2116 const A5 &a5, 2117 const A6 &a6, 2118 const A7 &a7, 2119 const A8 &a8, 2120 const A9 &a9) 2121 { 2122 return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 2123 } 2124 // <<<<< End of markup-aware plural calls with domain 2125 2126 // >>>>> Markup-aware context-plural calls with domain 2127 // Autogenerated; contact maintainer for batch changes. 2128 template<typename A1> 2129 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1) 2130 { 2131 return kxi18ndcp(domain, context, singular, plural).subs(a1).toString(); 2132 } 2133 template<typename A1, typename A2> 2134 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2) 2135 { 2136 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).toString(); 2137 } 2138 template<typename A1, typename A2, typename A3> 2139 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3) 2140 { 2141 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).toString(); 2142 } 2143 template<typename A1, typename A2, typename A3, typename A4> 2144 inline QString 2145 xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) 2146 { 2147 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString(); 2148 } 2149 template<typename A1, typename A2, typename A3, typename A4, typename A5> 2150 inline QString xi18ndcp(const char *domain, 2151 const char *context, 2152 const char *singular, 2153 const char *plural, 2154 const A1 &a1, 2155 const A2 &a2, 2156 const A3 &a3, 2157 const A4 &a4, 2158 const A5 &a5) 2159 { 2160 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString(); 2161 } 2162 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> 2163 inline QString xi18ndcp(const char *domain, 2164 const char *context, 2165 const char *singular, 2166 const char *plural, 2167 const A1 &a1, 2168 const A2 &a2, 2169 const A3 &a3, 2170 const A4 &a4, 2171 const A5 &a5, 2172 const A6 &a6) 2173 { 2174 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString(); 2175 } 2176 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> 2177 inline QString xi18ndcp(const char *domain, 2178 const char *context, 2179 const char *singular, 2180 const char *plural, 2181 const A1 &a1, 2182 const A2 &a2, 2183 const A3 &a3, 2184 const A4 &a4, 2185 const A5 &a5, 2186 const A6 &a6, 2187 const A7 &a7) 2188 { 2189 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString(); 2190 } 2191 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> 2192 inline QString xi18ndcp(const char *domain, 2193 const char *context, 2194 const char *singular, 2195 const char *plural, 2196 const A1 &a1, 2197 const A2 &a2, 2198 const A3 &a3, 2199 const A4 &a4, 2200 const A5 &a5, 2201 const A6 &a6, 2202 const A7 &a7, 2203 const A8 &a8) 2204 { 2205 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString(); 2206 } 2207 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> 2208 inline QString xi18ndcp(const char *domain, 2209 const char *context, 2210 const char *singular, 2211 const char *plural, 2212 const A1 &a1, 2213 const A2 &a2, 2214 const A3 &a3, 2215 const A4 &a4, 2216 const A5 &a5, 2217 const A6 &a6, 2218 const A7 &a7, 2219 const A8 &a8, 2220 const A9 &a9) 2221 { 2222 return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString(); 2223 } 2224 // <<<<< End of markup-aware context-plural calls with domain 2225 2226 #endif // K_DOXYGEN 2227 2228 #endif // KLOCALIZEDSTRING_H 2229 2230 #ifndef K_DOXYGEN 2231 2232 // Outside of include guards, to be able to map and unmap domains 2233 // by successive inclusions of this header 2234 // preceded with different definitions of TRANSLATION_DOMAIN. 2235 #ifdef TRANSLATION_DOMAIN 2236 #define i18n(...) i18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2237 #define i18nc(...) i18ndc(TRANSLATION_DOMAIN, __VA_ARGS__) 2238 #define i18np(...) i18ndp(TRANSLATION_DOMAIN, __VA_ARGS__) 2239 #define i18ncp(...) i18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__) 2240 #define ki18n(...) ki18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2241 #define ki18nc(...) ki18ndc(TRANSLATION_DOMAIN, __VA_ARGS__) 2242 #define ki18np(...) ki18ndp(TRANSLATION_DOMAIN, __VA_ARGS__) 2243 #define ki18ncp(...) ki18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__) 2244 #define tr2i18n(...) tr2i18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2245 #define xi18n(...) xi18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2246 #define xi18nc(...) xi18ndc(TRANSLATION_DOMAIN, __VA_ARGS__) 2247 #define xi18np(...) xi18ndp(TRANSLATION_DOMAIN, __VA_ARGS__) 2248 #define xi18ncp(...) xi18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__) 2249 #define kxi18n(...) kxi18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2250 #define kxi18nc(...) kxi18ndc(TRANSLATION_DOMAIN, __VA_ARGS__) 2251 #define kxi18np(...) kxi18ndp(TRANSLATION_DOMAIN, __VA_ARGS__) 2252 #define kxi18ncp(...) kxi18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__) 2253 #define tr2xi18n(...) tr2xi18nd(TRANSLATION_DOMAIN, __VA_ARGS__) 2254 #else 2255 #undef i18n 2256 #undef i18nc 2257 #undef i18np 2258 #undef i18ncp 2259 #undef ki18n 2260 #undef ki18nc 2261 #undef ki18np 2262 #undef ki18ncp 2263 #undef tr2i18n 2264 #undef xi18n 2265 #undef xi18nc 2266 #undef xi18np 2267 #undef xi18ncp 2268 #undef kxi18n 2269 #undef kxi18nc 2270 #undef kxi18np 2271 #undef kxi18ncp 2272 #undef tr2xi18n 2273 #endif 2274 2275 #endif // K_DOXYGEN