-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Avoid unchanged translation of keyboard shortcuts to work around problems #2235
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
Conversation
…lems There are some problems with some translations where the keyboard shortcut does not work when translated. To prevent those problems, a general reset of all the translations which are supposed to not change the actual key combination has been made. Only some shortcuts in Italian are clearly changed by the translation and those have been preserved. See issue #2178 as is.
|
@Feyn-Man, @GortiZ6, the Italian case might have a problem too. Ctrl+C has been used for "Saving changes" but in a lot of context menus Copy is still mapped to Ctrl+C. Unless other Qt versions remap that, Ctrl+C would not be obeyed in those contexts as Copy because the general "Save changes" would eclipse it. My Qt version (5.9.5) does not remap Copy shortcut. Is that an error? |
|
Should we mention all the other translators? Most of them cannot be referenced as reviewers. |
|
This seems like a Qt bug to me. In the Portuguese translation, for instance, I think Return should be shown as Enter and Space as Espaço. Is there a way to translate the name of the keys but not change the shortcut? |
Yes, this might a Qt bug or a bug in how we distribute Qt for some platforms, but don't worry about the keys being untranslated. They should be, anyway. The "translation" here is intended for remapping keys in the language (some software makers like to do that). For example, in Microsoft programs in Spanish, you use Ctrl+E for Select All because you have to use Ctrl+A for Open (Abrir). If you are not making this, there is no reason to translate the keys. Qt will translate them for you, unless there aren't any translation in Qt for that language (then the standard buttons wouldn't be translated either). In this latter case, the translation of the shortcut would break it (or so I think). I checked that in Spanish and German in my system the keys are translated (I'd need to install other language packages in my system to test the others) but the most important part is that the shortcuts work in all languages. See the analysis made by @horst-p-w-neubauer in #2178 (comment) Portuguese did not work for him. Maybe it works in some other platforms, but it is better if they work in all, and then, if correctly provided by Qt and distributed by us, the keys will be translated in the GUI. I wanted all of you to review this, mainly to confirm that I haven't erased any remapping that you were doing. Sorry for not making that explicit. |
horst-p-w-neubauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the reset of the type="vanished" attribute in many files. I'd vote for remove the vanished items completely as I think, they are only necessary when they show up for the first time, because they are often a pattern for a lite changed version of the text so it helps to translate the new version. But one might regrett, losing the type="vanished" information itself. If tested it and it doesn't reapear, when you have linguist update the .ts files. I think this should be solved before commiting. Are you using a xsl-transformation to fix this?
We should not worry about the missing vanished attribute. Yes, that should not change, but I used a simple awk script to fix them and it had this side effect. This can be fixed if But nevertheless, I'm thinking that there might be conflicts nevertheless and I should rerun the script in the other branch. I save it here for the future, so we don't have to rethink it again. for i in *.ts; do
awk '
/source>Ctrl\+|source>Alt\+|source>Shift\+/ {print; v_key=1}
!/source>Ctrl\+|source>Alt\+|source>Shift\+/ {if(!v_key) {print} else {print " <translation></translation>"; v_key=0}}
' $i > $i.new;
mv $i.new $i;
done |
|
Looking at the script I see that I forgot Function keys. In any case, the translations never changes those, so might be unnecessary. Should I include them? |
|
Function keys are no problem at all. I've checked every .ts file. |
|
I cannot find the . |
|
No, they simply disappear, which is better. In fact, lupdate should have an
option for that, but I looked at it, and it doesn't. After a release all
the vanished strings should be removed.
|
horst-p-w-neubauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it.
Agreed.
As far as I checked, it seems good to go. |
|
I add a xml transformation for potential future use that respects the attributes. It can be used as template for other transformations in the .ts workspace as well. |
|
Thanks, @horst-p-w-neubauer. It could be useful for other more complex transformations. I've used XSL before, but the syntax is so convoluted, that it's impossible to keep in my memory for quick XML processing. The good thing about AWK is that it's simple and it's applicable to any text format. Of course, for XML is less specialized and complex processing would be more difficult. For example, we could use it after the release to remove vanished strings from up-to-date ts files. |
Forget about this, I've just discovered that you can remove vanished entries using the |
one missing 'Ctrl' to 'Strg' translation in explaining text
|
there was a missing translation in explaining keys - not in Short-Cut value - in German translation |
|
Would you please check my explanation on the wiki if it is what we found out and if it is easy enough to understand? |
I've tried to clarify and complete the explanation. I hope I haven't added too much detail about the rationale. |
|
@mgrojo yes, the CTRL+C was a mistake, have you already fixed it or should I do something? |
I can do that in this branch. The problem is: if Ctrl+S isn't remapped to Ctrl+C, Ctrl+W cannot be remapped to Ctrl+S. Should we leave both of them unchanged? These are the current remappings: |
|
So.. |
But if you take other products as example, like those by Microsoft, a lot of shortcuts are translated. For Spanish, Ctrl+O is remapped to Ctrl+A (abrir), Ctrl+A to Ctrl+E (¿entero=all?), Ctrl+S to Ctrl+G (guardar), etc. I suppose that they don't want to be regarded as English-centric products, but at the end, most people don't like that, because not all the programs we use are translated, or even when they are, don't follow those remappings and stick with the English standard.
It made sense to remap some if one likes to follow the Microsoft way, but the problem is that all the shortcuts have to be regarded as a whole, so there aren't any clashes. Ok, I will reset also Italian if you confirm that you think it's the preferred solution. |
|
Looks good to me. In my opinion the benefit of translated keyboard shortcuts is minimal anyway because at some point when you run out of keys, the shortcuts tend to stop making sense. E.g. if all shortcuts were like Ctrl+T for opening a tab, they would be worth translating. But shortcuts like Ctrl+W for closing a tab make this a hopeless endeavour. |
In Portuguese, similar changes are made in MS stuff. I think this made more sense 10+ years ago when most office jobs could be done with only 1 or 2 different applications. Nowadays, with web-based apps and a multitude of smaller tools that may be required for day-to-day work, I think the way forward is to try to follow the de facto standard as much as we can and not translate the shortcuts. |
|
I agree, I can confirm that Microsoft is translating all the shortcuts to match the translated word, but most of the other companies do not. So it's more a philosophical debate. I think that this should be decided on project leads. I'll be available in case you want to follow the Microsoft idea to translate all the shortcuts (just let me know), if not, please revert them all. If I can vote, I think that keeping the shortcuts identical can help when using "english tutorials/guides" on internet (which are the most available). |
I agree 👍 |
|
Agreed. I've updated the branch removing all translations of shortcuts, including function keys and remapped keys in Italian. When Travis confirms that everything is OK, I will merge the branch. |
- Removed translation of Function keys for all languages - Removed also remapped shortcuts for Italian See issue #2178 and discussion in PR #2235. # Conflicts: # src/translations/sqlb_cs.ts # src/translations/sqlb_de.ts # src/translations/sqlb_es_ES.ts # src/translations/sqlb_fr.ts # src/translations/sqlb_ja.ts # src/translations/sqlb_ko_KR.ts # src/translations/sqlb_pl.ts # src/translations/sqlb_pt_BR.ts # src/translations/sqlb_ru.ts # src/translations/sqlb_tr.ts # src/translations/sqlb_uk_UA.ts # src/translations/sqlb_zh.ts # src/translations/sqlb_zh_TW.ts

There are some problems with some translations where the keyboard shortcut
does not work when translated. To prevent those problems, a general
reset of all the translations which are supposed to not change the actual
key combination has been made.
Only some shortcuts in Italian are clearly changed by the translation and
those have been preserved.
See issue #2178.