Results 1 to 2 of 2

Thread: How to handle that some texts should differ from the language file?

  1. #1
    Join Date
    Aug 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows Android

    Default How to handle that some texts should differ from the language file?

    Hi,

    in our previous non-QT application we used a unique identifier for each text string in the program. The identifier and language-specific texts were stored in a database and read whenever the GUI needed them. End-users had the possibility to change some of these texts if wanted.

    When using tr() and Linguist in QT, this is brilliant for translating the application to several languages, and switching between them by simply changing loaded qm-file. I wonder however how I could easily let the end-user change just some of the texts in their application. Say that the app has 2000 strings that is translated to their language, but 10 of them need to be changed since their industry require a different text.
    I would prefer not to make a whole new qm-file for the specific industry in each language. If I could let the tr() method first check if the string was present as an item in the database, otherwise use the text from the qm-file, this might be a solution, but I'm not sure if it is a good one.

    Any ideas on how to solve this? Thanx

  2. #2
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: How to handle that some texts should differ from the language file?

    I guess you may subclass QTranslator, override translate() method and then put that translator object on top of translators stack.
    How do you think?

Similar Threads

  1. How to get the file handle in QT???
    By Gokulnathvc in forum Newbie
    Replies: 3
    Last Post: 9th March 2011, 09:17
  2. Select texts using the QRubberband
    By charlesprime in forum Qt Programming
    Replies: 0
    Last Post: 16th February 2011, 07:14
  3. QTextStream and file handle
    By Dilshad in forum Newbie
    Replies: 2
    Last Post: 4th January 2011, 12:26
  4. How to hange color for different texts in plaintextedit?
    By sudhansu in forum Qt Programming
    Replies: 3
    Last Post: 13th August 2010, 14:36
  5. Windows file handle on QFile?
    By Teerayoot in forum Qt Programming
    Replies: 4
    Last Post: 14th May 2007, 12:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.