maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   i18n inside both python- and qml-files (https://talk.maemo.org/showthread.php?t=86369)

EmaNymton 2012-08-29 18:53

i18n inside both python- and qml-files
 
Hi,
maybe a stupid question but I didn't find anything about on the net.
I want to translate my application and have strings inside the python-files and qml files. For qml-files I used always lupdate and was fine. If I mark my strings in the python-file with self.tr("bla") lupdate gives me an error
Code:

tr() cannot be called without context
So after some search, I found this thread
which says use pylupdate4. This works now for the python file but not for the qmls. So my workaround for now is to copy and paste both generated ts-files together and it build the qm out of this one. This works but I feel I'm doing something wrong ;)

Anyone out there who can help me or have a "cleaner" way?

CepiPerez 2012-08-29 18:56

Re: i18n inside both python- and qml-files
 
lupdate works but don't use tr() function
check wazapp source code
the file waxmpp.py has some translations


All times are GMT. The time now is 09:17.

vBulletin® Version 3.8.8