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. Lupdate and macros

Lupdate and macros

Scheduled Pinned Locked Moved Unsolved General and Desktop
lupdatemacrostranslate
3 Posts 3 Posters 1.3k 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
    sailor.steve
    wrote on 9 Oct 2018, 10:07 last edited by
    #1

    Hi all,
    I develop multilanguage software and use QObject::tr for translate.
    In my case I also use a specific macros and some of them expand in text which must be translated.
    I wrapped the text in macros that need to be translated in QObject::tr but lupdate doesn't see these lines. In the preprocessed files I see this text with QObject::tr.
    Is there any way to make lupdate see these lines of text?

    S P 2 Replies Last reply 9 Oct 2018, 10:49
    0
    • S sailor.steve
      9 Oct 2018, 10:07

      Hi all,
      I develop multilanguage software and use QObject::tr for translate.
      In my case I also use a specific macros and some of them expand in text which must be translated.
      I wrapped the text in macros that need to be translated in QObject::tr but lupdate doesn't see these lines. In the preprocessed files I see this text with QObject::tr.
      Is there any way to make lupdate see these lines of text?

      S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 9 Oct 2018, 10:49 last edited by
      #2

      @sailor.steve said in Lupdate and macros:

      Is there any way to make lupdate see these lines of text?

      Move the texts out of macros. Make them static variables, members of some singleton - whatever. lupdate just does not get macros.

      (Z(:^

      1 Reply Last reply
      2
      • S sailor.steve
        9 Oct 2018, 10:07

        Hi all,
        I develop multilanguage software and use QObject::tr for translate.
        In my case I also use a specific macros and some of them expand in text which must be translated.
        I wrapped the text in macros that need to be translated in QObject::tr but lupdate doesn't see these lines. In the preprocessed files I see this text with QObject::tr.
        Is there any way to make lupdate see these lines of text?

        P Offline
        P Offline
        Pablo J. Rogina
        wrote on 10 Oct 2018, 19:19 last edited by
        #3

        @sailor.steve said in Lupdate and macros:

        I wrapped the text in macros that need to be translated

        In addition to @sierdzio response, please keep in mind that Qt translation tools use the "original" text as the key for looking the proper translation in the available loaded Qt translator object, and if such string is not found, that same string is displayed instead.

        This is a little bit different from some other translation tools that use "constants" (i.e. macro?) as the key and then you provide a file with constant -> translation pairs.

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2

        2/3

        9 Oct 2018, 10:49

        • Login

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