ADDED basic Qt translation framework

This commit is contained in:
spacy51 2008-02-06 13:59:07 +00:00
parent 92faefe922
commit 4a61da3136
4 changed files with 19 additions and 2 deletions

11
lang/german.ts Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="de_DE">
<context>
<name>QPushButton</name>
<message>
<location filename="../src/qt/main.cpp" line="16"/>
<source>Hello World!</source>
<translation>Hallo Welt!</translation>
</message>
</context>
</TS>

View File

@ -3,3 +3,4 @@ CONFIG += qt
TARGET = VisualBoyAdvance
HEADERS += ../../src/qt/main.h
SOURCES += ../../src/qt/main.cpp
TRANSLATIONS += ../../lang/german.ts

View File

@ -2,13 +2,18 @@
#include <QApplication>
#include <QPushButton>
#include <QTranslator>
int main( int argc, char *argv[] )
{
QApplication theApp( argc, argv );
QPushButton hello( TEST_STRING );
QTranslator translator;
translator.load( "lang/german" );
theApp.installTranslator( &translator );
QPushButton hello( QPushButton::tr( "Hello World!" ) );
hello.resize( 192, 48 );
hello.show();

View File

@ -1,6 +1,6 @@
#ifndef MAIN_H
#define MAIN_H
#define TEST_STRING "Hello World!"
#endif // #ifndef MAIN_H