Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
String IDs in QtCreator instead of text
seasoned_geek last edited by
Is there a way to make QtCreator use string ID instead of text? I want it to generate trId() calls instead of tr() calls so we could universally use ID which makes multiple language support far easier.
martin_ky last edited by
Qt uses strings (the original source text) as translation keys. But nothing prevents you from using the tr() functions like this:
where 12345 is your translation ID. But Qt seems to make it possible to attach an ID to a translation key. Perhaps "this":http://qt-project.org/doc/qt-5.0/qtdoc/i18n-source-translation.html#adding-meta-data-to-strings is what you are looking for?