summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSami Lempinen <sami.lempinen@nokia.com>2011-10-14 06:18:15 (GMT)
committerSami Lempinen <sami.lempinen@nokia.com>2011-10-14 06:18:15 (GMT)
commit01057867c3e5e97fc8b58601e3cee6dfef0df205 (patch)
tree96125e444f32691c73bc87f0bc938993b7737899 /tools
parent138b9d7349d5daa1808d8bd891c5ecf817f98c52 (diff)
parent77563a2e63562e4e010e53dd79a707d9d7ed3f3d (diff)
downloadQt-01057867c3e5e97fc8b58601e3cee6dfef0df205.zip
Qt-01057867c3e5e97fc8b58601e3cee6dfef0df205.tar.gz
Qt-01057867c3e5e97fc8b58601e3cee6dfef0df205.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'tools')
-rw-r--r--tools/linguist/lupdate/main.cpp3
-rw-r--r--tools/linguist/shared/numerus.cpp30
-rw-r--r--tools/linguist/shared/translator.h2
-rw-r--r--tools/porting/src/qt3headers0.resourcebin548362 -> 548304 bytes
4 files changed, 28 insertions, 7 deletions
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp
index ab88083..7337732 100644
--- a/tools/linguist/lupdate/main.cpp
+++ b/tools/linguist/lupdate/main.cpp
@@ -508,6 +508,9 @@ int main(int argc, char **argv)
|| arg == QLatin1String("-h")) {
printUsage();
return 0;
+ } else if (arg == QLatin1String("-list-languages")) {
+ printOut(getNumerusInfoString());
+ return 0;
} else if (arg == QLatin1String("-pluralonly")) {
options |= PluralOnly;
continue;
diff --git a/tools/linguist/shared/numerus.cpp b/tools/linguist/shared/numerus.cpp
index ac519b5..1ab300c 100644
--- a/tools/linguist/shared/numerus.cpp
+++ b/tools/linguist/shared/numerus.cpp
@@ -361,13 +361,6 @@ static const NumerusTableEntry numerusTable[] = {
static const int NumerusTableSize = sizeof(numerusTable) / sizeof(numerusTable[0]);
-// magic number for the file
-static const int MagicLength = 16;
-static const uchar magic[MagicLength] = {
- 0x3c, 0xb8, 0x64, 0x18, 0xca, 0xef, 0x9c, 0x95,
- 0xcd, 0x21, 0x1c, 0xbf, 0x60, 0xa1, 0xbd, 0xdd
-};
-
bool getNumerusInfo(QLocale::Language language, QLocale::Country country,
QByteArray *rules, QStringList *forms, const char **gettextRules)
{
@@ -401,4 +394,27 @@ bool getNumerusInfo(QLocale::Language language, QLocale::Country country,
return false;
}
+QString getNumerusInfoString()
+{
+ QStringList langs;
+
+ for (int i = 0; i < NumerusTableSize; ++i) {
+ const NumerusTableEntry &entry = numerusTable[i];
+ for (int j = 0; entry.languages[j] != EOL; ++j) {
+ QLocale loc(entry.languages[j], entry.countries ? entry.countries[j] : QLocale::AnyCountry);
+ QString lang = QLocale::languageToString(entry.languages[j]);
+ if (loc.language() == QLocale::C)
+ lang += QLatin1String(" (!!!)");
+ else if (entry.countries && entry.countries[j] != QLocale::AnyCountry)
+ lang += QLatin1String(" (") + QLocale::countryToString(loc.country()) + QLatin1Char(')');
+ else
+ lang += QLatin1String(" [") + QLocale::countryToString(loc.country()) + QLatin1Char(']');
+ langs << QString::fromLatin1("%1 %2 %3\n").arg(lang, -40).arg(loc.name(), -8)
+ .arg(QString::fromLatin1(entry.gettextRules));
+ }
+ }
+ langs.sort();
+ return langs.join(QString());
+}
+
QT_END_NAMESPACE
diff --git a/tools/linguist/shared/translator.h b/tools/linguist/shared/translator.h
index 3b7bd64..d0da527 100644
--- a/tools/linguist/shared/translator.h
+++ b/tools/linguist/shared/translator.h
@@ -254,6 +254,8 @@ private:
bool getNumerusInfo(QLocale::Language language, QLocale::Country country,
QByteArray *rules, QStringList *forms, const char **gettextRules);
+QString getNumerusInfoString();
+
bool saveQM(const Translator &translator, QIODevice &dev, ConversionData &cd);
/*
diff --git a/tools/porting/src/qt3headers0.resource b/tools/porting/src/qt3headers0.resource
index 8e24385..1a3e8a0 100644
--- a/tools/porting/src/qt3headers0.resource
+++ b/tools/porting/src/qt3headers0.resource
Binary files differ