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. [Solved] Application menu translation on Mac

[Solved] Application menu translation on Mac

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 4.9k 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.
  • J Offline
    J Offline
    jimcad
    wrote on last edited by
    #1

    I follow this instruction: http://qt-project.org/doc/qt-4.8/mac-differences.html#translating-the-application-menu-and-native-dialogs

    I have created *.lproj -folders and put locversion.plist. Also I have changed content of locversion.plist such as described in the documentation. But I can't get this working. Application menu is always in English even language of Mac OS X is different.

    Here is the bundle structure:
    @
    MyApp.app/Contents/
    Resources/
    en.lproj/
    locversion.plist
    fi.lproj/
    locversion.plist
    sv.lproj/
    locversion.plist
    @

    (I have Qt 4.8.3 and Mac OS X 10.8)

    Any ideas?

    Thanks.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jimcad
      wrote on last edited by
      #2

      I found the solution. I add the following parts to my ts-file:
      @<context>
      <name>MAC_APPLICATION_MENU</name>
      <message>
      <source>Services</source>
      <translation>Services</translation>
      </message>
      <message>
      <source>Hide %1</source>
      <translation>Hide %1</translation>
      </message>
      <message>
      <source>Hide Others</source>
      <translation>Hide Others</translation>
      </message>
      <message>
      <source>Show All</source>
      <translation>Show All</translation>
      </message>
      <message>
      <source>Preferences...</source>
      <translation>Preferences...</translation>
      </message>
      <message>
      <source>Quit %1</source>
      <translation>Quit %1</translation>
      </message>
      <message>
      <source>About %1</source>
      <translation>About: %1</translation>
      </message>
      </context>@

      Now I can translate application menu in the same way as the other parts.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bootchk
        wrote on last edited by
        #3

        I think that context is already defined in SOME of the qt_xx.qm files. So it depends on the language, and the extent to which the community has provided translations into the qt_xx.ts files for the language?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Cindy
          wrote on last edited by
          #4

          Excuse me. Could I ask a basic question?

          How to create *.lproj -folders and put locversion.plist in to my application bundle?
          I am very confused. Should I use "add_custom_target(locversion.plist...)" or anything else?

          Thanks.

          1 Reply Last reply
          0
          • TobyYiT Offline
            TobyYiT Offline
            TobyYi
            wrote on last edited by
            #5

            I find this workground is not fixed to my mac app on Qt5.8? anybody know ?
            thanks

            将QtCoding进行到底,做Qt的宠儿
            关注移动互联网,关注手机助手
            开发即时通讯,服务于金融行业
            My github :https:&#x2F;&#x2F;github.com&#x2F;toby20130333

            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