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

Update Arabic translation #2406

Merged
merged 2 commits into from
Sep 22, 2020

Conversation

SafaAlfulaij
Copy link
Contributor

@SafaAlfulaij SafaAlfulaij commented Sep 18, 2020

Copy link
Member

@lucydodo lucydodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing! 😄
I found some items that needed simple corrections.
I could only edit those parts and merge them, but I left it as a review only as you may have disagreements. Check them please.

@@ -1019,7 +1100,7 @@ Errors are indicated with a red squiggle underline.</source>
<location filename="../EditDialog.ui" line="290"/>
<location filename="../EditDialog.ui" line="308"/>
<source>Ctrl+P</source>
<translation></translation>
<translation>Ctrl+P</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@@ -1039,7 +1120,7 @@ Errors are indicated with a red squiggle underline.</source>
<message>
<location filename="../EditDialog.ui" line="326"/>
<source>Ctrl+Shift+C</source>
<translation></translation>
<translation>Ctrl+Shift+C</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@@ -1771,18 +1852,18 @@ All data currently stored in this field will be lost.</source>
<location filename="../ExtendedScintilla.cpp" line="62"/>
<location filename="../ExtendedScintilla.cpp" line="283"/>
<source>Ctrl+H</source>
<translation></translation>
<translation>Ctrl+H</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

</message>
<message>
<location filename="../ExtendedScintilla.cpp" line="64"/>
<source>Ctrl+F</source>
<translation></translation>
<translation>Ctrl+F</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

</message>
<message>
<location filename="../ExtendedScintilla.cpp" line="77"/>
<location filename="../ExtendedScintilla.cpp" line="287"/>
<source>Ctrl+P</source>
<translation></translation>
<translation>Ctrl+P</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@@ -6469,7 +6972,7 @@ Hold %3Shift and click to jump there</source>
<message>
<location filename="../TableBrowser.ui" line="893"/>
<source>Ctrl+U</source>
<translation></translation>
<translation>Ctrl+U</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@@ -6558,7 +7061,7 @@ Hold %3Shift and click to jump there</source>
<message>
<location filename="../TableBrowser.ui" line="1039"/>
<source>Ctrl+Space</source>
<translation></translation>
<translation>Ctrl+Space</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@@ -6567,20 +7070,24 @@ Hold %3Shift and click to jump there</source>
</message>
<message>
<source>Ctrl+H</source>
<translation></translation>
<translation type="vanished">Ctrl+H</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

but this one is vanished entry so you can ignore this one.

</message>
<message>
<location filename="../TableBrowser.cpp" line="102"/>
<source>Ctrl+R</source>
<translation></translation>
<translation>Ctrl+R</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

<source>Ctrl+&quot;</source>
<translation></translation>
<translation>Ctrl+&quot;</translation>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortcuts should not be translated.
See the wiki for further information.

@lucydodo lucydodo added this to the 3.12.1 milestone Sep 18, 2020
@SafaAlfulaij
Copy link
Contributor Author

Hi @lucydodo
I can't see how "just leave the translation empty and finished" will make Qt use the original shortcut.
I tried this locally and the shortcut won't work any more, and it's text disappeared.

image

Even if Qt for some reason or another used the orignal string (if the translation is empty), this must be reported as a bug.
If I say that this string is empty, then it must be empty. Translations overrides original.
Shortcut or not, that doesn't matter.

@lucydodo
Copy link
Member

<source>Ctrl+N</source>
<translation></translation>

Interesting.. 🤔 Did you do the like as above when testing locally?
I just installed the Arabic version of Windows 10 on VM and installed the latest nightly build to test it out. (All shortcuts are not translated in current master branch) However as in the screenshot below, shortcuts are displayed, and they work fine.

شش

@justinclift
Copy link
Member

@SafaAlfulaij

I can't see how "just leave the translation empty and finished" will make Qt use the original shortcut.

Yeah, I wasn't sure about that either but (apparently) it's a feature of Qt (?). eg when the translated string is empty, it automatically uses the original text instead

@mgrojo That's correct yeah?

@mgrojo
Copy link
Member

mgrojo commented Sep 19, 2020

@SafaAlfulaij

I can't see how "just leave the translation empty and finished" will make Qt use the original shortcut.

Yeah, I wasn't sure about that either but (apparently) it's a feature of Qt (?). eg when the translated string is empty, it automatically uses the original text instead

@mgrojo That's correct yeah?

Yes, this is what I know due to experience, but I haven't found any reference in the documentation. In the Qt Linguist Manual there are references to "accept the empty translation", but without clarifying what is then shown in the translation. Having said that, I don't have an explanation for @SafaAlfulaij's screenshot. For me, that Qt version is buggy, since it goes against all what we have seen till now. This is my case with an empty translation for "Ctrl+N":
image

@SafaAlfulaij
Copy link
Contributor Author

Filed a bug upstream: #86774

@lucydodo
Copy link
Member

lucydodo commented Sep 19, 2020

@SafaAlfulaij But what about the nightly build? Even there, the shortcut doesn't appear and doesn't work?

@SafaAlfulaij
Copy link
Contributor Author

It seems that the translation file was changed from the last time I updated it...

This is not the correct behaviour. If the translation is empty, and finished, then it must be empty in the application.

And as for the nightly build, yes the shortcuts are there and work, but if you take a closer look to the exe:
image

("ÿÿÿÿ" = "FF FF FF FF")

If you believe as I believe, that "-1" is an invalid string length, then let's please fix the wrong "standard" established within this project.
If not, I'm not sure what to say...

@mgrojo
Copy link
Member

mgrojo commented Sep 20, 2020

If this is a Qt bug, I don't know what they're doing about translation of keyboard shortcuts. Our recommendation to not translate them comes from various issues that we have received (see, for example, #2178). But I'm not sure if we have received some issue when the translation string is equal to the original. Maybe not and, in that case, we could merge this pull request without problem. But what about the other languages, are people building with Qt 5.15 going to have problems when the translation of shortcuts is empty? What Qt version are we using for the official builds?

@justinclift
Copy link
Member

What Qt version are we using for the official builds?

At the moment, it's Qt 5.12.8. We could update that to Qt 5.12.9, but I kind of figured... "why take the chance of possibly breaking something for our supposed-to-be-stable point release?". 😉

@mgrojo
Copy link
Member

mgrojo commented Sep 20, 2020

What Qt version are we using for the official builds?

At the moment, it's Qt 5.12.8. We could update that to Qt 5.12.9, but I kind of figured... "why take the chance of possibly breaking something for our supposed-to-be-stable point release?". wink

Perfect. I only wanted to confirm that it isn't 5.15, which is apparently the one causes problems.

@SafaAlfulaij
Copy link
Contributor Author

First, sorry if I was rude in any way.
I'll explain in details:

  • Empty approved translations should show empty in the app (my screenshot above).
  • lrelease has a bug that if the translation is empty and approved, it will give it a length of -1 in the released QM file, which will (in some way or another) make QTranslator skips the translation as if it's not there and use the original.
  • DB4S is recommending translators to use this bug (without knowing it's a bug in the first place), instead of letting them know about shortcuts and the proper way to translate them.

Regarding #2178, I'm not sure what the problem is, but perhaps it's because of keyboard layouts or something else. Did you try Ctrl+Enter and Ctrl+Return? These two are different keys (return is the normal, Enter is the keypad). Perhaps this was the problem?
Normally devs assign both as sequences for the same action (in code).

@justinclift
Copy link
Member

justinclift commented Sep 20, 2020

lrelease has a bug that if the translation is empty and approved, it will give it a length of -1 in the released QM file, which will (in some way or another) make QTranslator skips the translation as if it's not there and use the original.

Do we know for sure that it is a bug, and not something that's understood to work this way + just badly documented by Qt?

@mgrojo
Copy link
Member

mgrojo commented Sep 20, 2020

In fact, we never said that shortcuts must not be translated, but that key names should not be translated, because this is known not to work and is more or less documented.

Warning: Do not translate the "Alt", "Ctrl" or "Shift" parts of the accelerators. Qt relies on these strings being there. For supported languages, Qt automatically translates these strings.

(They should say that you are not supposed to translate key names in general, like Space or Return).

But I think we haven't actually have problems when the translation is equal to the original. Emptying the translation was just our quick way to avoid the problem in all languages. On the other hand, yes, I'm sure that leaving the translation empty and finished is, in general, not only for shortcuts, saying to Qt that there's no translation and the original text is to be kept. They have designed it that way, otherwise it's a so long-standing bug, that it has become a feature.

I think the pull request can be merged as is.

@lucydodo lucydodo self-requested a review September 21, 2020 03:30
@lucydodo
Copy link
Member

Based on the commit of @SafaAlfulaij, I tested it in Windows and macOS, and confirmed that it works.

This is because on macOS the Ctrl key sequence is replaced by the Command key sequence.

In fact, I think it's okay to merge in this case, but on the other hand, we have been doing like this until this time, and the official Qt IRC channel also confirmed that if the blank translation was approved, replaced by the original text
(but the person who gave the answer was not the official Qt developer),

if assuming that this is not a bug, I requested changes because of concerns about bugs that may occur in the stable version.

First of all, I approved the review based on the comments arising from this PR.
but I delegated choice to someone else about merge.

Ctrl+Enter -> Ctrl+Return
@mgrojo mgrojo merged commit f0e7fe2 into sqlitebrowser:master Sep 22, 2020
@mgrojo
Copy link
Member

mgrojo commented Sep 22, 2020

It is now merged to master. I'll try to cherry-pick it to the v3.12.x, which is the branch of the release. I hope it can be done without problems.

mgrojo added a commit that referenced this pull request Sep 22, 2020
#2405
# Conflicts:
#	src/translations/sqlb_ar_SA.ts
@mgrojo
Copy link
Member

mgrojo commented Sep 22, 2020

@SafaAlfulaij I had to solve some trivial conflicts and it looks good from a technical point of view. When compiling, it says that there are two pending messages, but I cannot find them. You can review it in 1dfa70c

@SafaAlfulaij
Copy link
Contributor Author

@mgrojo Couldn't find it either...

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

Successfully merging this pull request may close these issues.

4 participants