Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

[WIP] Add mnemonic for menu items / actions

Open schoettl opened this issue 4 years ago • 3 comments

https://bugs.launchpad.net/pinta/+bug/1940763

In this PR, I started to define single-letter mnemonics as shortcuts (used with the Alt key).

E.g.:

#: ../Pinta/MainWindow.cs:330
msgid "_File"
msgstr "_Datei"

This can not be done only in .po files because one msgids in .po files often reference names of menu items and labels in other places. E.g. "Palette" appears as a menu item as well as a label for the palette toolbar. Therefore I cannot just change the msgstr in the .po files.

Also, it seems good to change the original msgid because this hints translators to also define mnemonics.

If maintainers agree, I'd continue with:

  • [x] Add more mnemonics
  • [x] Update messages.pot file
  • [ ] Refactor creation of action history items to deduplicate translations (e.g. "_Invert Selection" and "Invert Selection")
  • [ ] Update German .po file on translations.launchpad.net

schoettl avatar Aug 29 '21 17:08 schoettl

I think this looks good so far. To update the translation template you can run 'make updatepot' which will regenerate messages.pot with all the updated strings used in the code. That file is then pulled into the launchpad website for translators

(Also, I'll be on vacation so might not be responsive for the next week or so)

cameronwhite avatar Aug 30 '21 15:08 cameronwhite

There are some (almost-) duplicates in the translations now, e.g. "_Invert Selection" and "Invert Selection". The first one is used in the menu, the second one in the action history list.

That's not so clean. It would be better if the action's names would be used with the first _ discarded. That would probably be a nice refactoring.

@cameronwhite Can you explain to me how the translations work? If I update only the messages.pot – how are all other .po files are updated? Oh, looks like you can pull them from translations.launchpad.net. I think I understand…

schoettl avatar Aug 30 '21 19:08 schoettl

Yes, the messages.pot is uploaded to the launchpad translations site, where translators can then update the translations for each language. Eventually the updated .po files are then pulled back into the git repository

I agree that reducing the number of almost-duplicate translations would be ideal, especially since there are a lot of strings affected by this change

cameronwhite avatar Sep 09 '21 01:09 cameronwhite