Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. String IDs in QtCreator instead of text

String IDs in QtCreator instead of text

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 738 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    seasoned_geek
    wrote on last edited by
    #1

    Hello,

    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.

    Thanks,

    1 Reply Last reply
    0
    • martin_kyM Offline
      martin_kyM Offline
      martin_ky
      wrote on last edited by
      #2

      Qt uses strings (the original source text) as translation keys. But nothing prevents you from using the tr() functions like this:

      @tr("12345")@

      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?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved