Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to translate QComboBox's "Cancel" and "Done" button in iOs ?

How to translate QComboBox's "Cancel" and "Done" button in iOs ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 682 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.
  • C Offline
    C Offline
    Coolie
    wrote on last edited by Coolie
    #1

    0_1520236165500_cmb.jpg

    I use Qt to make a multilanguage app for iOS.

    and i use ".ts" and ".qm" file to translate text.

    the QComboBox in ios has 2 buttons can't be translate.

    the ts file need a classname, but i can't found this 2 words in any class from qt source.

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE TS>
    <TS version="2.1" language="id-ID">
    <context>
        <name>QComboBox</name>
        <message>
            <source>Cancel</source>
            <translation>test1</translation>
        </message>
        <message>
            <source>Done</source>
            <translation>test2</translation>
        </message>
    </context>
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      Coolie
      wrote on last edited by Coolie
      #2

      the test source code:

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QWidget w;
      
          QLabel lb("你的年龄:", &w);
      
          QComboBox cmb(&w);
          QStringList sl;
          sl << "10-19岁" << "20-29岁" << "30-39岁";
          cmb.addItems(sl);
      
          QHBoxLayout *hl = new QHBoxLayout(&w);
          hl->addWidget(&lb);
          hl->addWidget(&cmb);
      
          w.show();
      
          return a.exec();
      }
      

      app run ui:
      0_1520585138208_before_click.png

      after click QCombobox, it show as iPhone style with the "Done" and "Cancel“ button, how to translate this 2 buttons ?
      0_1520585576850_after_click.png

      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