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 816 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 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.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by m.sue
      #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 last edited by
        #3

        Thanks :)

        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