[Tux4kids-commits] r976 - in tuxmath/trunk/src/tux4kidsadmin: . plugins/dummy src translations
Michał Świtakowski
swistakers-guest at alioth.debian.org
Fri May 15 19:44:59 UTC 2009
Author: swistakers-guest
Date: 2009-05-15 19:44:59 +0000 (Fri, 15 May 2009)
New Revision: 976
Added:
tuxmath/trunk/src/tux4kidsadmin/translations/
tuxmath/trunk/src/tux4kidsadmin/translations/tux4kidsadmin_pl.ts
Modified:
tuxmath/trunk/src/tux4kidsadmin/plugins/dummy/dummy.cpp
tuxmath/trunk/src/tux4kidsadmin/src/main.cpp
tuxmath/trunk/src/tux4kidsadmin/src/mainController.cpp
tuxmath/trunk/src/tux4kidsadmin/tux4kidsadmin.pro
Log:
made tux4kidsadmin translation-aware, works for both application and plugins
Modified: tuxmath/trunk/src/tux4kidsadmin/plugins/dummy/dummy.cpp
===================================================================
--- tuxmath/trunk/src/tux4kidsadmin/plugins/dummy/dummy.cpp 2009-05-10 12:06:04 UTC (rev 975)
+++ tuxmath/trunk/src/tux4kidsadmin/plugins/dummy/dummy.cpp 2009-05-15 19:44:59 UTC (rev 976)
@@ -10,7 +10,7 @@
QString DummyPlugin::name()
{
- return "dummy plugin";
+ return tr("dummy plugin");
}
Q_EXPORT_PLUGIN2(dummyPlugin, DummyPlugin);
Modified: tuxmath/trunk/src/tux4kidsadmin/src/main.cpp
===================================================================
--- tuxmath/trunk/src/tux4kidsadmin/src/main.cpp 2009-05-10 12:06:04 UTC (rev 975)
+++ tuxmath/trunk/src/tux4kidsadmin/src/main.cpp 2009-05-15 19:44:59 UTC (rev 976)
@@ -1,10 +1,20 @@
#include <QtGui/QApplication>
+#include <QTranslator>
+#include <QLocale>
+#include <QDebug>
#include "mainWindow.h"
int main(int argc, char *argv[])
{
+
QApplication app(argc, argv);
+
+ QTranslator translator;
+ qDebug() << QLocale::system().name();
+ translator.load("translations/tux4kidsadmin_" + QLocale::system().name());
+ app.installTranslator(&translator);
+
MainController controller;
MainWindow mainWindow(&controller);
mainWindow.show();
Modified: tuxmath/trunk/src/tux4kidsadmin/src/mainController.cpp
===================================================================
--- tuxmath/trunk/src/tux4kidsadmin/src/mainController.cpp 2009-05-10 12:06:04 UTC (rev 975)
+++ tuxmath/trunk/src/tux4kidsadmin/src/mainController.cpp 2009-05-15 19:44:59 UTC (rev 976)
@@ -10,9 +10,9 @@
loadPlugins();
if (plugins.isEmpty()) {
- qDebug() << "Failed to load plugins";
+ qDebug() << tr("Failed to load plugins");
} else {
- qDebug() << "Loaded plugins: ";
+ qDebug() << tr("Loaded plugins: ");
foreach(PluginInterface *plugin, plugins) {
qDebug() << plugin->name();
}
Added: tuxmath/trunk/src/tux4kidsadmin/translations/tux4kidsadmin_pl.ts
===================================================================
--- tuxmath/trunk/src/tux4kidsadmin/translations/tux4kidsadmin_pl.ts (rev 0)
+++ tuxmath/trunk/src/tux4kidsadmin/translations/tux4kidsadmin_pl.ts 2009-05-15 19:44:59 UTC (rev 976)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1" language="pl">
+<defaultcodec></defaultcodec>
+<context>
+ <name>DummyPlugin</name>
+ <message>
+ <location filename="../plugins/dummy/dummy.cpp" line="13"/>
+ <source>dummy plugin</source>
+ <translation>przykładowa wtyczka</translation>
+ </message>
+</context>
+<context>
+ <name>MainController</name>
+ <message>
+ <location filename="../src/mainController.cpp" line="13"/>
+ <source>Failed to load plugins</source>
+ <translation>Błąd przy ładowaniu wtyczek</translation>
+ </message>
+ <message>
+ <location filename="../src/mainController.cpp" line="15"/>
+ <source>Loaded plugins: </source>
+ <translation>Załadowane wtyczki:</translation>
+ </message>
+</context>
+<context>
+ <name>MainWindow</name>
+ <message>
+ <location filename="../src/mainWindow.ui" line="13"/>
+ <source>MainWindow</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
Modified: tuxmath/trunk/src/tux4kidsadmin/tux4kidsadmin.pro
===================================================================
--- tuxmath/trunk/src/tux4kidsadmin/tux4kidsadmin.pro 2009-05-10 12:06:04 UTC (rev 975)
+++ tuxmath/trunk/src/tux4kidsadmin/tux4kidsadmin.pro 2009-05-15 19:44:59 UTC (rev 976)
@@ -2,3 +2,7 @@
SUBDIRS = src \
plugins/dummy \
+
+TRANSLATIONS = translations/tux4kidsadmin_pl.ts \
+
+
More information about the Tux4kids-commits
mailing list