Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I translate the application menu of a Qt Application on Mac?

I'm trying to port a Qt application from Linux to Mac Os X, and I have a problem to localize the application menu (menu which contains Preferences, Quit, ...).

I followed instructions from http://doc.qt.io/archives/qt-4.7/mac-differences.html (Translating the Application Menu and Native Dialogs) - I've created a locversion.plist and changed the value of LProjLocal from 'no' to 'fr' - I've copied this file into the folder Resources/fr.lproj of my bundle - I run my application but the application menu is still in English.

Did I miss something? How can I solve this problem?

like image 679
Vincent Avatar asked Apr 08 '11 13:04

Vincent


People also ask

How do you use translation on a Mac?

When writing on your Mac, you can replace what you have written with a translation. Select the text you want to replace with a translation. Control-click the selected text, then choose Translate. Click Replace with Translation to insert the translation and replace the original text.

How do you use Qt Linguist?

Qt Linguist is a tool for adding translations to Qt applications. Run Qt Linguist from the taskbar menu, or by double clicking the desktop icon, or by entering the command linguist at the command line. Once Qt Linguist has started, choose File|Open from the menu bar and select a translation source (TS file) to load.


1 Answers

I found the solution to my problem:

When I ported from Linux, I kept the translations files of qt (qt_xx.qm). However, strings of the application menu aren't translated in this file. I've just replaced this file by the qt_xx.qm of the Qt Sdk for Mac and ... it works.

Some precisions: on Snow Leopard, with Qt 4.7.0, only a folder named xx.lproj is needed to translate the application menu and the dialogs qt.

Sorry for bothering you.

like image 70
Vincent Avatar answered Nov 15 '22 07:11

Vincent