Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add mnemonic for menu items / actions #199

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

schoettl
Copy link

@schoettl schoettl commented Aug 29, 2021

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:

  • Add more mnemonics
  • 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

@cameronwhite
Copy link
Member

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)

@schoettl
Copy link
Author

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…

@cameronwhite
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants