Example 1 (Base language):
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="en"> <context> <name>color</name> <message> <source>red</source> <translation></translation> </message> <message> <source>blue</source> <translation></translation> </message> </context> </TS>
Note: For base language, you may leave <translation>
empty and our system will extract content inside <source>
as the source string.
Example 2 (Key-value with groups):
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="fr"> <context> <name>color</name> <message> <source>red</source> <translation>rouge</translation> </message> <message> <source>blue</source> <translation>bleu</translation> </message> </context> <context> <name>color_capital</name> <message> <source>RED</source> <translation>ROUGE</translation> </message> <message> <source>BLUE</source> <translation>BLEU</translation> </message> </context> </TS>
Example 3 (With Comments):
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="fr"> <context> <name>color</name> <message> <source>red</source> <translation>rouge</translation>
<extracomment>This is some extra comment.</extracomment>
<comment>This is some comment.</comment> </message> <message> <source>blue</source> <translation>bleu</translation>
<comment>This is some comment.</comment> </message> </context> </TS>
Note: <extracomment>
takes precedence over <comment>
Note: pluralization is not supported for QT (.ts) files.
Comments
1 comment
Hello Maggie, Could you recommend which IDE to use for formatting .ts files or any tool available?
Please sign in to leave a comment.