• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • sources
  • kde-4.12
  • kdelibs
  • kdecore
  • localization
klocalizedstring.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2006 Chusslove Illich <caslav.ilic@gmx.net>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #ifndef KLOCALIZEDSTRING_H
20 #define KLOCALIZEDSTRING_H
21 
22 #include <kdecore_export.h>
23 
24 
25 #include <QtCore/QChar>
26 #include <QtCore/QLatin1Char>
27 #include <QtCore/QStringList>
28 
29 class KLocale;
30 struct KCatalogName;
31 class KLocalizedStringPrivate;
32 
37 #ifndef I18N_NOOP
38 
51 #define I18N_NOOP(x) x
52 #endif
53 
54 #ifndef I18N_NOOP2
55 
72 #define I18N_NOOP2(comment,x) x
73 #endif
74 
75 #ifndef I18N_NOOP2_NOSTRIP
76 
102 #define I18N_NOOP2_NOSTRIP(ctxt, text) ctxt, text
103 #endif
104 
299 class KDECORE_EXPORT KLocalizedString
300 {
301 
302  friend KLocalizedString KDECORE_EXPORT ki18n (const char* msg);
303  friend KLocalizedString KDECORE_EXPORT ki18nc (const char *ctxt, const char *msg);
304  friend KLocalizedString KDECORE_EXPORT ki18np (const char *singular, const char *plural);
305  friend KLocalizedString KDECORE_EXPORT ki18ncp (const char *ctxt,
306  const char *singular, const char *plural);
307 
308 public:
316  explicit KLocalizedString ();
317 
321  KLocalizedString (const KLocalizedString &rhs);
322 
326  KLocalizedString& operator= (const KLocalizedString &rhs);
327 
331  ~KLocalizedString ();
332 
342  QString toString () const;
343 
352  QString toString (const QString &catalogName) const;
353 
365  QString toString (const KLocale *locale) const;
366 
376  QString toString (const KLocale *locale, const QString &catalogName) const;
377 
387  bool isEmpty() const;
388 
401  KLocalizedString subs (int a, int fieldWidth = 0, int base = 10,
402  const QChar &fillChar = QLatin1Char(' ')) const;
403 
416  KLocalizedString subs (uint a, int fieldWidth = 0, int base = 10,
417  const QChar &fillChar = QLatin1Char(' ')) const;
418 
431  KLocalizedString subs (long a, int fieldWidth = 0, int base = 10,
432  const QChar &fillChar = QLatin1Char(' ')) const;
433 
446  KLocalizedString subs (ulong a, int fieldWidth = 0, int base = 10,
447  const QChar &fillChar = QLatin1Char(' ')) const;
448 
461  KLocalizedString subs (qlonglong a, int fieldWidth = 0, int base = 10,
462  const QChar &fillChar = QLatin1Char(' ')) const;
463 
476  KLocalizedString subs (qulonglong a, int fieldWidth = 0, int base = 10,
477  const QChar &fillChar = QLatin1Char(' ')) const;
478 
491  KLocalizedString subs (double a, int fieldWidth = 0,
492  char format = 'g', int precision = -1,
493  const QChar &fillChar = QLatin1Char(' ')) const;
494 
505  KLocalizedString subs (QChar a, int fieldWidth = 0,
506  const QChar &fillChar = QLatin1Char(' ')) const;
507 
518  KLocalizedString subs (const QString &a, int fieldWidth = 0,
519  const QChar &fillChar = QLatin1Char(' ')) const;
520 
528  KLocalizedString inContext (const QString &key,
529  const QString &text) const;
530 
534  static void notifyCatalogsUpdated (const QStringList &languages,
535  const QList<KCatalogName> &catalogs);
536 
537 private:
538  KLocalizedString (const char *ctxt,
539  const char *msg, const char *plural);
540 
541  KLocalizedStringPrivate * const d;
542 };
543 
553 extern KLocalizedString KDECORE_EXPORT ki18n (const char* msg);
554 
567 extern KLocalizedString KDECORE_EXPORT ki18nc (const char *ctxt, const char *msg);
568 
579 extern KLocalizedString KDECORE_EXPORT ki18np (const char *singular, const char *plural);
580 
595 extern KLocalizedString KDECORE_EXPORT ki18ncp (const char *ctxt, const char *singular, const char *plural);
596 
602 inline QString tr2i18n (const char *message, const char *comment = 0) {
603  if (comment && comment[0] && message && message[0]) {
604  return ki18nc(comment, message).toString();
605  }
606  else if (message && message[0]) {
607  return ki18n(message).toString();
608  }
609  else {
610  return QString();
611  }
612 }
613 
614 #ifndef NDEBUG
615 #define I18N_ERR_MSG String_literal_as_second_argument_to_i18n___Perhaps_you_need_i18nc_or_i18np
616 template <typename T, int s> class I18nTypeCheck {public: static void I18N_ERR_MSG () {}};
617 template <int s> class I18nTypeCheck<char[s], s> {};
618 #define STATIC_ASSERT_NOT_LITERAL_STRING(T) I18nTypeCheck<T, sizeof(T)>::I18N_ERR_MSG ();
619 #else
620 #define STATIC_ASSERT_NOT_LITERAL_STRING(T)
621 #endif
622 
623 // >>>>> Basic calls
624 // Autogenerated; contact KLocalizedString maintainer for batch changes.
630 inline QString i18n (const char *text)
631 {
632  return ki18n(text).toString();
633 }
634 // Autogenerated; contact KLocalizedString maintainer for batch changes.
641 template <typename A1>
642 inline QString i18n (const char *text, const A1 &a1)
643 {
644  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
645  return ki18n(text).subs(a1).toString();
646 }
647 // Autogenerated; contact KLocalizedString maintainer for batch changes.
655 template <typename A1, typename A2>
656 inline QString i18n (const char *text, const A1 &a1, const A2 &a2)
657 {
658  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
659  return ki18n(text).subs(a1).subs(a2).toString();
660 }
661 // Autogenerated; contact KLocalizedString maintainer for batch changes.
670 template <typename A1, typename A2, typename A3>
671 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
672 {
673  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
674  return ki18n(text).subs(a1).subs(a2).subs(a3).toString();
675 }
676 // Autogenerated; contact KLocalizedString maintainer for batch changes.
686 template <typename A1, typename A2, typename A3, typename A4>
687 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
688 {
689  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
690  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
691 }
692 // Autogenerated; contact KLocalizedString maintainer for batch changes.
703 template <typename A1, typename A2, typename A3, typename A4, typename A5>
704 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
705 {
706  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
707  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
708 }
709 // Autogenerated; contact KLocalizedString maintainer for batch changes.
721 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
722 inline QString i18n (const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
723 {
724  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
725  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
726 }
727 // Autogenerated; contact KLocalizedString maintainer for batch changes.
740 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
741 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)
742 {
743  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
744  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
745 }
746 // Autogenerated; contact KLocalizedString maintainer for batch changes.
760 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
761 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)
762 {
763  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
764  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
765 }
766 // Autogenerated; contact KLocalizedString maintainer for batch changes.
781 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
782 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, const A9 &a9)
783 {
784  STATIC_ASSERT_NOT_LITERAL_STRING(A1)
785  return ki18n(text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
786 }
787 // <<<<<<< End of basic calls
788 
789 // >>>>> Context calls
790 // Autogenerated; contact KLocalizedString maintainer for batch changes.
797 inline QString i18nc (const char *ctxt, const char *text)
798 {
799  return ki18nc(ctxt, text).toString();
800 }
801 // Autogenerated; contact KLocalizedString maintainer for batch changes.
809 template <typename A1>
810 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1)
811 {
812  return ki18nc(ctxt, text).subs(a1).toString();
813 }
814 // Autogenerated; contact KLocalizedString maintainer for batch changes.
823 template <typename A1, typename A2>
824 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2)
825 {
826  return ki18nc(ctxt, text).subs(a1).subs(a2).toString();
827 }
828 // Autogenerated; contact KLocalizedString maintainer for batch changes.
838 template <typename A1, typename A2, typename A3>
839 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
840 {
841  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).toString();
842 }
843 // Autogenerated; contact KLocalizedString maintainer for batch changes.
854 template <typename A1, typename A2, typename A3, typename A4>
855 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
856 {
857  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).toString();
858 }
859 // Autogenerated; contact KLocalizedString maintainer for batch changes.
871 template <typename A1, typename A2, typename A3, typename A4, typename A5>
872 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
873 {
874  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
875 }
876 // Autogenerated; contact KLocalizedString maintainer for batch changes.
889 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
890 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
891 {
892  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
893 }
894 // Autogenerated; contact KLocalizedString maintainer for batch changes.
908 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
909 inline QString i18nc (const char *ctxt, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
910 {
911  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
912 }
913 // Autogenerated; contact KLocalizedString maintainer for batch changes.
928 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
929 inline QString i18nc (const char *ctxt, 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)
930 {
931  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
932 }
933 // Autogenerated; contact KLocalizedString maintainer for batch changes.
949 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
950 inline QString i18nc (const char *ctxt, 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)
951 {
952  return ki18nc(ctxt, text).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
953 }
954 // <<<<< End of context calls
955 
956 // >>>>> Plural calls
957 // Autogenerated; contact KLocalizedString maintainer for batch changes.
965 template <typename A1>
966 inline QString i18np (const char *sing, const char *plur, const A1 &a1)
967 {
968  return ki18np(sing, plur).subs(a1).toString();
969 }
970 // Autogenerated; contact KLocalizedString maintainer for batch changes.
979 template <typename A1, typename A2>
980 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2)
981 {
982  return ki18np(sing, plur).subs(a1).subs(a2).toString();
983 }
984 // Autogenerated; contact KLocalizedString maintainer for batch changes.
994 template <typename A1, typename A2, typename A3>
995 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3)
996 {
997  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).toString();
998 }
999 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1010 template <typename A1, typename A2, typename A3, typename A4>
1011 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1012 {
1013  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1014 }
1015 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1027 template <typename A1, typename A2, typename A3, typename A4, typename A5>
1028 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1029 {
1030  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1031 }
1032 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1045 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1046 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
1047 {
1048  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1049 }
1050 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1064 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1065 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
1066 {
1067  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1068 }
1069 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1084 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1085 inline QString i18np (const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
1086 {
1087  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1088 }
1089 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1105 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1106 inline QString i18np (const char *sing, const char *plur, 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)
1107 {
1108  return ki18np(sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1109 }
1110 // <<<<< End of plural calls
1111 
1112 // >>>>> Context-plural calls
1113 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1122 template <typename A1>
1123 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1)
1124 {
1125  return ki18ncp(ctxt, sing, plur).subs(a1).toString();
1126 }
1127 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1137 template <typename A1, typename A2>
1138 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2)
1139 {
1140  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).toString();
1141 }
1142 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1153 template <typename A1, typename A2, typename A3>
1154 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3)
1155 {
1156  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).toString();
1157 }
1158 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1170 template <typename A1, typename A2, typename A3, typename A4>
1171 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
1172 {
1173  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).toString();
1174 }
1175 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1188 template <typename A1, typename A2, typename A3, typename A4, typename A5>
1189 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5)
1190 {
1191  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).toString();
1192 }
1193 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1207 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
1208 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6)
1209 {
1210  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).toString();
1211 }
1212 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1227 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
1228 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7)
1229 {
1230  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).toString();
1231 }
1232 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1248 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
1249 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8)
1250 {
1251  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).toString();
1252 }
1253 // Autogenerated; contact KLocalizedString maintainer for batch changes.
1270 template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9>
1271 inline QString i18ncp (const char *ctxt, const char *sing, const char *plur, 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)
1272 {
1273  return ki18ncp(ctxt, sing, plur).subs(a1).subs(a2).subs(a3).subs(a4).subs(a5).subs(a6).subs(a7).subs(a8).subs(a9).toString();
1274 }
1275 // <<<<< End of context-plural calls
1276 
1277 #endif
KMessage::message
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
Display a long message of a certain type.
Definition: kmessage.cpp:92
i18n
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
ki18nc
KLocalizedString ki18nc(const char *ctxt, const char *msg)
Creates localized string from a given message, with added context.
Definition: klocalizedstring.cpp:929
KLocalizedString::toString
QString toString() const
Finalizes the translation, creates QString with placeholders substituted.
Definition: klocalizedstring.cpp:192
kdecore_export.h
i18np
QString i18np(const char *sing, const char *plur, const A1 &a1)
Returns a localized version of a string with 1 argument using correct plural form.
Definition: klocalizedstring.h:966
KCatalogName
Definition: kcatalogname_p.h:25
QString
I18nTypeCheck::I18N_ERR_MSG
static void I18N_ERR_MSG()
Definition: klocalizedstring.h:616
i18nc
QString i18nc(const char *ctxt, const char *text)
Returns a localized version of a string and a context.
Definition: klocalizedstring.h:797
ki18np
KLocalizedString ki18np(const char *singular, const char *plural)
Creates localized string from a given plural and singular form.
Definition: klocalizedstring.cpp:934
I18nTypeCheck
Definition: klocalizedstring.h:616
i18ncp
QString i18ncp(const char *ctxt, const char *sing, const char *plur, const A1 &a1)
Returns a localized version of a string with 1 argument and a context using correct plural form...
Definition: klocalizedstring.h:1123
QStringList
ki18ncp
KLocalizedString ki18ncp(const char *ctxt, const char *singular, const char *plural)
Creates localized string from a given plural and singular form, with added context.
Definition: klocalizedstring.cpp:939
tr2i18n
QString tr2i18n(const char *message, const char *comment=0)
Qt's uic generated translation calls go through numerous indirections unnecessary in our case...
Definition: klocalizedstring.h:602
KGlobal::locale
KLocale * locale()
Returns the global locale object.
Definition: kglobal.cpp:169
ki18n
KLocalizedString ki18n(const char *msg)
Creates localized string from a given message.
Definition: klocalizedstring.cpp:924
KLocale
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:69
KLocalizedString::subs
KLocalizedString subs(int a, int fieldWidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const
Substitutes an int argument into the message.
Definition: klocalizedstring.cpp:792
STATIC_ASSERT_NOT_LITERAL_STRING
#define STATIC_ASSERT_NOT_LITERAL_STRING(T)
Definition: klocalizedstring.h:618
KLocalizedString
Class for producing and handling localized messages.
Definition: klocalizedstring.h:299
QList< KCatalogName >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal