0

I used lrelease command to create the .qm file from .ts file. However, only few of the words get translated when I change the language.

The funny part is one of the strings gets translated at one place and does not at the other. What could be wrong?

Kartik
  • 45
  • 1
  • 4

1 Answers1

0

Are you sure that your .ts file is formatted as this?

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="it_IT">
<context>
    <name>CustomDialogItems</name>
    <message>
        <location filename="../assets/CustomDialogItems.qml" line="39"/>
        <location filename="../assets/CustomDialogItems.qml" line="58"/>
        <source>Max Number of items</source>
        <translation type="unfinished">Numero Massimo di Voci</translation>
    </message>
    <message>
        <location filename="../assets/CustomDialogItems.qml" line="100"/>
        <source>Cancel</source>
        <translation type="unfinished">Cancella</translation>
    </message>
    <message>
        <location filename="../assets/CustomDialogItems.qml" line="109"/>
        <source>Set</source>
        <translation type="unfinished">Imposta</translation>
    </message>
</context>
</TS>

If you see type="obsolete" it means that the translation is no longer used.

However I've seen that some words are automatically translated if they are the texts of common actions, like dismissAction or shareAction. But you can force the translation adding 'text' property.