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. How to change the application language.
Forum Updated to NodeBB v4.3 + New Features

How to change the application language.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 788 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.
  • U Offline
    U Offline
    umadevi
    wrote on 2 Dec 2016, 10:13 last edited by
    #1

    Hai,
    I have an menu which select Language, by clicking select Language a dialog window will open where I am able to select and change the language of my application. Now my doubt is how to set this selected Language as default language to the application. For example if I select French as my Language the from the menu , whenever I start the application it should be in French. How to set default language so that I need to not select my language every time?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      m.sue
      wrote on 2 Dec 2016, 10:26 last edited by m.sue 12 Feb 2016, 10:33
      #2

      Hi,
      you can save your selection using the class QSettings. Write the settings after you chose it. Read it back at the start of your application and initialize the languge accordingly.
      E.g. like this:

      QSettings settings("OrganisationName","ApplicationName");
      settings.beginGroup("General");
      
      //write "French"
      settings.setValue("Language","French");
      //read "French" back
      QString szLanguage=settings.value("Language",QString()).toString();
      
      settings.endGroup();
      

      -Michael

      1 Reply Last reply
      2
      • U Offline
        U Offline
        umadevi
        wrote on 2 Dec 2016, 11:13 last edited by
        #3

        Thanks :)

        1 Reply Last reply
        0

        1/3

        2 Dec 2016, 10:13

        • Login

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