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. Translate part of application is it possible ?
Forum Updated to NodeBB v4.3 + New Features

Translate part of application is it possible ?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 461 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.
  • cfdevC Offline
    cfdevC Offline
    cfdev
    wrote on last edited by
    #1

    Hey!
    I would like to translate a part of my application before create class is it possible ?

    Currently it's work fine for complete application, but I need to translate an print preview in other language with this way :

    - Load translator with language .qm 
    - create class
    - display only this widget and base class with this new language
    
    

    Thanks

    raven-worxR 1 Reply Last reply
    0
    • cfdevC cfdev

      Hey!
      I would like to translate a part of my application before create class is it possible ?

      Currently it's work fine for complete application, but I need to translate an print preview in other language with this way :

      - Load translator with language .qm 
      - create class
      - display only this widget and base class with this new language
      
      

      Thanks

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @cfdev
      should be possible:

      1. create QTranslator object
      2. use it's load() method to load the .qm file (don't use QCoreApplication::installTranslator())
      3. use it's translate() method directly to get the translated strings - instead of tr()

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      4
      • cfdevC Offline
        cfdevC Offline
        cfdev
        wrote on last edited by cfdev
        #3

        Thanks @raven-worx but I see a problem:
        How to reference this string to translate if I don't put the tr("")... ?

        ---- EDIT
        Arf sorry lupate take the const string too!
        Solved Thx ;)

        1 Reply Last reply
        1

        • Login

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