serge-community / serge

Continuous localization platform
https://serge.io/
Other
237 stars 53 forks source link

Qt Text Id based (ts files) #122

Closed Amf1k closed 4 years ago

Amf1k commented 5 years ago

Does the parser support Text ID Based Translations in .ts files (Qt5)?

iafan commented 5 years ago

I'm not familiar with Qt, but as far as I understand from https://doc.qt.io/qt-5/linguist-id-based-i18n.html, Text IDs is just a way to address strings in the code (by using their IDs, not the actual text). Regardless of the approach, the lupdate tool, which is a part of Qt, will extract strings into resource files (.ts), and the format of this file remains the same.

Serge has a parser for Qt .ts files: https://serge.io/docs/plugins/parser/parse_ts/

Amf1k commented 5 years ago

the question is, will the parser lose the id attribute of the message element?

iafan commented 5 years ago

No, the only thing it does is it replaces the contents of the <translation> tag and removes its type attribute (see the code). Otherwise, the entire XML file structure should be preserved. Let me know if this is not the case, and I'll have a look.

Amf1k commented 5 years ago

Ok. i check it

iafan commented 4 years ago

I assume the parser plugin works as expected, so I'll close this issue. But feel free to re-open if you still have troubles using it.