KI18n

klocalizedstring.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  SPDX-FileCopyrightText: 2006, 2013 Chusslove Illich <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #ifndef KLOCALIZEDSTRING_H
7 #define KLOCALIZEDSTRING_H
8 
9 #include <ki18n_export.h>
10 
11 #include <QChar>
12 #include <QLatin1Char>
13 #include <QSet>
14 #include <QString>
15 #include <QStringList>
16 
17 #include <memory>
18 
19 #include <kuitmarkup.h>
20 
21 // enforce header to be parsed before redefining i18n* with preprocessor macros
22 // depending on TRANSLATION_DOMAIN (see bottom of file)
23 #include <klocalizedcontext.h>
24 
25 class KLocalizedStringPrivate;
27 
28 /**
29  * \file klocalizedstring.h
30  */
31 
32 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 89)
33 #ifndef I18N_NOOP
34 /**
35  * Wrap string for extraction.
36  *
37  * See \ref i18n_noop for use cases.
38  *
39  * \deprecated since 5.89, use @c kli18n() instead.
40  */
41 #define I18N_NOOP(text) text
42 #endif
43 #endif
44 
45 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 89)
46 #ifndef I18NC_NOOP
47 /**
48  * Wrap string with context for extraction.
49  *
50  * See \ref i18n_noop for use cases.
51  *
52  * \deprecated since 5.89, use @c kli18nc() instead.
53  */
54 #define I18NC_NOOP(context, text) context, text
55 #endif
56 #endif
57 
58 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 89)
59 #ifndef I18N_NOOP2
60 /**
61  * Wrap string with context for extraction, discarding context.
62  * WARNING: this means you'll need to pass the exact same context when calling i18nc() later on.
63  * Do not make typos...
64  * The preferred solution is to use I18NC_NOOP and store both @p context and @p text.
65  * I18NC_NOOP2 exists for cases where storing the context is not possible.
66  *
67  * \deprecated between 5.0 and 5.64, re-enabled in 5.65, re-deprecated in 5.89, use @p kli18nc() instead.
68  */
69 #define I18N_NOOP2(context, text) text
70 #endif
71 #endif
72 
73 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 0)
74 #ifndef I18N_NOOP2_NOSTRIP
75 /**
76  * Wrap string with context for extraction.
77  *
78  * \deprecated Since 5.0, use \c I18NC_NOOP.
79  */
80 #define I18N_NOOP2_NOSTRIP(context, text) context, text
81 #endif
82 #endif // KI18N_ENABLE_DEPRECATED_SINCE(5, 0)
83 
84 /**
85  * @class KLocalizedString klocalizedstring.h <KLocalizedString>
86  *
87  * \short Class for producing and handling localized messages
88  *
89  * \c KLocalizedString handles translation and
90  * argument substitution and formatting of user-visible text.
91  *
92  * \c KLocalizedString instances are usually not constructed directly,
93  * but through one of the wrapper \c \*i18n\* calls.
94  *
95  * For detailed information on how to use KI18n functions please refer
96  * to \ref prg_guide.
97  */
98 class KI18N_EXPORT KLocalizedString
99 {
100  friend class KLocalizedStringPrivate;
101  friend class KLazyLocalizedString;
102 
103  friend KLocalizedString KI18N_EXPORT ki18n(const char *text);
104  friend KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text);
105  friend KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural);
106  friend KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural);
107  friend KLocalizedString KI18N_EXPORT ki18nd(const char *domain, const char *text);
108  friend KLocalizedString KI18N_EXPORT ki18ndc(const char *domain, const char *context, const char *text);
109  friend KLocalizedString KI18N_EXPORT ki18ndp(const char *domain, const char *singular, const char *plural);
110  friend KLocalizedString KI18N_EXPORT ki18ndcp(const char *domain, const char *context, const char *singular, const char *plural);
111 
112  friend KLocalizedString KI18N_EXPORT kxi18n(const char *text);
113  friend KLocalizedString KI18N_EXPORT kxi18nc(const char *context, const char *text);
114  friend KLocalizedString KI18N_EXPORT kxi18np(const char *singular, const char *plural);
115  friend KLocalizedString KI18N_EXPORT kxi18ncp(const char *context, const char *singular, const char *plural);
116  friend KLocalizedString KI18N_EXPORT kxi18nd(const char *domain, const char *text);
117  friend KLocalizedString KI18N_EXPORT kxi18ndc(const char *domain, const char *context, const char *text);
118  friend KLocalizedString KI18N_EXPORT kxi18ndp(const char *domain, const char *singular, const char *plural);
119  friend KLocalizedString KI18N_EXPORT kxi18ndcp(const char *domain, const char *context, const char *singular, const char *plural);
120 
121 public:
122  /**
123  * Construct an empty message.
124  *
125  * Direct construction is used when another \c KLocalizedString instance,
126  * obtained by one of \c ki18n\* calls, should later be assigned
127  * to directly constructed instance.
128  * Before the assignment happens, directly constructed instance
129  * is not valid for finalization by \c toString methods.
130  *
131  * \see isEmpty
132  */
133  explicit KLocalizedString();
134 
135  /**
136  * Copy constructor.
137  */
139 
140  /**
141  * Assignment operator.
142  */
143  KLocalizedString &operator=(const KLocalizedString &rhs);
144 
145  /**
146  * Destructor.
147  */
148  ~KLocalizedString();
149 
150  /**
151  * Check whether the message is empty.
152  *
153  * The message is considered empty if the object was constructed
154  * via the default constructor.
155  *
156  * Empty messages are not valid for finalization.
157  * The behavior of calling \c toString on them is undefined.
158  * In debug mode, an error mark may appear in the returned string.
159  *
160  * \return \c true if the message is empty, \c false otherwise
161  */
162  bool isEmpty() const;
163 
164  /**
165  * Finalize the translation.
166  *
167  * Creates translated \c QString, with placeholders substituted
168  * by arguments given by \c KLocalizedString::subs methods.
169  * Translated text is searched for and arguments are formatted
170  * based on the global locale.
171  *
172  * If there was any mismatch between placeholders and arguments,
173  * in debug mode the returned string may contain error marks.
174  *
175  * \return finalized translation
176  */
177  Q_REQUIRED_RESULT QString toString() const;
178 
179  /**
180  * Like \c toString, but look for translation only in given languages.
181  *
182  * Given languages override languages defined by the global locale,
183  * and any languages set earlier using \c withLanguages.
184  * If \p languages is empty, original message is returned.
185  *
186  * \param languages list of language codes (by decreasing priority)
187  * \return finalized translation
188  */
189  Q_REQUIRED_RESULT QString toString(const QStringList &languages) const;
190 
191 #if 0 // until locale system is ready
192  /**
193  * Like \c toString, but look for translation based on given locale.
194  *
195  * Given locale overrides any set earlier using \c withLocale.
196  * If \p locale is \c NULL, original message is returned.
197  *
198  * \param locale the locale for which translations are made
199  * \return finalized translation
200  */
201  QString toString(const KLocale *locale) const;
202 #endif
203 
204  /**
205  * Like \c toString, but look for translation in the given domain.
206  *
207  * Given domain overrides any set earlier using \c withDomain.
208  *
209  * \param domain the translation domain
210  * \return finalized translation
211  */
212  Q_REQUIRED_RESULT QString toString(const char *domain) const;
213 
214  /**
215  * Like \c toString, but resolve KUIT markup into given visual format.
216  *
217  * Given visual format overrides that implied by the context UI marker
218  * or set earlier using \c withFormat.
219  * If the message is not markup-aware,
220  * this is same as \c toString without arguments.
221  *
222  * \param format the target visual format
223  * \return finalized translation
224  */
225  Q_REQUIRED_RESULT QString toString(Kuit::VisualFormat format) const;
226 
227  /**
228  * Indicate to look for translation only in given languages.
229  *
230  * \param languages list of language codes (by decreasing priority)
231  * \return updated \c KLocalizedString
232  */
233  Q_REQUIRED_RESULT KLocalizedString withLanguages(const QStringList &languages) const;
234 
235 #if 0 // until locale system is ready
236  /**
237  * Indicate to look for translation based on given locale.
238  *
239  * \param locale the locale for which translations are made
240  * \return updated \c KLocalizedString
241  */
242  KLocalizedString withLocale(const KLocale *locale) const;
243 #endif
244 
245  /**
246  * Indicate to look for translation in the given domain.
247  *
248  * \param domain the translation domain
249  * \return updated \c KLocalizedString
250  */
251  Q_REQUIRED_RESULT KLocalizedString withDomain(const char *domain) const;
252 
253  /**
254  * Indicate to resolve KUIT markup into given visual format.
255  *
256  * If the message is not markup-aware, this has no effect.
257  *
258  * \param format the target visual format
259  * \return updated \c KLocalizedString
260  */
261  Q_REQUIRED_RESULT KLocalizedString withFormat(Kuit::VisualFormat format) const;
262 
263  /**
264  * Substitute an int argument into the message.
265  *
266  * \param a the argument
267  * \param fieldWidth width of the formatted field, padded by spaces.
268  * Positive value aligns right, negative aligns left
269  * \param base the radix used to represent the number as a string.
270  * Valid values range from 2 to 36
271  * \param fillChar the character used to fill up the empty places when
272  * field width is greater than argument width
273  * \return updated \c KLocalizedString
274  */
275  Q_REQUIRED_RESULT KLocalizedString subs(int a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
276 
277  /**
278  * Substitute an unsigned int argument into the message.
279  *
280  * \param a the argument
281  * \param fieldWidth width of the formatted field, padded by spaces.
282  * Positive value aligns right, negative aligns left
283  * \param base the radix used to represent the number as a string.
284  * Valid values range from 2 to 36
285  * \param fillChar the character used to fill up the empty places when
286  * field width is greater than argument width
287  * \return updated \c KLocalizedString
288  */
289  Q_REQUIRED_RESULT KLocalizedString subs(uint a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
290 
291  /**
292  * Substitute a long argument into the message.
293  *
294  * \param a the argument
295  * \param fieldWidth width of the formatted field, padded by spaces.
296  * Positive value aligns right, negative aligns left
297  * \param base the radix used to represent the number as a string.
298  * Valid values range from 2 to 36
299  * \param fillChar the character used to fill up the empty places when
300  * field width is greater than argument width
301  * \return updated \c KLocalizedString
302  */
303  Q_REQUIRED_RESULT KLocalizedString subs(long a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
304 
305  /**
306  * Substitute an unsigned long argument into the message.
307  *
308  * \param a the argument
309  * \param fieldWidth width of the formatted field, padded by spaces.
310  * Positive value aligns right, negative aligns left
311  * \param base the radix used to represent the number as a string.
312  * Valid values range from 2 to 36
313  * \param fillChar the character used to fill up the empty places when
314  * field width is greater than argument width
315  * \return updated \c KLocalizedString
316  */
317  Q_REQUIRED_RESULT KLocalizedString subs(ulong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
318 
319  /**
320  * Substitute a long long argument into the message.
321  *
322  * \param a the argument
323  * \param fieldWidth width of the formatted field, padded by spaces.
324  * Positive value aligns right, negative aligns left
325  * \param base the radix used to represent the number as a string.
326  * Valid values range from 2 to 36
327  * \param fillChar the character used to fill up the empty places when
328  * field width is greater than argument width
329  * \return updated \c KLocalizedString
330  */
331  Q_REQUIRED_RESULT KLocalizedString subs(qlonglong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
332 
333  /**
334  * Substitute an unsigned long long argument into the message.
335  *
336  * \param a the argument
337  * \param fieldWidth width of the formatted field, padded by spaces.
338  * Positive value aligns right, negative aligns left
339  * \param base the radix used to represent the number as a string.
340  * Valid values range from 2 to 36
341  * \param fillChar the character used to fill up the empty places when
342  * field width is greater than argument width
343  * \return updated \c KLocalizedString
344  */
345  Q_REQUIRED_RESULT KLocalizedString subs(qulonglong a, int fieldWidth = 0, int base = 10, QChar fillChar = QLatin1Char(' ')) const;
346 
347  /**
348  * Substitute a double argument into the message.
349  *
350  * \param a the argument
351  * \param fieldWidth width of the formatted field, padded by spaces.
352  * Positive value aligns right, negative aligns left
353  * \param format type of floating point formatting, like in QString::arg
354  * \param precision number of digits after the decimal separator
355  * \param fillChar the character used to fill up the empty places when
356  * field width is greater than argument width
357  * \return updated \c KLocalizedString
358  */
359  Q_REQUIRED_RESULT KLocalizedString subs(double a, int fieldWidth = 0, char format = 'g', int precision = -1, QChar fillChar = QLatin1Char(' ')) const;
360 
361  /**
362  * Substitute a \c QChar argument into the message.
363  *
364  * \param a the argument
365  * \param fieldWidth width of the formatted field, padded by spaces.
366  * Positive value aligns right, negative aligns left
367  * \param fillChar the character used to fill up the empty places when
368  * field width is greater than argument width
369  * \return updated \c KLocalizedString
370  */
371  Q_REQUIRED_RESULT KLocalizedString subs(QChar a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const;
372 
373  /**
374  * Substitute a \c QString argument into the message.
375  *
376  * \param a the argument
377  * \param fieldWidth width of the formatted field, padded by spaces.
378  * Positive value aligns right, negative aligns left
379  * \param fillChar the character used to fill up the empty places when
380  * field width is greater than argument width
381  * \return updated \c KLocalizedString
382  */
383  Q_REQUIRED_RESULT KLocalizedString subs(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const;
384 
385  /**
386  * Substitute another \c KLocalizedString into the message.
387  *
388  * \param a the argument
389  * \param fieldWidth width of the formatted field, padded by spaces.
390  * Positive value aligns right, negative aligns left
391  * \param fillChar the character used to fill up the empty places when
392  * field width is greater than argument width
393  * \return updated \c KLocalizedString
394  */
395  Q_REQUIRED_RESULT KLocalizedString subs(const KLocalizedString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char(' ')) const;
396 
397  /**
398  * Add dynamic context to the message.
399  *
400  * See \ref dyn_ctxt for use cases.
401  *
402  * \param key context key
403  * \param value context value
404  * \return updated \c KLocalizedString
405  */
406  Q_REQUIRED_RESULT KLocalizedString inContext(const QString &key, const QString &value) const;
407 
408  /**
409  * Relax matching between placeholders and arguments.
410  *
411  * Normally the placeholders should start from %1 and have no gaps,
412  * and on finalization there must be exactly as many arguments
413  * supplied through \c subs methods as there are unique plaecholders.
414  * If this is not satisfied, in debug mode warnings are printed
415  * and the finalized string may contain error marks.
416  *
417  * This method relaxes the placeholder-argument matching,
418  * such that there must only be an argument available for
419  * every present unique placeholder (taking placeholder numbers
420  * to be 1-based indices into the argument list).
421  * This can come useful in some situations.
422  *
423  * \return updated \c KLocalizedString
424  */
425  Q_REQUIRED_RESULT KLocalizedString relaxSubs() const;
426 
427  /**
428  * Do not resolve KUIT markup.
429  *
430  * If the message is markup-aware
431  * (constructed by one of \c \*xi18n\* calls),
432  * this function can be used to make it non-markup-aware.
433  * This may be useful for debugging markup.
434  *
435  * \return updated \c KLocalizedString
436  */
437  Q_REQUIRED_RESULT KLocalizedString ignoreMarkup() const;
438 
439  /**
440  * Returns the untranslated text.
441  *
442  * \since 5.64
443  */
444  Q_REQUIRED_RESULT QByteArray untranslatedText() const;
445 
446  /**
447  * Set the given domain as application's main domain.
448  *
449  * This function must be called in applications, in order to have
450  * any translations at all. It should never be called in libraries.
451  * This allows to check whether the application is translated
452  * into a given language, so that if it is not, translations from
453  * underlying libraries will not appear even if they are translated.
454  * This prevents mixing of translated and untranslated text
455  * in the user interface.
456  *
457  * This function should be called right after creating the instance
458  * of QCoreApplication or one of its subclasses. At that time the locale
459  * setup has been made, including what is hooked into the
460  * QCoreApplication startup, like KXMLGUI's language switching support.
461  * So the initialisation done by this function sees all the data it should.
462  *
463  * \param domain the translation domain of the application
464  */
465  static void setApplicationDomain(const char *domain);
466 
467  /**
468  * Get the application's main translation domain.
469  *
470  * Returns the domain set by \c setApplicationDomain.
471  */
472  static QByteArray applicationDomain();
473 
474 #if 0 // until locale system is ready
475  /**
476  * Set the locale for which translations will be made.
477  *
478  * Locale determines from which languages (and in which order)
479  * to draw translations, formatting of number arguments, etc.
480  *
481  * \param locale the locale
482  * \see setLanguages
483  */
484  static void setLocale(const KLocale &locale);
485 #endif
486 
487  /**
488  * Get the languages for which translations will be made.
489  *
490  * Returned languages are ordered with decreasing priority.
491  *
492  * \return languages ordered list of language codes
493  * \see setLanguages
494  * \see clearLanguages
495  *
496  * \since 5.20.0
497  */
498  static QStringList languages();
499 
500  /**
501  * Set the languages for which translations will be made.
502  *
503  * This overrides the languages provided by the locale.
504  * Languages should be ordered with decreasing priority.
505  *
506  * \param languages ordered list of language codes
507  * \see setLocale
508  * \see clearLanguages
509  * \see languages
510  */
511  static void setLanguages(const QStringList &languages);
512 
513  /**
514  * Clear override languages.
515  *
516  * This clears the override languages, going back to those
517  * provided by the locale.
518  *
519  * \see setLanguages
520  * \see languages
521  */
522  static void clearLanguages();
523 
524  /**
525  * Check whether the translation catalog file in the given language
526  * for the set application translation domain exists.
527  *
528  * \param language the language code to check
529  * \return \c true if the translation catalog for \p language exits,
530  * \c false otherwise
531  * \see setApplicationDomain
532  */
533  static bool isApplicationTranslatedInto(const QString &language);
534 
535  /**
536  * @since 5.0
537  *
538  * Get the languages for which there exists the translation catalog file
539  * for the set application translation domain.
540  *
541  * The application domain is set by \c setApplicationDomain.
542  * If the application domain was not set, empty set is returned.
543  * If the application domain was set, the language set will always
544  * contain at least the source code language (<tt>en_US</tt>).
545  *
546  * \return set of language codes for existing translation catalogs
547  * \see setApplicationDomain
548  */
549  static QSet<QString> availableApplicationTranslations();
550 
551  /**
552  * @since 5.0
553  *
554  * Get the languages for which a translation catalog file
555  * for the passed translation domain exists.
556  *
557  * If the translation domain was not specified in the
558  * domain parameter an empty set is returned.
559  *
560  * If the application domain was set, the language set will always
561  * contain at least the source code language (<tt>en_US</tt>).
562  *
563  * \param domain query for translations of a specific domain, if an empty
564  * QByteArray is passed, an empty set will be returned
565  *
566  * \return set of language codes for existing translation catalogs
567  * \see setApplicationDomain
568  * \see availableApplicationTranslations
569  */
570  static QSet<QString> availableDomainTranslations(const QByteArray &domain);
571 
572  /**
573  * Load locales for a domain from a specific location
574  * This is useful for resources which have their translation files
575  * outside of the usual $XDG_DATA_DIRS/locales location
576  *
577  * \param the domain to load resources from
578  * \path the full file path to the locale directory
579  */
580  static void addDomainLocaleDir(const QByteArray &domain, const QString &path);
581 
582  /**
583  * Find a path to the localized file for the given original path.
584  *
585  * This is intended mainly for non-text resources (images, sounds, etc).
586  * Text resources should be handled in more specific ways.
587  *
588  * Possible localized paths are checked in turn by priority of set
589  * languages, in form of <tt><dirname>/l10n/<lang>/<basename></tt>,
590  * where <tt><dirname></tt> and <tt><basename></tt> are those of
591  * the original path, and <tt><lang></tt> is the language code.
592  *
593  * \param filePath path to the original file
594  *
595  * \return path to the localized file if found, original path otherwise
596  */
597  Q_REQUIRED_RESULT static QString localizedFilePath(const QString &filePath);
598 
599  /**
600  * Remove accelerator marker from a UI text label.
601  *
602  * Accelerator marker is not always a plain ampersand (&),
603  * so it is not enough to just remove it by \c QString::remove.
604  * The label may contain escaped markers ("&&") which must be resolved
605  * and skipped, as well as CJK-style markers ("Foo (&F)") where
606  * the whole parenthesis construct should be removed.
607  * Therefore always use this function to remove accelerator marker
608  * from UI labels.
609  *
610  * \param label UI label which may contain an accelerator marker
611  * \return label without the accelerator marker
612  */
613  Q_REQUIRED_RESULT static QString removeAcceleratorMarker(const QString &label);
614 
615 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 0)
616  /**
617  * Translate a message with Qt semantics.
618  *
619  * This functions provides a capability to derive a Qt translator from
620  * \c QTranslator and draw translations from PO catalogs of given domain.
621  * All domains added with \c insertQtDomain are checked for translation,
622  * in undefined order.
623  * No Ki18n-specific processing is performed (formatting, scripting, etc).
624  *
625  * \see QTranslator
626  *
627  * \deprecated Use Qt's native i18n system, Qt Linguist,
628  * with roundtrip TS->PO->TS through
629  * Qt's \c lupdate and \c lconvert commands.
630  */
631  KI18N_DEPRECATED_VERSION(5, 0, "See API docs")
632  Q_REQUIRED_RESULT static QString translateQt(const char *context, const char *text, const char *comment, int n);
633 #endif
634 
635 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 0)
636  /**
637  * Add another domain to search for Qt translations.
638  *
639  * \param domain the translation domain to add
640  *
641  * \see translateQt
642  * \see removeQtDomain
643  *
644  * \deprecated Since 5.0
645  */
646  KI18N_DEPRECATED_VERSION(5, 0, "See API docs")
647  static void insertQtDomain(const char *domain);
648 #endif
649 
650 #if KI18N_ENABLE_DEPRECATED_SINCE(5, 0)
651  /**
652  * Remove a domain from Qt translation lookup.
653  *
654  * To really remove the domain, this function must be invoked
655  * at least as many times as \c insertQtDomain was invoked to add
656  * this domain. This makes it safe to always use paired
657  * insertion/removal calls, without pulling out a domain
658  * underneath an unrelated piece of code that uses it as well.
659  *
660  * \param domain the translation domain to remove
661  *
662  * \see translateQt
663  * \see insertQtDomain
664  *
665  * \deprecated Since 5.0
666  */
667  KI18N_DEPRECATED_VERSION(5, 0, "See API docs")
668  static void removeQtDomain(const char *domain);
669 #endif
670 
671 private:
672  KLocalizedString(const char *domain, const char *context, const char *text, const char *plural, bool markupAware);
673 
674 private:
675  std::unique_ptr<KLocalizedStringPrivate> const d;
676 };
677 
678 // Do not document every multi-argument i18n* call separately,
679 // but provide special quasi-calls that only Doxygen sees.
680 // Placed in front of ki18n* calls, because i18n* are more basic.
681 #ifdef K_DOXYGEN
682 
683 /**
684  * Translate a string and substitute any arguments.
685  *
686  * \param text string to translate
687  * \param arg arguments to insert (0 to 9),
688  * admissible types according to \c KLocalizedString::subs methods
689  * \return translated string
690  */
691 QString i18n(const char *text, const TYPE &arg...);
692 
693 /**
694  * Translate a string with context and substitute any arguments.
695  *
696  * \param context context of the string
697  * \param text string to translate
698  * \param arg arguments to insert (0 to 9),
699  * admissible types according to \c KLocalizedString::subs methods
700  * \return translated string
701  */
702 QString i18nc(const char *context, const char *text, const TYPE &arg...);
703 
704 /**
705  * Translate a string with plural and substitute any arguments.
706  *
707  * \param singular singular form of the string to translate
708  * \param plural plural form of the string to translate
709  * \param arg arguments to insert (0 to 9),
710  * admissible types according to \c KLocalizedString::subs methods
711  * \return translated string
712  */
713 QString i18np(const char *singular, const char *plural, const TYPE &arg...);
714 
715 /**
716  * Translate a string with context and plural and substitute any arguments.
717  *
718  * \param context context of the string
719  * \param singular singular form of the string to translate
720  * \param plural plural form of the string to translate
721  * \param arg arguments to insert (0 to 9),
722  * admissible types according to \c KLocalizedString::subs methods
723  * \return translated string
724  */
725 QString i18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...);
726 
727 /**
728  * Translate a string from domain and substitute any arguments.
729  *
730  * \param domain domain in which to look for translations
731  * \param text string to translate
732  * \param arg arguments to insert (0 to 9),
733  * admissible types according to \c KLocalizedString::subs methods
734  * \return translated string
735  */
736 QString i18nd(const char *domain, const char *text, const TYPE &arg...);
737 
738 /**
739  * Translate a string from domain with context and substitute any arguments.
740  *
741  * \param domain domain in which to look for translations
742  * \param context context of the string
743  * \param text string to translate
744  * \param arg arguments to insert (0 to 9),
745  * admissible types according to \c KLocalizedString::subs methods
746  * \return translated string
747  */
748 QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...);
749 
750 /**
751  * Translate a string from domain with plural and substitute any arguments.
752  *
753  * \param domain domain in which to look for translations
754  * \param singular singular form of the string to translate
755  * \param plural plural form of the string to translate
756  * \param arg arguments to insert (0 to 9),
757  * admissible types according to \c KLocalizedString::subs methods
758  * \return translated string
759  */
760 QString i18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...);
761 
762 /**
763  * Translate a string from domain with context and plural
764  * and substitute any arguments.
765  *
766  * \param domain domain in which to look for translations
767  * \param context context of the string
768  * \param singular singular form of the string to translate
769  * \param plural plural form of the string to translate
770  * \param arg arguments to insert (0 to 9),
771  * admissible types according to \c KLocalizedString::subs methods
772  * \return translated string
773  */
774 QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...);
775 
776 /**
777  * Translate a markup-aware string and substitute any arguments.
778  *
779  * \param text string to translate
780  * \param arg arguments to insert (0 to 9),
781  * admissible types according to \c KLocalizedString::subs methods
782  * \return translated string
783  */
784 QString xi18n(const char *text, const TYPE &arg...);
785 
786 /**
787  * Translate a markup-aware string with context and substitute any arguments.
788  *
789  * \param context context of the string
790  * \param text string to translate
791  * \param arg arguments to insert (0 to 9),
792  * admissible types according to \c KLocalizedString::subs methods
793  * \return translated string
794  */
795 QString xi18nc(const char *context, const char *text, const TYPE &arg...);
796 
797 /**
798  * Translate a markup-aware string with plural and substitute any arguments.
799  *
800  * \param singular singular form of the string to translate
801  * \param plural plural form of the string to translate
802  * \param arg arguments to insert (0 to 9),
803  * admissible types according to \c KLocalizedString::subs methods
804  * \return translated string
805  */
806 QString xi18np(const char *singular, const char *plural, const TYPE &arg...);
807 
808 /**
809  * Translate a markup-aware string with context and plural
810  * and substitute any arguments.
811  *
812  * \param context context of the string
813  * \param singular singular form of the string to translate
814  * \param plural plural form of the string to translate
815  * \param arg arguments to insert (0 to 9),
816  * admissible types according to \c KLocalizedString::subs methods
817  * \return translated string
818  */
819 QString xi18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...);
820 
821 /**
822  * Translate a markup-aware string from domain and substitute any arguments.
823  *
824  * \param domain domain in which to look for translations
825  * \param text string to translate
826  * \param arg arguments to insert (0 to 9),
827  * admissible types according to \c KLocalizedString::subs methods
828  * \return translated string
829  */
830 QString xi18nd(const char *domain, const char *text, const TYPE &arg...);
831 
832 /**
833  * Translate a markup-aware string from domain with context
834  * and substitute any arguments.
835  *
836  * \param domain domain in which to look for translations
837  * \param context context of the string
838  * \param text string to translate
839  * \param arg arguments to insert (0 to 9),
840  * admissible types according to \c KLocalizedString::subs methods
841  * \return translated string
842  */
843 QString xi18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...);
844 
845 /**
846  * Translate a markup-aware string from domain with plural
847  * and substitute any arguments.
848  *
849  * \param domain domain in which to look for translations
850  * \param singular singular form of the string to translate
851  * \param plural plural form of the string to translate
852  * \param arg arguments to insert (0 to 9),
853  * admissible types according to \c KLocalizedString::subs methods
854  * \return translated string
855  */
856 QString xi18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...);
857 
858 /**
859  * Translate a markup-aware string from domain with context and plural
860  * and substitute any arguments.
861  *
862  * \param domain domain in which to look for translations
863  * \param context context of the string
864  * \param singular singular form of the string to translate
865  * \param plural plural form of the string to translate
866  * \param arg arguments to insert (0 to 9),
867  * admissible types according to \c KLocalizedString::subs methods
868  * \return translated string
869  */
870 QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...);
871 
872 #endif // K_DOXYGEN
873 
874 /**
875  * Create non-finalized translated string.
876  *
877  * \param text string to translate
878  * \return non-finalized translated string
879  */
880 KLocalizedString KI18N_EXPORT ki18n(const char *text);
881 
882 /**
883  * Create non-finalized translated string with context.
884  *
885  * \param context context of the string
886  * \param text string to translate
887  * \return non-finalized translated string
888  */
889 KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text);
890 
891 /**
892  * Create non-finalized translated string with plural.
893  *
894  * \param singular singular form of the string to translate
895  * \param plural plural form of the string to translate
896  * \return non-finalized translated string
897  */
898 KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural);
899 
900 /**
901  * Create non-finalized translated string with context and plural.
902  *
903  * \param context context of the string
904  * \param singular singular form of the string to translate
905  * \param plural plural form of the string to translate
906  * \return non-finalized translated string
907  */
908 KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural);
909 
910 /**
911  * Create non-finalized translated string from domain.
912  *
913  * \param domain domain in which to look for translations
914  * \param text string to translate
915  * \return non-finalized translated string
916  */
917 KLocalizedString KI18N_EXPORT ki18nd(const char *domain, const char *text);
918 
919 /**
920  * Create non-finalized translated string from domain with context.
921  *
922  * \param domain domain in which to look for translations
923  * \param context context of the string
924  * \param text string to translate
925  * \return non-finalized translated string
926  */
927 KLocalizedString KI18N_EXPORT ki18ndc(const char *domain, const char *context, const char *text);
928 
929 /**
930  * Create non-finalized translated string from domain with plural.
931  *
932  * \param domain domain in which to look for translations
933  * \param singular singular form of the string to translate
934  * \param plural plural form of the string to translate
935  * \return non-finalized translated string
936  */
937 KLocalizedString KI18N_EXPORT ki18ndp(const char *domain, const char *singular, const char *plural);
938 
939 /**
940  * Create non-finalized translated string from domain with context and plural.
941  *
942  * \param domain domain in which to look for translations
943  * \param context context of the string
944  * \param singular singular form of the string to translate
945  * \param plural plural form of the string to translate
946  * \return non-finalized translated string
947  */
948 KLocalizedString KI18N_EXPORT ki18ndcp(const char *domain, const char *context, const char *singular, const char *plural);
949 
950 /**
951  * Create non-finalized markup-aware translated string.
952  *
953  * \param text string to translate
954  * \return non-finalized translated string
955  */
956 KLocalizedString KI18N_EXPORT kxi18n(const char *text);
957 
958 /**
959  * Create non-finalized markup-aware translated string with context.
960  *
961  * \param context context of the string
962  * \param text string to translate
963  * \return non-finalized translated string
964  */
965 KLocalizedString KI18N_EXPORT kxi18nc(const char *context, const char *text);
966 
967 /**
968  * Create non-finalized markup-aware translated string with plural.
969  *
970  * \param singular singular form of the string to translate
971  * \param plural plural form of the string to translate
972  * \return non-finalized translated string
973  */
974 KLocalizedString KI18N_EXPORT kxi18np(const char *singular, const char *plural);
975 
976 /**
977  * Create non-finalized markup-aware translated string.
978  * with context and plural.
979  *
980  * \param context context of the string
981  * \param singular singular form of the string to translate
982  * \param plural plural form of the string to translate
983  * \return non-finalized translated string
984  */
985 KLocalizedString KI18N_EXPORT kxi18ncp(const char *context, const char *singular, const char *plural);
986 
987 /**
988  * Create non-finalized markup-aware translated string from domain.
989  *
990  * \param domain domain in which to look for translations
991  * \param text string to translate
992  * \return non-finalized translated string
993  */
994 KLocalizedString KI18N_EXPORT kxi18nd(const char *domain, const char *text);
995 
996 /**
997  * Create non-finalized markup-aware translated string from domain with context.
998  *
999  * \param domain domain in which to look for translations
1000  * \param context context of the string
1001  * \param text string to translate
1002  * \return non-finalized translated string
1003  */
1004 KLocalizedString KI18N_EXPORT kxi18ndc(const char *domain, const char *context, const char *text);
1005 
1006 /**
1007  * Create non-finalized markup-aware translated string from domain with plural.
1008  *
1009  * \param domain domain in which to look for translations
1010  * \param singular singular form of the string to translate
1011  * \param plural plural form of the string to translate
1012  * \return non-finalized translated string
1013  */
1014 KLocalizedString KI18N_EXPORT kxi18ndp(const char *domain, const char *singular, const char *plural);
1015 
1016 /**
1017  * Create non-finalized markup-aware translated string from domain
1018  * with context and plural.
1019  *
1020  * \param domain domain in which to look for translations
1021  * \param context context of the string
1022  * \param singular singular form of the string to translate
1023  * \param plural plural form of the string to translate
1024  * \return non-finalized translated string
1025  */
1026 KLocalizedString KI18N_EXPORT kxi18ndcp(const char *domain, const char *context, const char *singular, const char *plural);
1027 
1028 /**
1029  * Redirect Qt's <tt>uic</tt>-generated translation calls to Ki18n.
1030  *
1031  * Use <tt>-tr tr2i18n</tt> option to \c uic to have it redirect calls.
1032  *
1033  * \param text string to translate
1034  * \param comment Qt equivalent of disambiguation context
1035  * \return translated string
1036  */
1037 inline QString tr2i18n(const char *text, const char *comment = nullptr)
1038 {
1039  if (comment && comment[0] && text && text[0]) {
1040  return ki18nc(comment, text).toString();
1041  } else if (text && text[0]) {
1042  return ki18n(text).toString();
1043  } else {
1044  return QString();
1045  }
1046 }
1047 
1048 /**
1049  * Like \c tr2i18n, but look for translation in a specific domain.
1050  *
1051  * Use <tt>-tr tr2i18nd</tt> option to \c uic to have it redirect calls.
1052  *
1053  * \param domain domain in which to look for translations
1054  * \param text string to translate
1055  * \param comment Qt equivalent of disambiguation context
1056  * \return translated string
1057  */
1058 inline QString tr2i18nd(const char *domain, const char *text, const char *comment = nullptr)
1059 {
1060  if (comment && comment[0] && text && text[0]) {
1061  return ki18ndc(domain, comment, text).toString();
1062  } else if (text && text[0]) {
1063  return ki18nd(domain, text).toString();
1064  } else {
1065  return QString();
1066  }
1067 }
1068 
1069 /**
1070  * Like \c tr2i18n, but when UI strings are KUIT markup-aware.
1071  *
1072  * Use <tt>-tr tr2xi18n</tt> option to \c uic to have it redirect calls.
1073  *
1074  * \param text markup-aware string to translate
1075  * \param comment Qt equivalent of disambiguation context
1076  * \return translated string
1077  */
1078 inline QString tr2xi18n(const char *text, const char *comment = nullptr)
1079 {
1080  if (comment && comment[0] && text && text[0]) {
1081  return kxi18nc(comment, text).toString();
1082  } else if (text && text[0]) {
1083  return kxi18n(text).toString();
1084  } else {
1085  return QString();
1086  }
1087 }
1088 
1089 /**
1090  * Like \c tr2xi18n, but look for translation in a specific domain.
1091  *
1092  * Use <tt>-tr tr2xi18nd</tt> option to \c uic to have it redirect calls.
1093  *
1094  * \param domain domain in which to look for translations
1095  * \param text markup-aware string to translate
1096  * \param comment Qt equivalent of disambiguation context
1097  * \return translated string
1098  */
1099 inline QString tr2xi18nd(const char *domain, const char *text, const char *comment = nullptr)
1100 {
1101  if (comment && comment[0] && text && text[0]) {
1102  return kxi18ndc(domain, comment, text).toString();
1103  } else if (text && text[0]) {
1104  return kxi18nd(domain, text).toString();
1105  } else {
1106  return QString();
1107  }
1108 }
1109 
1110 #ifndef K_DOXYGEN
1111 
1112 #ifndef NDEBUG
1113 #define I18N_ERR_MSG String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np
1114 template<typename T, int s>
1115 class I18nTypeCheck
1116 {
1117 public:
1118  static void I18N_ERR_MSG()
1119  {
1120  }
1121 };
1122 template<int s>
1123 class I18nTypeCheck<char[s], s>
1124 {
1125 };
1126 #define STATIC_ASSERT_NOT_LITERAL_STRING(T) I18nTypeCheck<T, sizeof(T)>::I18N_ERR_MSG();
1127 #else
1128 #define STATIC_ASSERT_NOT_LITERAL_STRING(T)
1129 #endif
1130 
1131 // >>>>> Basic calls
1132 // Autogenerated; contact maintainer for batch changes.
1133 inline QString i18n(const char *text)
1134 {
1135  return ki18n(text).toString();
1136 }
1137 template<typename A1>
1138 inline QString i18n(const char *text, const A1 &a1)
1139 {
1140  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1141  return ki18n(text).subs(a1).toString();
1142 }
1143 template<typename A1, typename A2>
1144 inline QString i18n(const char *text, const A1 &a1, const A2 &a2)
1145 {
1146  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1147  return ki18n(text).subs(a1).subs(a2).toString();
1148 }
1149 template<typename A1, typename A2, typename A3>
1150 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1151 {
1152  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1153  return ki18n(text).subs(a1).subs(a2).subs(a3).toString();
1154 }
1155 template<typename A1, typename A2, typename A3, typename A4>
1156 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1157 {
1158  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1159  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1160 }
1161 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1162 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1163 {
1164  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1165  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1166 }
1167 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1168 inline QString i18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
1169 {
1170  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1171  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1172 }
1173 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1174 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)
1175 {
1176  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1177  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1178 }
1179 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1180 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)
1181 {
1182  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1183  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1184 }
1185 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1186 inline QString
1187 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)
1188 {
1189  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1190  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1191 }
1192 // <<<<<<< End of basic calls
1193 
1194 // >>>>> Context calls
1195 // Autogenerated; contact maintainer for batch changes.
1196 inline QString i18nc(const char *context, const char *text)
1197 {
1198  return ki18nc(context, text).toString();
1199 }
1200 template<typename A1>
1201 inline QString i18nc(const char *context, const char *text, const A1 &a1)
1202 {
1203  return ki18nc(context, text).subs(a1).toString();
1204 }
1205 template<typename A1, typename A2>
1206 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2)
1207 {
1208  return ki18nc(context, text).subs(a1).subs(a2).toString();
1209 }
1210 template<typename A1, typename A2, typename A3>
1211 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1212 {
1213  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).toString();
1214 }
1215 template<typename A1, typename A2, typename A3, typename A4>
1216 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1217 {
1218  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1219 }
1220 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1221 inline QString i18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1222 {
1223  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1224 }
1225 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1226 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)
1227 {
1228  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1229 }
1230 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1231 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)
1232 {
1233  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1234 }
1235 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1236 inline QString
1237 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)
1238 {
1239  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1240 }
1241 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1242 inline QString i18nc(const char *context,
1243  const char *text,
1244  const A1 &a1,
1245  const A2 &a2,
1246  const A3 &a3,
1247  const A4 &a4,
1248  const A5 &a5,
1249  const A6 &a6,
1250  const A7 &a7,
1251  const A8 &a8,
1252  const A9 &a9)
1253 {
1254  return ki18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1255 }
1256 // <<<<< End of context calls
1257 
1258 // >>>>> Plural calls
1259 // Autogenerated; contact maintainer for batch changes.
1260 template<typename A1>
1261 inline QString i18np(const char *singular, const char *plural, const A1 &a1)
1262 {
1263  return ki18np(singular, plural).subs(a1).toString();
1264 }
1265 template<typename A1, typename A2>
1266 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1267 {
1268  return ki18np(singular, plural).subs(a1).subs(a2).toString();
1269 }
1270 template<typename A1, typename A2, typename A3>
1271 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1272 {
1273  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).toString();
1274 }
1275 template<typename A1, typename A2, typename A3, typename A4>
1276 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1277 {
1278  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1279 }
1280 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1281 inline QString i18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1282 {
1283  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1284 }
1285 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1286 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)
1287 {
1288  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1289 }
1290 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1291 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)
1292 {
1293  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1294 }
1295 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1296 inline QString
1297 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)
1298 {
1299  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1300 }
1301 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1302 inline QString i18np(const char *singular,
1303  const char *plural,
1304  const A1 &a1,
1305  const A2 &a2,
1306  const A3 &a3,
1307  const A4 &a4,
1308  const A5 &a5,
1309  const A6 &a6,
1310  const A7 &a7,
1311  const A8 &a8,
1312  const A9 &a9)
1313 {
1314  return ki18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1315 }
1316 // <<<<< End of plural calls
1317 
1318 // >>>>> Context-plural calls
1319 // Autogenerated; contact maintainer for batch changes.
1320 template<typename A1>
1321 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1)
1322 {
1323  return ki18ncp(context, singular, plural).subs(a1).toString();
1324 }
1325 template<typename A1, typename A2>
1326 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1327 {
1328  return ki18ncp(context, singular, plural).subs(a1).subs(a2).toString();
1329 }
1330 template<typename A1, typename A2, typename A3>
1331 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1332 {
1333  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).toString();
1334 }
1335 template<typename A1, typename A2, typename A3, typename A4>
1336 inline QString i18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1337 {
1338  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1339 }
1340 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1341 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)
1342 {
1343  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1344 }
1345 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1346 inline QString
1347 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)
1348 {
1349  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1350 }
1351 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1352 inline QString i18ncp(const char *context,
1353  const char *singular,
1354  const char *plural,
1355  const A1 &a1,
1356  const A2 &a2,
1357  const A3 &a3,
1358  const A4 &a4,
1359  const A5 &a5,
1360  const A6 &a6,
1361  const A7 &a7)
1362 {
1363  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1364 }
1365 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1366 inline QString i18ncp(const char *context,
1367  const char *singular,
1368  const char *plural,
1369  const A1 &a1,
1370  const A2 &a2,
1371  const A3 &a3,
1372  const A4 &a4,
1373  const A5 &a5,
1374  const A6 &a6,
1375  const A7 &a7,
1376  const A8 &a8)
1377 {
1378  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1379 }
1380 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1381 inline QString i18ncp(const char *context,
1382  const char *singular,
1383  const char *plural,
1384  const A1 &a1,
1385  const A2 &a2,
1386  const A3 &a3,
1387  const A4 &a4,
1388  const A5 &a5,
1389  const A6 &a6,
1390  const A7 &a7,
1391  const A8 &a8,
1392  const A9 &a9)
1393 {
1394  return ki18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1395 }
1396 // <<<<< End of context-plural calls
1397 
1398 // >>>>> Basic calls with domain
1399 // Autogenerated; contact maintainer for batch changes.
1400 inline QString i18nd(const char *domain, const char *text)
1401 {
1402  return ki18nd(domain, text).toString();
1403 }
1404 template<typename A1>
1405 inline QString i18nd(const char *domain, const char *text, const A1 &a1)
1406 {
1407  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1408  return ki18nd(domain, text).subs(a1).toString();
1409 }
1410 template<typename A1, typename A2>
1411 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2)
1412 {
1413  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1414  return ki18nd(domain, text).subs(a1).subs(a2).toString();
1415 }
1416 template<typename A1, typename A2, typename A3>
1417 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1418 {
1419  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1420  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).toString();
1421 }
1422 template<typename A1, typename A2, typename A3, typename A4>
1423 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1424 {
1425  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1426  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1427 }
1428 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1429 inline QString i18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1430 {
1431  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1432  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1433 }
1434 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1435 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)
1436 {
1437  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1438  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1439 }
1440 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1441 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)
1442 {
1443  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1444  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1445 }
1446 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1447 inline QString
1448 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)
1449 {
1450  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1451  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1452 }
1453 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1454 inline QString i18nd(const char *domain,
1455  const char *text,
1456  const A1 &a1,
1457  const A2 &a2,
1458  const A3 &a3,
1459  const A4 &a4,
1460  const A5 &a5,
1461  const A6 &a6,
1462  const A7 &a7,
1463  const A8 &a8,
1464  const A9 &a9)
1465 {
1466  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1467  return ki18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1468 }
1469 // <<<<<<< End of basic calls with domain
1470 
1471 // >>>>> Context calls with domain
1472 // Autogenerated; contact maintainer for batch changes.
1473 inline QString i18ndc(const char *domain, const char *context, const char *text)
1474 {
1475  return ki18ndc(domain, context, text).toString();
1476 }
1477 template<typename A1>
1478 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1)
1479 {
1480  return ki18ndc(domain, context, text).subs(a1).toString();
1481 }
1482 template<typename A1, typename A2>
1483 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2)
1484 {
1485  return ki18ndc(domain, context, text).subs(a1).subs(a2).toString();
1486 }
1487 template<typename A1, typename A2, typename A3>
1488 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1489 {
1490  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).toString();
1491 }
1492 template<typename A1, typename A2, typename A3, typename A4>
1493 inline QString i18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1494 {
1495  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1496 }
1497 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1498 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)
1499 {
1500  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1501 }
1502 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1503 inline QString
1504 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)
1505 {
1506  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1507 }
1508 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1509 inline QString i18ndc(const char *domain,
1510  const char *context,
1511  const char *text,
1512  const A1 &a1,
1513  const A2 &a2,
1514  const A3 &a3,
1515  const A4 &a4,
1516  const A5 &a5,
1517  const A6 &a6,
1518  const A7 &a7)
1519 {
1520  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1521 }
1522 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1523 inline QString i18ndc(const char *domain,
1524  const char *context,
1525  const char *text,
1526  const A1 &a1,
1527  const A2 &a2,
1528  const A3 &a3,
1529  const A4 &a4,
1530  const A5 &a5,
1531  const A6 &a6,
1532  const A7 &a7,
1533  const A8 &a8)
1534 {
1535  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1536 }
1537 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1538 inline QString i18ndc(const char *domain,
1539  const char *context,
1540  const char *text,
1541  const A1 &a1,
1542  const A2 &a2,
1543  const A3 &a3,
1544  const A4 &a4,
1545  const A5 &a5,
1546  const A6 &a6,
1547  const A7 &a7,
1548  const A8 &a8,
1549  const A9 &a9)
1550 {
1551  return ki18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1552 }
1553 // <<<<< End of context calls with domain
1554 
1555 // >>>>> Plural calls with domain
1556 // Autogenerated; contact maintainer for batch changes.
1557 template<typename A1>
1558 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1)
1559 {
1560  return ki18ndp(domain, singular, plural).subs(a1).toString();
1561 }
1562 template<typename A1, typename A2>
1563 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1564 {
1565  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).toString();
1566 }
1567 template<typename A1, typename A2, typename A3>
1568 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1569 {
1570  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).toString();
1571 }
1572 template<typename A1, typename A2, typename A3, typename A4>
1573 inline QString i18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1574 {
1575  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1576 }
1577 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1578 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)
1579 {
1580  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1581 }
1582 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1583 inline QString
1584 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)
1585 {
1586  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1587 }
1588 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1589 inline QString i18ndp(const char *domain,
1590  const char *singular,
1591  const char *plural,
1592  const A1 &a1,
1593  const A2 &a2,
1594  const A3 &a3,
1595  const A4 &a4,
1596  const A5 &a5,
1597  const A6 &a6,
1598  const A7 &a7)
1599 {
1600  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1601 }
1602 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1603 inline QString i18ndp(const char *domain,
1604  const char *singular,
1605  const char *plural,
1606  const A1 &a1,
1607  const A2 &a2,
1608  const A3 &a3,
1609  const A4 &a4,
1610  const A5 &a5,
1611  const A6 &a6,
1612  const A7 &a7,
1613  const A8 &a8)
1614 {
1615  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1616 }
1617 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1618 inline QString i18ndp(const char *domain,
1619  const char *singular,
1620  const char *plural,
1621  const A1 &a1,
1622  const A2 &a2,
1623  const A3 &a3,
1624  const A4 &a4,
1625  const A5 &a5,
1626  const A6 &a6,
1627  const A7 &a7,
1628  const A8 &a8,
1629  const A9 &a9)
1630 {
1631  return ki18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1632 }
1633 // <<<<< End of plural calls with domain
1634 
1635 // >>>>> Context-plural calls with domain
1636 // Autogenerated; contact maintainer for batch changes.
1637 template<typename A1>
1638 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1)
1639 {
1640  return ki18ndcp(domain, context, singular, plural).subs(a1).toString();
1641 }
1642 template<typename A1, typename A2>
1643 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1644 {
1645  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).toString();
1646 }
1647 template<typename A1, typename A2, typename A3>
1648 inline QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1649 {
1650  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).toString();
1651 }
1652 template<typename A1, typename A2, typename A3, typename A4>
1653 inline QString
1654 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)
1655 {
1656  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1657 }
1658 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1659 inline QString
1660 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)
1661 {
1662  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1663 }
1664 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1665 inline QString i18ndcp(const char *domain,
1666  const char *context,
1667  const char *singular,
1668  const char *plural,
1669  const A1 &a1,
1670  const A2 &a2,
1671  const A3 &a3,
1672  const A4 &a4,
1673  const A5 &a5,
1674  const A6 &a6)
1675 {
1676  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1677 }
1678 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1679 inline QString i18ndcp(const char *domain,
1680  const char *context,
1681  const char *singular,
1682  const char *plural,
1683  const A1 &a1,
1684  const A2 &a2,
1685  const A3 &a3,
1686  const A4 &a4,
1687  const A5 &a5,
1688  const A6 &a6,
1689  const A7 &a7)
1690 {
1691  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1692 }
1693 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1694 inline QString i18ndcp(const char *domain,
1695  const char *context,
1696  const char *singular,
1697  const char *plural,
1698  const A1 &a1,
1699  const A2 &a2,
1700  const A3 &a3,
1701  const A4 &a4,
1702  const A5 &a5,
1703  const A6 &a6,
1704  const A7 &a7,
1705  const A8 &a8)
1706 {
1707  return ki18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1708 }
1709 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1710 inline QString i18ndcp(const char *domain,
1711  const char *context,
1712  const char *singular,
1713  const char *plural,
1714  const A1 &a1,
1715  const A2 &a2,
1716  const A3 &a3,
1717  const A4 &a4,
1718  const A5 &a5,
1719  const A6 &a6,
1720  const A7 &a7,
1721  const A8 &a8,
1722  const A9 &a9)
1723 {
1724  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();
1725 }
1726 // <<<<< End of context-plural calls with domain
1727 
1728 // >>>>> Markup-aware basic calls
1729 // Autogenerated; contact maintainer for batch changes.
1730 inline QString xi18n(const char *text)
1731 {
1732  return kxi18n(text).toString();
1733 }
1734 template<typename A1>
1735 inline QString xi18n(const char *text, const A1 &a1)
1736 {
1737  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1738  return kxi18n(text).subs(a1).toString();
1739 }
1740 template<typename A1, typename A2>
1741 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2)
1742 {
1743  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1744  return kxi18n(text).subs(a1).subs(a2).toString();
1745 }
1746 template<typename A1, typename A2, typename A3>
1747 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1748 {
1749  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1750  return kxi18n(text).subs(a1).subs(a2).subs(a3).toString();
1751 }
1752 template<typename A1, typename A2, typename A3, typename A4>
1753 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1754 {
1755  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1756  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1757 }
1758 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1759 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1760 {
1761  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1762  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1763 }
1764 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1765 inline QString xi18n(const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
1766 {
1767  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1768  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1769 }
1770 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1771 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)
1772 {
1773  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1774  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1775 }
1776 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1777 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)
1778 {
1779  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1780  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1781 }
1782 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1783 inline QString
1784 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)
1785 {
1786  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
1787  return kxi18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1788 }
1789 // <<<<<<< End of markup-aware basic calls
1790 
1791 // >>>>> Markup-aware context calls
1792 // Autogenerated; contact maintainer for batch changes.
1793 inline QString xi18nc(const char *context, const char *text)
1794 {
1795  return kxi18nc(context, text).toString();
1796 }
1797 template<typename A1>
1798 inline QString xi18nc(const char *context, const char *text, const A1 &a1)
1799 {
1800  return kxi18nc(context, text).subs(a1).toString();
1801 }
1802 template<typename A1, typename A2>
1803 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2)
1804 {
1805  return kxi18nc(context, text).subs(a1).subs(a2).toString();
1806 }
1807 template<typename A1, typename A2, typename A3>
1808 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
1809 {
1810  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).toString();
1811 }
1812 template<typename A1, typename A2, typename A3, typename A4>
1813 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1814 {
1815  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1816 }
1817 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1818 inline QString xi18nc(const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1819 {
1820  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1821 }
1822 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1823 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)
1824 {
1825  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1826 }
1827 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1828 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)
1829 {
1830  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1831 }
1832 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1833 inline QString
1834 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)
1835 {
1836  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1837 }
1838 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1839 inline QString xi18nc(const char *context,
1840  const char *text,
1841  const A1 &a1,
1842  const A2 &a2,
1843  const A3 &a3,
1844  const A4 &a4,
1845  const A5 &a5,
1846  const A6 &a6,
1847  const A7 &a7,
1848  const A8 &a8,
1849  const A9 &a9)
1850 {
1851  return kxi18nc(context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1852 }
1853 // <<<<< End of markup-aware context calls
1854 
1855 // >>>>> Markup-aware plural calls
1856 // Autogenerated; contact maintainer for batch changes.
1857 template<typename A1>
1858 inline QString xi18np(const char *singular, const char *plural, const A1 &a1)
1859 {
1860  return kxi18np(singular, plural).subs(a1).toString();
1861 }
1862 template<typename A1, typename A2>
1863 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1864 {
1865  return kxi18np(singular, plural).subs(a1).subs(a2).toString();
1866 }
1867 template<typename A1, typename A2, typename A3>
1868 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1869 {
1870  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).toString();
1871 }
1872 template<typename A1, typename A2, typename A3, typename A4>
1873 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1874 {
1875  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1876 }
1877 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1878 inline QString xi18np(const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1879 {
1880  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1881 }
1882 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1883 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)
1884 {
1885  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1886 }
1887 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1888 inline QString
1889 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)
1890 {
1891  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1892 }
1893 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1894 inline QString
1895 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)
1896 {
1897  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1898 }
1899 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1900 inline QString xi18np(const char *singular,
1901  const char *plural,
1902  const A1 &a1,
1903  const A2 &a2,
1904  const A3 &a3,
1905  const A4 &a4,
1906  const A5 &a5,
1907  const A6 &a6,
1908  const A7 &a7,
1909  const A8 &a8,
1910  const A9 &a9)
1911 {
1912  return kxi18np(singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1913 }
1914 // <<<<< End of markup-aware plural calls
1915 
1916 // >>>>> Markup-aware context-plural calls
1917 // Autogenerated; contact maintainer for batch changes.
1918 template<typename A1>
1919 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1)
1920 {
1921  return kxi18ncp(context, singular, plural).subs(a1).toString();
1922 }
1923 template<typename A1, typename A2>
1924 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
1925 {
1926  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).toString();
1927 }
1928 template<typename A1, typename A2, typename A3>
1929 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
1930 {
1931  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).toString();
1932 }
1933 template<typename A1, typename A2, typename A3, typename A4>
1934 inline QString xi18ncp(const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1935 {
1936  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1937 }
1938 template<typename A1, typename A2, typename A3, typename A4, typename A5>
1939 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)
1940 {
1941  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1942 }
1943 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1944 inline QString
1945 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)
1946 {
1947  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1948 }
1949 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1950 inline QString xi18ncp(const char *context,
1951  const char *singular,
1952  const char *plural,
1953  const A1 &a1,
1954  const A2 &a2,
1955  const A3 &a3,
1956  const A4 &a4,
1957  const A5 &a5,
1958  const A6 &a6,
1959  const A7 &a7)
1960 {
1961  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1962 }
1963 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1964 inline QString xi18ncp(const char *context,
1965  const char *singular,
1966  const char *plural,
1967  const A1 &a1,
1968  const A2 &a2,
1969  const A3 &a3,
1970  const A4 &a4,
1971  const A5 &a5,
1972  const A6 &a6,
1973  const A7 &a7,
1974  const A8 &a8)
1975 {
1976  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1977 }
1978 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1979 inline QString xi18ncp(const char *context,
1980  const char *singular,
1981  const char *plural,
1982  const A1 &a1,
1983  const A2 &a2,
1984  const A3 &a3,
1985  const A4 &a4,
1986  const A5 &a5,
1987  const A6 &a6,
1988  const A7 &a7,
1989  const A8 &a8,
1990  const A9 &a9)
1991 {
1992  return kxi18ncp(context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1993 }
1994 // <<<<< End of markup-aware context-plural calls
1995 
1996 // >>>>> Markup-aware basic calls with domain
1997 // Autogenerated; contact maintainer for batch changes.
1998 inline QString xi18nd(const char *domain, const char *text)
1999 {
2000  return kxi18nd(domain, text).toString();
2001 }
2002 template<typename A1>
2003 inline QString xi18nd(const char *domain, const char *text, const A1 &a1)
2004 {
2005  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2006  return kxi18nd(domain, text).subs(a1).toString();
2007 }
2008 template<typename A1, typename A2>
2009 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2)
2010 {
2011  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2012  return kxi18nd(domain, text).subs(a1).subs(a2).toString();
2013 }
2014 template<typename A1, typename A2, typename A3>
2015 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
2016 {
2017  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2018  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).toString();
2019 }
2020 template<typename A1, typename A2, typename A3, typename A4>
2021 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
2022 {
2023  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2024  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
2025 }
2026 template<typename A1, typename A2, typename A3, typename A4, typename A5>
2027 inline QString xi18nd(const char *domain, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
2028 {
2029  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2030  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
2031 }
2032 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
2033 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)
2034 {
2035  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2036  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
2037 }
2038 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
2039 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)
2040 {
2041  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2042  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
2043 }
2044 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
2045 inline QString
2046 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)
2047 {
2048  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2049  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
2050 }
2051 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
2052 inline QString xi18nd(const char *domain,
2053  const char *text,
2054  const A1 &a1,
2055  const A2 &a2,
2056  const A3 &a3,
2057  const A4 &a4,
2058  const A5 &a5,
2059  const A6 &a6,
2060  const A7 &a7,
2061  const A8 &a8,
2062  const A9 &a9)
2063 {
2064  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
2065  return kxi18nd(domain, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
2066 }
2067 // <<<<<<< End of markup-aware basic calls with domain
2068 
2069 // >>>>> Markup-aware context calls with domain
2070 // Autogenerated; contact maintainer for batch changes.
2071 inline QString xi18ndc(const char *domain, const char *context, const char *text)
2072 {
2073  return kxi18ndc(domain, context, text).toString();
2074 }
2075 template<typename A1>
2076 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1)
2077 {
2078  return kxi18ndc(domain, context, text).subs(a1).toString();
2079 }
2080 template<typename A1, typename A2>
2081 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2)
2082 {
2083  return kxi18ndc(domain, context, text).subs(a1).subs(a2).toString();
2084 }
2085 template<typename A1, typename A2, typename A3>
2086 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
2087 {
2088  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).toString();
2089 }
2090 template<typename A1, typename A2, typename A3, typename A4>
2091 inline QString xi18ndc(const char *domain, const char *context, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
2092 {
2093  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
2094 }
2095 template<typename A1, typename A2, typename A3, typename A4, typename A5>
2096 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)
2097 {
2098  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
2099 }
2100 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
2101 inline QString
2102 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)
2103 {
2104  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
2105 }
2106 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
2107 inline QString xi18ndc(const char *domain,
2108  const char *context,
2109  const char *text,
2110  const A1 &a1,
2111  const A2 &a2,
2112  const A3 &a3,
2113  const A4 &a4,
2114  const A5 &a5,
2115  const A6 &a6,
2116  const A7 &a7)
2117 {
2118  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
2119 }
2120 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
2121 inline QString xi18ndc(const char *domain,
2122  const char *context,
2123  const char *text,
2124  const A1 &a1,
2125  const A2 &a2,
2126  const A3 &a3,
2127  const A4 &a4,
2128  const A5 &a5,
2129  const A6 &a6,
2130  const A7 &a7,
2131  const A8 &a8)
2132 {
2133  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
2134 }
2135 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
2136 inline QString xi18ndc(const char *domain,
2137  const char *context,
2138  const char *text,
2139  const A1 &a1,
2140  const A2 &a2,
2141  const A3 &a3,
2142  const A4 &a4,
2143  const A5 &a5,
2144  const A6 &a6,
2145  const A7 &a7,
2146  const A8 &a8,
2147  const A9 &a9)
2148 {
2149  return kxi18ndc(domain, context, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
2150 }
2151 // <<<<< End of markup-aware context calls with domain
2152 
2153 // >>>>> Markup-aware plural calls with domain
2154 // Autogenerated; contact maintainer for batch changes.
2155 template<typename A1>
2156 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1)
2157 {
2158  return kxi18ndp(domain, singular, plural).subs(a1).toString();
2159 }
2160 template<typename A1, typename A2>
2161 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
2162 {
2163  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).toString();
2164 }
2165 template<typename A1, typename A2, typename A3>
2166 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
2167 {
2168  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).toString();
2169 }
2170 template<typename A1, typename A2, typename A3, typename A4>
2171 inline QString xi18ndp(const char *domain, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
2172 {
2173  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
2174 }
2175 template<typename A1, typename A2, typename A3, typename A4, typename A5>
2176 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)
2177 {
2178  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
2179 }
2180 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
2181 inline QString
2182 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)
2183 {
2184  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
2185 }
2186 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
2187 inline QString xi18ndp(const char *domain,
2188  const char *singular,
2189  const char *plural,
2190  const A1 &a1,
2191  const A2 &a2,
2192  const A3 &a3,
2193  const A4 &a4,
2194  const A5 &a5,
2195  const A6 &a6,
2196  const A7 &a7)
2197 {
2198  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
2199 }
2200 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
2201 inline QString xi18ndp(const char *domain,
2202  const char *singular,
2203  const char *plural,
2204  const A1 &a1,
2205  const A2 &a2,
2206  const A3 &a3,
2207  const A4 &a4,
2208  const A5 &a5,
2209  const A6 &a6,
2210  const A7 &a7,
2211  const A8 &a8)
2212 {
2213  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
2214 }
2215 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
2216 inline QString xi18ndp(const char *domain,
2217  const char *singular,
2218  const char *plural,
2219  const A1 &a1,
2220  const A2 &a2,
2221  const A3 &a3,
2222  const A4 &a4,
2223  const A5 &a5,
2224  const A6 &a6,
2225  const A7 &a7,
2226  const A8 &a8,
2227  const A9 &a9)
2228 {
2229  return kxi18ndp(domain, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
2230 }
2231 // <<<<< End of markup-aware plural calls with domain
2232 
2233 // >>>>> Markup-aware context-plural calls with domain
2234 // Autogenerated; contact maintainer for batch changes.
2235 template<typename A1>
2236 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1)
2237 {
2238  return kxi18ndcp(domain, context, singular, plural).subs(a1).toString();
2239 }
2240 template<typename A1, typename A2>
2241 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2)
2242 {
2243  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).toString();
2244 }
2245 template<typename A1, typename A2, typename A3>
2246 inline QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const A1 &a1, const A2 &a2, const A3 &a3)
2247 {
2248  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).toString();
2249 }
2250 template<typename A1, typename A2, typename A3, typename A4>
2251 inline QString
2252 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)
2253 {
2254  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).toString();
2255 }
2256 template<typename A1, typename A2, typename A3, typename A4, typename A5>
2257 inline QString xi18ndcp(const char *domain,
2258  const char *context,
2259  const char *singular,
2260  const char *plural,
2261  const A1 &a1,
2262  const A2 &a2,
2263  const A3 &a3,
2264  const A4 &a4,
2265  const A5 &a5)
2266 {
2267  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
2268 }
2269 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
2270 inline QString xi18ndcp(const char *domain,
2271  const char *context,
2272  const char *singular,
2273  const char *plural,
2274  const A1 &a1,
2275  const A2 &a2,
2276  const A3 &a3,
2277  const A4 &a4,
2278  const A5 &a5,
2279  const A6 &a6)
2280 {
2281  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
2282 }
2283 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
2284 inline QString xi18ndcp(const char *domain,
2285  const char *context,
2286  const char *singular,
2287  const char *plural,
2288  const A1 &a1,
2289  const A2 &a2,
2290  const A3 &a3,
2291  const A4 &a4,
2292  const A5 &a5,
2293  const A6 &a6,
2294  const A7 &a7)
2295 {
2296  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
2297 }
2298 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
2299 inline QString xi18ndcp(const char *domain,
2300  const char *context,
2301  const char *singular,
2302  const char *plural,
2303  const A1 &a1,
2304  const A2 &a2,
2305  const A3 &a3,
2306  const A4 &a4,
2307  const A5 &a5,
2308  const A6 &a6,
2309  const A7 &a7,
2310  const A8 &a8)
2311 {
2312  return kxi18ndcp(domain, context, singular, plural).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
2313 }
2314 template<typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
2315 inline QString xi18ndcp(const char *domain,
2316  const char *context,
2317  const char *singular,
2318  const char *plural,
2319  const A1 &a1,
2320  const A2 &a2,
2321  const A3 &a3,
2322  const A4 &a4,
2323  const A5 &a5,
2324  const A6 &a6,
2325  const A7 &a7,
2326  const A8 &a8,
2327  const A9 &a9)
2328 {
2329  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();
2330 }
2331 // <<<<< End of markup-aware context-plural calls with domain
2332 
2333 #endif // K_DOXYGEN
2334 
2335 #endif // KLOCALIZEDSTRING_H
2336 
2337 #ifndef K_DOXYGEN
2338 
2339 // Outside of include guards, to be able to map and unmap domains
2340 // by successive inclusions of this header
2341 // preceded with different definitions of TRANSLATION_DOMAIN.
2342 #ifdef TRANSLATION_DOMAIN
2343 #define i18n(...) i18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2344 #define i18nc(...) i18ndc(TRANSLATION_DOMAIN, __VA_ARGS__)
2345 #define i18np(...) i18ndp(TRANSLATION_DOMAIN, __VA_ARGS__)
2346 #define i18ncp(...) i18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__)
2347 #define ki18n(...) ki18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2348 #define ki18nc(...) ki18ndc(TRANSLATION_DOMAIN, __VA_ARGS__)
2349 #define ki18np(...) ki18ndp(TRANSLATION_DOMAIN, __VA_ARGS__)
2350 #define ki18ncp(...) ki18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__)
2351 #define tr2i18n(...) tr2i18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2352 #define xi18n(...) xi18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2353 #define xi18nc(...) xi18ndc(TRANSLATION_DOMAIN, __VA_ARGS__)
2354 #define xi18np(...) xi18ndp(TRANSLATION_DOMAIN, __VA_ARGS__)
2355 #define xi18ncp(...) xi18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__)
2356 #define kxi18n(...) kxi18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2357 #define kxi18nc(...) kxi18ndc(TRANSLATION_DOMAIN, __VA_ARGS__)
2358 #define kxi18np(...) kxi18ndp(TRANSLATION_DOMAIN, __VA_ARGS__)
2359 #define kxi18ncp(...) kxi18ndcp(TRANSLATION_DOMAIN, __VA_ARGS__)
2360 #define tr2xi18n(...) tr2xi18nd(TRANSLATION_DOMAIN, __VA_ARGS__)
2361 #else
2362 #undef i18n
2363 #undef i18nc
2364 #undef i18np
2365 #undef i18ncp
2366 #undef ki18n
2367 #undef ki18nc
2368 #undef ki18np
2369 #undef ki18ncp
2370 #undef tr2i18n
2371 #undef xi18n
2372 #undef xi18nc
2373 #undef xi18np
2374 #undef xi18ncp
2375 #undef kxi18n
2376 #undef kxi18nc
2377 #undef kxi18np
2378 #undef kxi18ncp
2379 #undef tr2xi18n
2380 #endif
2381 
2382 #endif // K_DOXYGEN
QString xi18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...)
Translate a markup-aware string with context and plural and substitute any arguments.
QString xi18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
Translate a markup-aware string from domain with context and substitute any arguments.
KLocalizedString relaxSubs() const
Relax matching between placeholders and arguments.
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
Translate a markup-aware string with context and substitute any arguments.
Class for producing and handling localized messages.
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
Create non-finalized translated string with context.
QString tr2i18nd(const char *domain, const char *text, const char *comment=nullptr)
Like tr2i18n, but look for translation in a specific domain.
QString tr2xi18n(const char *text, const char *comment=nullptr)
Like tr2i18n, but when UI strings are KUIT markup-aware.
KLocalizedString KI18N_EXPORT kxi18ndc(const char *domain, const char *context, const char *text)
Create non-finalized markup-aware translated string from domain with context.
QString tr2xi18nd(const char *domain, const char *text, const char *comment=nullptr)
Like tr2xi18n, but look for translation in a specific domain.
KLocalizedString KI18N_EXPORT kxi18ndcp(const char *domain, const char *context, const char *singular, const char *plural)
Create non-finalized markup-aware translated string from domain with context and plural.
KLocalizedString KI18N_EXPORT kxi18n(const char *text)
Create non-finalized markup-aware translated string.
QString xi18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...)
Translate a markup-aware string from domain with context and plural and substitute any arguments.
KLocalizedString KI18N_EXPORT ki18ndc(const char *domain, const char *context, const char *text)
Create non-finalized translated string from domain with context.
KLocalizedString withFormat(Kuit::VisualFormat format) const
Indicate to resolve KUIT markup into given visual format.
VisualFormat
Visual formats into which KUIT markup can be resolved.
Definition: kuitmarkup.h:27
QString toString() const
Finalize the translation.
QString xi18n(const char *text, const TYPE &arg...)
Translate a markup-aware string and substitute any arguments.
QString xi18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...)
Translate a markup-aware string from domain with plural and substitute any arguments.
QString tr2i18n(const char *text, const char *comment=nullptr)
Redirect Qt's uic-generated translation calls to Ki18n.
KLocalizedString subs(int a, int fieldWidth=0, int base=10, QChar fillChar=QLatin1Char(' ')) const
Substitute an int argument into the message.
QString i18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...)
Translate a string with context and plural and substitute any arguments.
QString toString() const
Finalize the translation.
QString xi18nd(const char *domain, const char *text, const TYPE &arg...)
Translate a markup-aware string from domain and substitute any arguments.
QString xi18np(const char *singular, const char *plural, const TYPE &arg...)
Translate a markup-aware string with plural and substitute any arguments.
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
Translate a string from domain with context and substitute any arguments.
QString i18n(const char *text, const TYPE &arg...)
Translate a string and substitute any arguments.
constexpr bool isEmpty() const
Check whether the message is empty.
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
Create non-finalized translated string with context and plural.
KLocalizedString KI18N_EXPORT ki18ndcp(const char *domain, const char *context, const char *singular, const char *plural)
Create non-finalized translated string from domain with context and plural.
KLocalizedString withLanguages(const QStringList &languages) const
Indicate to look for translation only in given languages.
KLocalizedString KI18N_EXPORT ki18n(const char *text)
Create non-finalized translated string.
KLocalizedString withDomain(const char *domain) const
Indicate to look for translation in the given domain.
QString i18ndp(const char *domain, const char *singular, const char *plural, const TYPE &arg...)
Translate a string from domain with plural and substitute any arguments.
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
Translate a string from domain and substitute any arguments.
QString i18np(const char *singular, const char *plural, const TYPE &arg...)
Translate a string with plural and substitute any arguments.
KLocalizedString KI18N_EXPORT kxi18ncp(const char *context, const char *singular, const char *plural)
Create non-finalized markup-aware translated string.
KLocalizedString inContext(const QString &key, const QString &value) const
Add dynamic context to the message.
QString i18ndcp(const char *domain, const char *context, const char *singular, const char *plural, const TYPE &arg...)
Translate a string from domain with context and plural and substitute any arguments.
constexpr const char * untranslatedText() const
Returns the raw untranslated text as passed to kli18n*.
KLocalizedString subs(int a, int fieldWidth=0, int base=10, QChar fillChar=QLatin1Char(' ')) const
Substitute an int argument into the message.
KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural)
Create non-finalized translated string with plural.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
Translate a string with context and substitute any arguments.
KLocalizedString KI18N_EXPORT ki18ndp(const char *domain, const char *singular, const char *plural)
Create non-finalized translated string from domain with plural.
KLocalizedString KI18N_EXPORT ki18nd(const char *domain, const char *text)
Create non-finalized translated string from domain.
KLocalizedString ignoreMarkup() const
Do not resolve KUIT markup.
KLocalizedString KI18N_EXPORT kxi18np(const char *singular, const char *plural)
Create non-finalized markup-aware translated string with plural.
KLocalizedString KI18N_EXPORT kxi18nc(const char *context, const char *text)
Create non-finalized markup-aware translated string with context.
KLocalizedString KI18N_EXPORT kxi18ndp(const char *domain, const char *singular, const char *plural)
Create non-finalized markup-aware translated string from domain with plural.
KLocalizedString KI18N_EXPORT kxi18nd(const char *domain, const char *text)
Create non-finalized markup-aware translated string from domain.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Aug 16 2022 04:07:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.