Skip to content

Marked QLabel and ComboBox texts as translatable in 'Edit Pragma' QTabWidget #3697

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

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

hchiper
Copy link
Contributor

@hchiper hchiper commented Aug 4, 2024

Currently, these strings cannot be translated and are always in English, regardless of the user's language.

@mgrojo
Copy link
Member

mgrojo commented Aug 4, 2024

This cannot be done in this way. The no-translation attribute was added on purpose, see 9a30e6c

I'm not sure if it's a good idea to translate anything here, since the pragma names, the values and the documentation is only in English in SQLite.

@hchiper how would you translate all of this into your native language, assuming it's not English?

Maybe we should take into account the opinion of other translators, like @lulol, @FriedrichFroebel, @PeterDaveHello, @GortiZ6 or @mvt91.

If we decide to translate this, then a way to separate the translation from the values used as pragma names and values. Otherwise, this could happen again: #1489 (comment)

HTML code and links should also not be passed for translation, to avoid unneeded work to translators and possible errors.

@FriedrichFroebel
Copy link
Contributor

I have no really strong preference on this, expect that I would like to avoid having to copy lots of HTML code and identify the small bits which might need a translation while dealing with escaped HTML code. Given that I consider pragmas extended functionality, I would expect the user know the corresponding concepts already with their actual "SQL name", and thus would not necessarily translate it to avoid confusion.

@hchiper
Copy link
Contributor Author

hchiper commented Aug 4, 2024

@mgrojo

Sorry, I wasn't aware that the no-translation attribute was added on purpose. However I think translation is possible, while keeping the PRAGMA names unchanged, in uppercase for example; it was not my intention to translate them as well. Have a look at this screenshot to have a more precise idea.
Screenshot_20240804_175446

As for whether or not HTML code should be translated, I think it should. By the way, all the strings I marked for translation are HTML code.
The entire content of the About dialog is also HTML. It was translated in version 3.13 rc3 but the translation has disappeared in the final release 3.13.0. I don't see the advantage, on the contrary.

I started to work on this pull request because untranslated text gave me the feeling of unfinished work and I was ready to make a small contribution. This remark is of course not a criticism of the translators, who have already made a huge amount of work.

@FriedrichFroebel

I am not totally certain, but I think most of the HTML code has already been translated (at least in French).

And I agree that "SQL names" or keywords should not be translated (it would not make sense).

@hchiper hchiper changed the title Marked QLabel and ComboBox texts as translatable in 'Edit Prgama' QTabWidget Marked QLabel and ComboBox texts as translatable in 'Edit Pragma' QTabWidget Aug 4, 2024
@PeterDaveHello
Copy link
Contributor

If some technical terms cannot be well translated into Traditional Chinese, I usually prefer to keep them in their original language. However, I am not entirely sure if I fully understand the context and the whole picture here.

Just FYR, I usually judge based on the translatable or similar parameters provided by the upstream project. If the project has already determined that something should not be translated, I would typically not translate it unless it is obviously a term or string that should be translated. For example, specific commands or technical terms are usually kept in their original form because they are primarily used as such in practice.

@hchiper
Copy link
Contributor Author

hchiper commented Aug 5, 2024

@PeterDaveHello

I totally agree that specific commands or technical terms are usually kept in their original form and that is precisely what I did in the sample translation shown in the DB4S screen capture above (I have translated and compiled a local copy).
Moreover, these specific terms are uppercase (LIKE, CHECK...) to highlight they are SQL keywords or specific commands.
For clarity, here is a screen capture of the full DB4S window.
Screenshot_20240805_082947

As one can see, the text of the 3rd tab, originally Execute SQL, has been translated in the official French version as Exéuter le SQL where SQL (Structured Query Language) has not been translated to LRS (Langage de Requête Structuré), which would have been incomprehensible.

And in my opinion it would have been preferable to have translated of the 4th tab as Éditer les directives PRAGMA.

I hope my intentions are now a little clearer.

Copy link
Member

@mgrojo mgrojo left a comment

Choose a reason for hiding this comment

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

The intention is clear. If you solve the problem with the values, it will look OK to me.

@@ -211,25 +211,25 @@ You can drag SQL statements from an object row and drop them into other applicat
<widget class="QComboBox" name="comboboxPragmaAutoVacuum">
<item>
<property name="text">
<string notr="true">None</string>
<string>None</string>
Copy link
Member

@mgrojo mgrojo Aug 5, 2024

Choose a reason for hiding this comment

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

Please restore the notrattribute for this and the other values, so that they are never changed in translations, otherwise the pragma edition will be broken.

If you still want to translate the values, you'd need to change also the code to make it work even with translated values.

Copy link
Contributor Author

@hchiper hchiper Aug 5, 2024

Choose a reason for hiding this comment

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

I understand that changing the values in the combo-boxes could break the code. Thanks for having explained.
I have restored the notr="true" attribute for them.
I hope the modification is now acceptable and that you can see it. Otherwise should I create a new pull request?

Copy link
Member

@mgrojo mgrojo left a comment

Choose a reason for hiding this comment

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

OK, if the values are not translated, there's no possibility of breaking the code, so it can be accepted. Since nobody seems to oppose it, I will merge it. Translators are always free to finalize a translation string without providing a translation (in that case, the original string is used in the localized application).

@mgrojo mgrojo merged commit e66583c into sqlitebrowser:master Aug 5, 2024
11 checks passed
@mgrojo
Copy link
Member

mgrojo commented Aug 9, 2024

@hchiper, good news, I've made changes in commit bf62f3a to allow translations of pragma values. With this, translating this tab will make more sense, otherwise the names are in a language and the values in the original.

Also, in ad00ad4, I've separated the HTML labels from the pure pragma names, so translation will be easier on the technical side.

The translation files are also updated, so if you want, you can work from that point and make a pull request for your translation into French.

@lulol
Copy link
Contributor

lulol commented Aug 10, 2024

This is not like Excel localized function names, right? 😉 😱

@mgrojo
Copy link
Member

mgrojo commented Aug 11, 2024

This is not like Excel localized function names, right? 😉 😱

You have a point, but I'd say it isn't. This is just a form inside an application and, as @hchiper said, users can have a "feeling of unfinished work". At the beginning, we allow translation of these strings, until we discovered that there was a technical problem, because the strings were used for two pragmas as direct values in the code. Now that problem is solved, and it's up to the translators to provide a translation for their language or leave it in the original form. There are pros and cons of translating it, but this is not like translating function identifiers for code, in my opinion. In fact, I've also added tooltips with the original pragma names in SQL, and the links to the help are also visible in the status bar, so users with previous knowledge of these pragmas, can clarify exactly what we are referring to, in case of any doubt.

By the way, as part of the change, I translated the strings to Spanish, but mostly in order to test the implementation. If you think it is best to keep the original version, I'm open to reverting the translation.

@lulol
Copy link
Contributor

lulol commented Aug 11, 2024

These changes seem perfect to me, balanced between accurate and self-explanatory.

I agree with @FriedrichFroebel that while users changing pragmas probably know the concepts, also DB4S provides a very intuitive and low entry bar to database management for the many casual users, but with tooltips helping to remember the exact real names, hopefully neither should be confused.
The very informative and verbose tooltips are one of the things I like most about DB4S's gui and that makes its use so intuitive, despite the extra work editing escaped html tags.

Now all the translators need to remember to keep that balance. 😄

@mgrojo mgrojo added this to the 3.13.1 milestone Aug 12, 2024
@hchiper
Copy link
Contributor Author

hchiper commented Aug 15, 2024

@hchiper, good news, I've made changes in commit bf62f3a to allow translations of pragma values. With this, translating this tab will make more sense, otherwise the names are in a language and the values in the original.

Also, in ad00ad4, I've separated the HTML labels from the pure pragma names, so translation will be easier on the technical side.

The translation files are also updated, so if you want, you can work from that point and make a pull request for your translation into French.

I have begun the translation into French.
Should I mark the items as done (checkmark) in Qt Linguist, or leave the question mark?

Apart from the Pragma tab, I'd like to restore the French translation of the AboutDialog (it was present in a release candidate, but the translation has disappeared in the final release).

I'd like to make other minor modifications here and there. Is there a person responsible of the French translation that I should contact to discuss?

@FriedrichFroebel
Copy link
Contributor

Should I mark the items as done (checkmark) in Qt Linguist, or leave the question mark?

Without marking them explicitly, they show up as untranslated, which might not be desired. Thus either mark them as done or copy over the original text and ideally verify that the correct values are indeed being rendered.

Is there a person responsible of the French translation that I should contact to discuss?

See the last call for translations at #3452 (comment) or the commit history of the corresponding file at https://github.com/sqlitebrowser/sqlitebrowser/commits/master/src/translations/sqlb_fr.ts

I would recommend to create a dedicated pull request with you changes once you think you are done and ask the previous translators/main translator for possible feedback.

@hchiper
Copy link
Contributor Author

hchiper commented Aug 16, 2024

Thanks. The French translation in well underway.

Unfortunately, I failed to find contact info for @mvt91 who was the last (and only?) contributor to the French translation.

When I came to unfinished strings for ColumnDisplayFormatDialog I noticed something that seemed strange (see attached screenshot): when I select a source text in the middle panel, the line highlighted in light blue in the right panel is 2 lines above the line containing that source text (red border). I'm using Qt Linguist Version 5.15.2 (the version available in my distro repositories). There is a 1 or 2 lines shift for (almost) every string. ColumnDisplayFormatDialog is the only context where it happens.

Is there a problem with that particular context? Should I ignore that and continue to translate or should I wait for a fix?
Screenshot_20240816_150146

@mgrojo
Copy link
Member

mgrojo commented Aug 16, 2024

Is there a problem with that particular context? Should I ignore that and continue to translate or should I wait for a fix?

You can ignore that. Whenever a source file is modified in any way, even if the change doesn't affect translatable strings, the line information present in the translation files is displaced, but it doesn't break the translation, only that reference in Linguist and similar tools.

@mvt91
Copy link
Contributor

mvt91 commented Aug 16, 2024 via email

@hchiper
Copy link
Contributor Author

hchiper commented Aug 16, 2024

Hi All is there someone working on the French translation ? Do you neeed some help. I did it many times :) regards

Yes, I do. I began with the translation of stings recently marked as translatable ("Edit Pragmas" tab). By the way, apart that, I discovered here and there a few missing translations, and a very few I believe could be enhanced. I have found my way with Qt Linguist. I find it a great tool because each string is visible in its context and helps a lot to translate appropriately.
For example, I've seen (don't remember where, I have to search) that "Check constraints" was translated as "Vérifier les contraintes" while "Appliquer les contraintes CHECK" seems more appropriate.

What I have done is

  • Added translations for strings in the "Edit Pragmas" tab.
  • In the AboutDialog I replaced the hyphen by a space in the title ("DB-Browser" -> "DB Browser") to be consistent with the rest of the translation, and I translated the content of the main widget (inspired by translation from sqlitebrowser-v3.13.x-rc1).
  • Edited HTML strings to replace a space by   (no break space) before some punctuation signs (; : ! ?) to avoid line break just before these signs (found 13 occurrences).
  • Made minor modifications / corrections to strings already translated and added some missing translations (not yet finished).

I would be happy to share my copy of sqlb_fr.ts with you so that you can give your feedback before any pull request.

@mvt91
Copy link
Contributor

mvt91 commented Aug 16, 2024 via email

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.

6 participants