Open C0rn3j opened 7 months ago
This is how plurals are translated with qt
Indeed, Qt has a specific rule set for each plural form case, which makes this all infinitely easier, and keepassxc apparently attempts to use it.
For example, English rule 1
would be entry
, rule 2
would be entries
.
The code for this case is:
src/gui/MainWindow.cpp:
m_statusBarLabel->setText(tr("%1 Entry(s)", "", numEntries).arg(numEntries));
Which seems to conflict with the documentation, where it seems like it should be:
src/gui/MainWindow.cpp:
m_statusBarLabel->setText(tr("%n Entry(s)", "", numEntries).arg(numEntries));
~~In which case this is still a valid bug report, even though I haven't made my issue clear in the initial post.
It shows up literally on my system, for example in search in the main window, please reopen :)~~
KeePassXC - Version 2.7.6
Revision: dd21def
Qt 5.15.12
Debugging mode is disabled.
Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 6.7.1-arch1-1
Enabled extensions:
- Auto-Type
- Browser Integration
- SSH Agent
- KeeShare
- YubiKey
- Secret Service Integration
Cryptographic libraries:
- Botan 3.2.0
Might want to add system locale to the debug tab, seems relevant
[0] % localectl
System Locale: LANG=en_GB.UTF-8
Sorry but you need to do more work on your end. Go to https://transifex.com/keepassxc/keepassxc to translate your language. There you can also download the latest translation file for your language.
As an aside, Qt uses "%1, %2, %3" etc for fill in placeholders. It will also recognize ansi C placeholders like %n but those are far less flexible.
Sorry but you need to do more work on your end. Go to https://transifex.com/keepassxc/keepassxc to translate your language.
Gave that a shot, my example was already translated months ago with no review, which wouldn't matter anyway as keepassxc's last release is from 2023-08.
Wouldn't it make sense to default missing translations for en_
variants that contain %n
or %1
in the string to the en
base, instead of showing the source code variants which look like real words with broken grammar?
The en translation is default, this one wasn't translated though.
If you see (s) in the interface, then the en-US or en-GB translation for that string is missing. You need to fix that on Transifex, not in the code.
Right, the default source en
translation is indeed source, with no translated variants, so there's no variants to take from it.
One way would be to fill in en_US from en_GB and vice versa for missing messages with %
, but I am getting the vibe that wouldn't be welcome and you'd rather get translators.
https://github.com/keepassxreboot/keepassxc/blob/develop/.github/CONTRIBUTING.md#translations
This is pretty bare, how does one request the permissions to Review things?
There are %n replaces that are hanging in the limbo for 2 years+ for en_UK.
Why would I choose to translate a specific version over develop and vice versa, is there any duplication between them?
It would be very nice if KeePassXC informed the user that the translation for their language is incomplete and some things may look odd as a result, and link them to the translation contributing section.
I had no clue that the English-developed app I use does not have string translations for English, for years.
Some basic explanation about %1/%n would be welcome, took me a while to even figure the 1
and other
are clickable and that they are the countable rules.
We don't control transifex so you would need to read the docs of the website before working on it. (Referencing your comment on the 1 vs other button)
Regarding %1/%n, that has absolutely nothing to do with plurals. That is a replacement schema used in Qt/C/C++ for injecting fill-ins. The plural aspect actually comes from the (s)
suffix within the string. The plural choice (1 or other) comes from the third parameter in the tr(...)
function.
With all that said, you don't need to know any of this. Just go to Transifex and start translating. We prefer you start on the non-develop set since that is closest to release. Most translations automatically carry over to the other set (that is a Transifex feature).
If you want to be a reviewer for one or more languages, request that through Transifex. Again, read the docs.
Regarding %1/%n, that has absolutely nothing to do with plurals. That is a replacement schema used in Qt/C/C++ for injecting fill-ins. The plural aspect actually comes from the (s) suffix within the string. The plural choice (1 or other) comes from the third parameter in the tr(...) function.
With all that said, you don't need to know any of this.
In which case, people will be confused and end up wasting time making pointless bug reports that would be completely prevented by informing the user better.
I am not alone, just clicking through the % forms shows that other people are confused too:
We don't control transifex so you would need to read the docs of the website before working on it
I suggested improving existing KeePassXC's documentation, not Transifex's.
I am still suggesting that.
With all that said, you don't need to know any of this. Just go to Transifex and start translating.
If you want to be a reviewer for one or more languages, request that through Transifex. Again, read the docs.
Alright... Strings I care about are translated already, just need to be reviewed, let's see how to do that.
https://help.transifex.com/en/collections/3441044-starting-with-the-basics
Alright, let's read the doc for reviewing translations...
https://help.transifex.com/en/articles/6318604-reviewing-translations
"Only Admins, Project Maintainers, Language Coordinators, and Reviewers can review and edit reviewed strings."
Great, how do I apply to become a Reviewer again?
Who knows.
Judging by https://help.transifex.com/en/?q=reviewer, it's YOUR job to add Reviewers and there is no way to request it on my side other than asking.
Another funny thing, when attempting to use the Join Team button, one gets this notice:
"NOTE: Please do not mark translations as reviewed. This prevents other users from editing them later on!"
And then you see random languages are half reviewed, some 100% and some 0%.
What gives? Who knows.
Does KeePassXC even care about the review status? Who knows.
We prefer you start on the non-develop set since that is closest to release. Most translations automatically carry over to the other set (that is a Transifex feature).
I do not feel like enough information about translating is available on KeePassXC's side, making the translations incomplete even in the main language of the app.
Do you genuinely think it would be a bad idea to fill in the translation contribution short document a bit, to get people started easier?
Linking Transifex documentation where relevant is fine, but having no explanation other than "read the docs" is making this extremely frustrating to work with.
The review status has no bearing on whether translations make it into a release. That's just a nice to have transifex feature that enables translators to control the translation a little more.
I'll add some meat to the contributing docs
Entrys is obviously not a word, it would be nice if this was done properly instead and showed Entry/Entries based on the actual count, and the same for all the other words.
In English this is super simple:
1
entrynot 1
entries.In other languages this is more complex and has to be kept in mind if translations are meant to be perfect too, for example Czech:
1
záznam2
záznamy5
záznamůAnd then there's declension.
While we are at it, there's currently inconsistent capitalization, to point out one case:
Delete Entry
vsMove entry
Outside of
share/translations
, all the occurrences in the current master for entry(s) are as follows: