File name should not be a problem, change context name to QObject and it should work.
I've just tested your code and get this output:
loaded: true
------------------
"old"
"velho"
"new"
"novo"
------------------
------------------
"velho"
"velho"
"new"
"new"
------------------
.ts file:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt" sourcelanguage="en">
<context>
<name>QObject</name>
<message>
<source>old</source>
<translation>velho</translation>
</message>
<message>
<source>novo</source>
<translation>new</translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt" sourcelanguage="en">
<context>
<name>QObject</name>
<message>
<source>old</source>
<translation>velho</translation>
</message>
<message>
<source>novo</source>
<translation>new</translation>
</message>
</context>
</TS>
To copy to clipboard, switch view to plain text mode
Btw if you call lupdate <project file name> you will get proper file ready for translating. Don't forget to call lrelease <project file name> after editing the .ts file.
Bookmarks