Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Dynamic locale change

Dynamic locale change

Scheduled Pinned Locked Moved Unsolved Language Bindings
2 Posts 2 Posters 872 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
    spanara
    wrote on last edited by
    #1

    Hello There,
    I have a requirement to change the locale at run time.
    I am aware of following mechanism,

    1. Remove the existing translator insatalled
    2. install new translator according to the locale selected
    3. Handle the Language change Event

    In the language change event, I can set any static text under TR macro and it displays according to the locale selected.

    Since I have many widgets in my application,
    My question is, if I have a QPushButton with static label. Is it possible to change the label automatically (other than the steps I mentioned above)? OR one has to catch the language change event and once again set the text so that it gets localized?

    Thanks
    SPanara

    JonBJ 1 Reply Last reply
    0
    • S spanara

      Hello There,
      I have a requirement to change the locale at run time.
      I am aware of following mechanism,

      1. Remove the existing translator insatalled
      2. install new translator according to the locale selected
      3. Handle the Language change Event

      In the language change event, I can set any static text under TR macro and it displays according to the locale selected.

      Since I have many widgets in my application,
      My question is, if I have a QPushButton with static label. Is it possible to change the label automatically (other than the steps I mentioned above)? OR one has to catch the language change event and once again set the text so that it gets localized?

      Thanks
      SPanara

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @spanara
      I would assume you will have to do your steps --- how else would the button know to change its text?

      But with your "many widgets" you should not have to write code for each widget to handle this/update itself. You should be able to loop over all of them doing the updates in one go.

      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