Shortcut keys translation

From Bluefish Wiki
Jump to: navigation, search

There are at least three kinds of Shortcut keys:
the editor window accelerator keys (EWA keys), The top main menu keys and the contextual menus keys (CM keys). Only the last two concern the translator. For EWA keys, see Accelerator keys.

Contents

Contextual menus keys

In po files shortcut keys, known as hotkeys or even accelerator keys, are defined as follows (look at the underscore, please):

# src/toolbars.c:482
#: ../src/filebrowser.c:1453
msgid "/_Refresh"
msgstr "/_Actualizar"

It means that in the English locale the user have to press R or r to activate this particular GUI element. On the other hand if your locale is Spanish your shortcut key will be A or a.

Man2 warning.png You have to keep in mind that two GUI elements must not have the same shortcut key at the same level.
.

Main menu

Ref main menu fr.png

To activate a Main Menu entry, e.g. _Fichier one must press Alt+f.


Navigation within a menu

Man2 tip.png When you can not do otherwise, it is permissible to have duplicate hotkeys

in a menu, simply type it twice `c` to get the second `c` choice. But if the first occurrence is an immediate command or a submenu, it will not work.

Once a menu is a bit long, it is very difficult to see if there are duplicates…

On the other hand when we spotted a duplicate it very difficult to know where the msgid to translate.

There is a bash script to help with the translation of hotkeys: hotkey.sh, to install it, must be placed in the local SVN copy directory.

cd bluefish_svn
mkdir po-tools && cd po-tools
wget http://clansco.info/bluefish/hotkey.sh.bz2
bunzip2 hotkey.sh.bz2 && chmod +x hotkey.sh
hotkey.sh


Hotkeys.png

Now choose a language (here nl) and check a menu, (here t for Tool). We can see that we have two c, in lines 155 and 348, and if you go back a little earlier in the terminal window reads: Tools Menu: po/

As we have no s in used hotkeys list, we can choose s for `msgstr "Schakel _Commentaar"` . Edit and save po/nl.po. Type t again in hotkey.sh window and you see you have 4 duplicate (was five).

If I type h I make a check for almost all menus and submenus of Tags and Dialogs, l give a report for (almost) all nl menus.

Complete check results for every language are available here: http://clansco.info/bluefish/

hotkeys translation status

rev 7501 Hotkeys status.png

Personal tools