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