Keepassxc: Plural translation in CSV import

Created on 5 Mar 2018  Â·  3Comments  Â·  Source: keepassxreboot/keepassxc

There's an issue with pluralization translations in the CSV import widget code – attempting to translate it on Transifex has it ask me about some weird strings.

Expected Behavior

Transifex should prompt me for the singular and plural translations of "[%n more messages skipped]", and let me decide on the location of interpolated strings in case my language needs that.

Current Behavior

Currently it asks me, erroneously, for the translation of " more messages skipped]". It also asks me for translations of things like "column ", or "Empty fieldname ", without letting me position later parameters or even making it clear that they're going to be added.

Possible Solution

The first problem seems to be in this line of code:
https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L203-L205

I'm not sure how to set up plural translations correctly, otherwise I'd submit a pull request for this issue. The same goes for the following translations; I might try learning how Qt handles string translations, so I can submit PRs for this in the future.

Other weird (or possibly untranslatable) strings in the same file:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L179

(should be "Original data: %s"?)

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L154

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L157

(should be "Empty fieldname %n" and "column %n"?)

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L191

(should have no space before the exclamation mark, and maybe be translated based on number)

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L250

(contains a linebreak at the end, which shows in the translation UI but doesn't actually aid translation)

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/csvImport/CsvImportWidget.cpp#L283-L286

(should be translatable? also affects other lines of code in the same file)

Steps to Reproduce (for bugs)

  1. Go to Transifex
  2. On, e.g., English (United Kingdom), find the string with text "more messages" (or any of these other strings, even)

Context

Here, it doesn't affect me much, as I'm translating for English (United Kingdom) – I could simply copy and paste the string – but these look weird in the translation interface when it's asking me to translate things. For other languages, this probably reduces translation accuracy, and makes it harder on translators to correctly input strings, especially around pluralization.

Debug Info

I'm using the Transifex interface, so what version of KeePassXC _I'm_ on shouldn't be applicable, but:

KeePassXC - Version 2.3.0
Revision: 4c0ed74

Libraries:

  • Qt 5.10.1
  • libgcrypt 1.8.2

Operating system: Windows 10 (10.0)
CPU architecture: x86_64
Kernel: winnt 10.0.16299

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • Legacy Browser Integration (KeePassHTTP)
  • SSH Agent
  • YubiKey
bug i18n

All 3 comments

Nice report! Really appreciated

I've found some more places that I'm questioning, but they're not in this CSV import widget, and I didn't want to bury you all under a bunch of nitpicks. Should I add them to this issue, or make a new issue for them?

Some of the others I found:

The "About" dialog has some weird linebreaks at the ends of strings:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/AboutDialog.cpp#L56

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/AboutDialog.cpp#L58

whereas in other strings, they're appended:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/AboutDialog.cpp#L61

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/AboutDialog.cpp#L65

It might be worth standardizing on this? Preferably to the one that doesn't ask us to translate the linebreaks, since those show in the Transifex interface, unless it's important to the meaning.

The "extensions" part of the dialog is also untranslatable – should it be?

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/AboutDialog.cpp#L84-L98

The "createKeyFile" function in "ChangeMasterKeyWidget" has a weird string:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/ChangeMasterKeyWidget.cpp#L88

(should be "Unable to create key file: %s"?)

These strings are weird to translate, especially if the ;; is a special delineater – should we only be given "Executable Files" and "All Files"?

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/browser/BrowserOptionDialog.cpp#L132-L136

Like here: https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/gui/ChangeMasterKeyWidget.cpp#L81

This line capitalizes "Settings" weirdly:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/browser/BrowserService.cpp#L440

See here where it doesn't:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/browser/BrowserService.cpp#L453

Here we use a proper ellipsis:

https://github.com/keepassxreboot/keepassxc/blob/83974732f3d217a73e1a750844b8eb1cf371f5d9/src/browser/BrowserService.cpp#L475

There are a bunch of other places that don't.

I'll look at other locations later, and see if I can figure out a PR. (Testing it will probably be the hardest part :P)

Was this page helpful?
0 / 5 - 0 ratings