Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add macros to translation resource
Qt 6.11 is out! See what's new in the release blog

Add macros to translation resource

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 341 Views 1 Watching
  • 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.
  • DialecticusD Offline
    DialecticusD Offline
    Dialecticus
    wrote on last edited by
    #1

    I have a C++ Qt project with ID-based translation mechanism. I have some macros, for instance:

    #define EXAMPLE_NAME_ID 42
    #define EXAMPLE_NAME_TEXT "Example Name"
    

    Given these two macros, is it possible to add in C++ source a new translatable text with identifier resource-text-42, and source text "Example Name"? Something like the following (which for many many reasons obviously doesn't work):

    \\% EXAMPLE_NAME_TEXT
    QT_TRID_NOOP("resource-text-" ## EXAMPLE_NAME_ID);
    

    I know all the reasons why this doesn't work. This "code" is meant to convey intent, not to work. The question is can it be done some other way?

    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