Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, September 2007
Shortcut translation problem


Message 1 in thread

Hi,

I use German as the default language in my program and create a shortcut
with the following line of code (Strg is German for Ctrl):

quitAct.setShortcut(tr("Strg+Q"));

I've translated it to English and when I run it with English locale
settings the menu entry in question uses Ctrl+Q as shortcut. But when
run with German locale settings it omits the "Strg" and just uses "Q" as
shortcut.


Regards,

Andreas


Message 2 in thread

Hi, Andreas

You have discovered a problem with our package. And that is that it doesn't 
contain the translation files needed to translate qt.

If the correct translation files where loaded, your app would have worked as 
expected. (You need to load both, your translation and the qt translation)

As a workaround while waiting for our next version, you can use this as your 
Qt translation file, to fix the shortcut problem.

Example ts file:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="en_AU">
<context>
    <name>QShortcut</name>
    <message>
        <source>Ctrl</source>
        <translation>Strg</translation>
    </message>
</context>
</TS>

You should also be able to use a qm file from any Qt 4.3 release.

Thanks for reporting and helping us finding problems. :-)

Best regards 
  HÃvard F

On Thursday 20 September 2007 01:10, Andreas Heck wrote:
> Hi,
>
> I use German as the default language in my program and create a shortcut
> with the following line of code (Strg is German for Ctrl):
>
> quitAct.setShortcut(tr("Strg+Q"));
>
> I've translated it to English and when I run it with English locale
> settings the menu entry in question uses Ctrl+Q as shortcut. But when
> run with German locale settings it omits the "Strg" and just uses "Q" as
> shortcut.
>
>
> Regards,
>
> Andreas