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

KDE's Doxygen guidelines are available online.