6#include <QtCore/QByteArray>
7#include <QtCore/QDebug>
10#include <QtCore/QFileInfo>
13#include <private/qtranslator_p.h>
22 { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
25 { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11 };
30 { Q_EQ, 1, Q_OR, Q_EQ, 11, Q_NEWRULE,
31 Q_EQ, 2, Q_OR, Q_EQ, 12, Q_NEWRULE,
37 { Q_MOD_10 | Q_EQ, 1, Q_NEWRULE,
40 { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
41 Q_MOD_10 | Q_NEQ, 0, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
43 { Q_MOD_10 | Q_EQ, 1, Q_AND, Q_MOD_100 | Q_NEQ, 11, Q_NEWRULE,
44 Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
47 Q_MOD_10 | Q_BETWEEN, 2, 4, Q_AND, Q_MOD_100 | Q_NOT_BETWEEN, 10, 19 };
50 Q_EQ, 0, Q_OR, Q_MOD_100 | Q_BETWEEN, 1, 19 };
52 { Q_MOD_100 | Q_EQ, 1, Q_NEWRULE,
53 Q_MOD_100 | Q_EQ, 2, Q_NEWRULE,
54 Q_MOD_100 | Q_BETWEEN, 3, 4 };
57 Q_EQ, 0, Q_OR, Q_MOD_100 | Q_BETWEEN, 1, 10, Q_NEWRULE,
58 Q_MOD_100 | Q_BETWEEN, 11, 19 };
62 Q_BETWEEN, 2, 5, Q_NEWRULE,
68 Q_MOD_100 | Q_BETWEEN, 3, 10, Q_NEWRULE,
69 Q_MOD_100 | Q_GEQ, 11 };
71 { Q_LEQ, 1, Q_NEWRULE,
72 Q_MOD_10 | Q_EQ, 4, Q_OR, Q_MOD_10 | Q_EQ, 6, Q_OR, Q_MOD_10 | Q_EQ, 9 };
78static const char *
const latvianForms[] = {
"Singular",
"Plural",
"Nullar", 0 };
85static const char *
const lithuanianForms[] = {
"Singular",
"Paucal",
"Plural", 0 };
87static const char *
const polishForms[] = {
"Singular",
"Paucal",
"Plural", 0 };
88static const char *
const romanianForms[] = {
"Singular",
"Paucal",
"Plural", 0 };
89static const char *
const slovenianForms[] = {
"Singular",
"Dual",
"Trial",
"Plural", 0 };
91 {
"Singular",
"Paucal",
"Greater Paucal",
"Plural", 0 };
93 {
"Nullar",
"Singular",
"Dual",
"Sexal",
"Plural", 0 };
95 {
"Nullar",
"Singular",
"Dual",
"Minority Plural",
"Plural",
"Plural (100-102, ...)", 0 };
97 {
"Singular",
"Plural (consonant-ended)",
"Plural (vowel-ended)", 0 };
114 QLocale::NauruLanguage,
136 QLocale::Azerbaijani,
152 QLocale::WesternFrisian,
158 QLocale::Greenlandic,
163 QLocale::Interlingua,
164 QLocale::Interlingue,
170 QLocale::Kinyarwanda,
176 QLocale::Luxembourgish,
183 QLocale::NorthernSotho,
184 QLocale::NorwegianBokmal,
185 QLocale::NorwegianNynorsk,
198 QLocale::SouthernSotho,
240 QLocale::NorthernSami,
271 QLocale::AnyTerritory,
272 QLocale::AnyTerritory,
273 QLocale::AnyTerritory,
275 QLocale::AnyTerritory,
276 QLocale::AnyTerritory,
277 QLocale::AnyTerritory
291 "nplurals=2; plural=(n != 1);" },
293 frenchStyleCountries,
"nplurals=2; plural=(n > 1);" },
295 "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" },
297 "nplurals=2; plural=(n%10==1 && n%100!=11 ? 0 : 1);" },
299 "nplurals=3; plural=(n==1 ? 0 : n==2 ? 1 : 2);" },
301 "nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;" },
303 "nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);" },
305 "nplurals=3; plural=(n%100==1 ? 0 : n%100==2 ? 1 : 2);" },
307 "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" },
309 "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
311 "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" },
313 "nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);" },
315 "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);" },
317 "nplurals=4; plural=(n==1 ? 0 : (n==0 || (n%100>=1 && n%100<=10)) ? 1 : (n%100>=11 && n%100<=19) ? 2 : 3);" },
319 "nplurals=5; plural=(n==0 ? 0 : n==1 ? 1 : (n>=2 && n<=5) ? 2 : n==6 ? 3 : 4);" },
321 "nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : (n%100>=3 && n%100<=10) ? 3 : n%100>=11 ? 4 : 5);" },
323 "nplurals=3; plural=(n==1 ? 0 : (n%10==4 || n%10==6 || n%10== 9) ? 1 : 2);" },
329 QByteArray *rules, QStringList *forms,
const char **gettextRules)
334 for (
int j = 0; entry.languages[j] !=
EOL; ++j) {
335 if (entry.languages[j] == language
336 && ((!entry.countries && country == QLocale::AnyTerritory)
337 || (entry.countries && entry.countries[j] == country))) {
339 *rules = QByteArray::fromRawData(
reinterpret_cast<
const char *>(entry.rules),
346 for (
int k = 0; entry
.forms[k]; ++k)
347 forms->append(QLatin1String(entry
.forms[k]));
354 if (country == QLocale::AnyTerritory)
356 country = QLocale::AnyTerritory;
367 for (
int j = 0; entry.languages[j] !=
EOL; ++j) {
368 QLocale loc(entry.languages[j], entry.countries ? entry.countries[j]
369 : QLocale::AnyTerritory);
370 QString lang = QLocale::languageToString(entry.languages[j]);
371 if (loc.language() == QLocale::C)
372 lang += QLatin1String(
" (!!!)");
373 else if (entry.countries && entry.countries[j] != QLocale::AnyTerritory)
374 lang += QLatin1String(
" (%1)").arg(QLocale::territoryToString(loc.territory()));
376 lang += QLatin1String(
" [%1]").arg(QLocale::territoryToString(loc.territory()));
377 langs << QString::fromLatin1(
"%1 %2 %3\n").arg(lang, -40).arg(loc.name(), -8)
378 .arg(QString::fromLatin1(entry.gettextRules));
382 return langs.join(QString());
Combined button and popup list for selecting options.
static const QLocale::Language englishStyleLanguages[]
static const char *const russianStyleForms[]
static const QLocale::Language romanianLanguages[]
static const uchar welshRules[]
static const uchar slovenianRules[]
static QT_BEGIN_NAMESPACE const uchar englishStyleRules[]
static const QLocale::Language japaneseStyleLanguages[]
static const QLocale::Language icelandicLanguage[]
static const QLocale::Language welshLanguage[]
static const char *const romanianForms[]
static const QLocale::Language tagalogLanguage[]
static const char *const lithuanianForms[]
static const uchar polishRules[]
static const QLocale::Language arabicLanguage[]
static const QLocale::Language polishLanguage[]
static const QLocale::Territory frenchStyleCountries[]
static const QLocale::Language gaelicStyleLanguages[]
static const QLocale::Language frenchStyleLanguages[]
static const char *const japaneseStyleForms[]
static const QLocale::Language macedonianLanguage[]
static const uchar slovakStyleRules[]
static const QLocale::Language malteseLanguage[]
static const QLocale::Language slovenianLanguage[]
static const char *const slovenianForms[]
static const uchar tagalogRules[]
static const uchar romanianRules[]
static const uchar gaelicStyleRules[]
static const char *const macedonianForms[]
static const char *const icelandicForms[]
static const uchar icelandicRules[]
static const char *const welshForms[]
static const char *const tagalogForms[]
static const int NumerusTableSize
static const NumerusTableEntry numerusTable[]
static const char *const irishStyleForms[]
static const QLocale::Language irishStyleLanguages[]
static const char *const englishStyleForms[]
static const char *const polishForms[]
static const QLocale::Language lithuanianLanguage[]
static const char *const frenchStyleForms[]
static const uchar arabicRules[]
static const uchar macedonianRules[]
static const uchar irishStyleRules[]
static const uchar frenchStyleRules[]
static const uchar lithuanianRules[]
static const char *const latvianForms[]
static const uchar latvianRules[]
static const char *const gaelicStyleForms[]
static const char *const arabicForms[]
static const QLocale::Language latvianLanguage[]
static const QLocale::Language russianStyleLanguages[]
static const char *const malteseForms[]
static const QLocale::Language slovakStyleLanguages[]
static const uchar malteseRules[]
static const uchar russianStyleRules[]
static const char *const slovakStyleForms[]
const char *const * forms
const char *const gettextRules
const QLocale::Language * languages
const QLocale::Territory * countries
QString getNumerusInfoString()
bool getNumerusInfo(QLocale::Language language, QLocale::Territory territory, QByteArray *rules, QStringList *forms, const char **gettextRules)