QT Translation - Multi Language Support
-
Hi my pro file
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = trans
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
TRANSLATIONS = sample.ts
follwing is my ts file with respective button changes translation
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="14"/>
<source>MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="14"/>
<source>&Up</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="15"/>
<source>&Down</source>
<translation type="unfinished">ccc</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="16"/>
<source>&Left</source>
<translation type="unfinished">bbbb</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="17"/>
<source>&Right</source>
<translation type="unfinished">aaa</translation>
</message>
</context>
</TS>iam new to Qtranslation can you help me out
-
Hi.
-i saw there are lot of insufficient code .-
-1)in .pro file-
-Problem : -TRANSLATIONS = sample.ts--2)in xml (*.ts)-
-Problem : -<TS version=“2.0”>-"Link : ":http://doc.gnu-darwin.org/linguist/tt1.html
(Edited@IamSumit)
hope it helps
-
Hi i have changed the ts file as below still iam not able too see any translation
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS>
<context>
<name>MainWindow</name>
<message>
<location filename="mainwindow.ui" line="14"/>
<source>MainWindow</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="14"/>
<source>&Up</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="15"/>
<source>&Down</source>
<translation>ccc</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="16"/>
<source>&Left</source>
<translation>bbbb</translation>
</message>
<message>
<location filename="mainwindow.cpp" line="17"/>
<source>&Right</source>
<translation>aaa</translation>
</message>
</context>
</TS> -
Hi and welcome to devnet,
What you have to write in order to do dynamic translation can be found in the "Internationalization with Qt" chapter of Qt's documentation. More precisely under "Dynamic Translation"
-
It's not a pro file problem. The code from janga is not written to support dynamic translation.
-
Go to the documentation chapter I indicated, there's everything you need there including code.