[Solved] Application menu translation on Mac



  • 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.



  • 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.



  • 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?



  • 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.



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.