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

Do not use QObject::tr plural syntax for numbers with a unit symbol #296

Merged
merged 1 commit into from
May 10, 2021

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Apr 25, 2021

Working on translation, I found this is useless and unnecessarily burdensome for translators. I guess, this statement is correct internationally wide :)

This is useless and unnecessarily burdensome for translators.
Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

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

ACK 3adde72

This makes sense as 1 GB and 20 GB should be translated the same. It would make sense to use the plural syntax if instead of the GB unit we had the word Gigabyte.

Did a quick grep search for %n, ignoring the *.ts files, and these are all occurrences of such a case that I could find.

@hebasto hebasto requested a review from laanwj May 8, 2021 07:09
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

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

Code review ACK 3adde72. Agree with OP, looks reasonable to me.

@hebasto hebasto merged commit 8bed170 into bitcoin-core:master May 10, 2021
@hebasto hebasto deleted the 210425-plurals branch May 10, 2021 13:35
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 10, 2021
…numbers with a unit symbol

3adde72 qt: Do not use QObject::tr plural syntax for numbers with a unit symbol (Hennadii Stepanov)

Pull request description:

  Working on translation, I found this is useless and unnecessarily burdensome for translators. I guess, this statement is correct internationally wide :)

ACKs for top commit:
  jarolrod:
    ACK 3adde72
  promag:
    Code review ACK 3adde72. Agree with OP, looks reasonable to me.

Tree-SHA512: bde65c122ca0feb7771d932cce63fd1aef1e7a9dda0188d19c577d57b279172204ac1bfcb6106a78b2c4d55d628e6dc0967051e064ec40d3c5aeafd4a48f0589
@luke-jr
Copy link
Member

luke-jr commented Jun 12, 2021

Hopefully this won't disrupt some non-Latin language...

@hebasto
Copy link
Member Author

hebasto commented Jun 12, 2021

Hopefully this won't disrupt some non-Latin language...

In which way?

@luke-jr
Copy link
Member

luke-jr commented Jun 12, 2021

eg, if 300 GB and 400 GB are written using different characters.

@hebasto
Copy link
Member Author

hebasto commented Jun 12, 2021

eg, if 300 GB and 400 GB are written using different characters.

In such case we could expect a comment from a translator here or on transifex.com, right?

@luke-jr
Copy link
Member

luke-jr commented Jun 12, 2021

I'm not sure. Have we ever had any feedback of that sort from translators?

@hebasto
Copy link
Member Author

hebasto commented Jun 13, 2021

I'm not sure. Have we ever had any feedback of that sort from translators?

Translators can open issues on transifex.com that are associated to the translatable strings. There are some of them open now.

@luke-jr
Copy link
Member

luke-jr commented Oct 15, 2021

I think we should revert this...

bg had different strings: (%n GB е нужен) vs (%n GB са нужни)

ca: Un GB d'espai lliure disponible vs %1 GB d'espai lliure disponibles; and (Un GB necessari) vs (de %n GB necessàris)

eo: %n gigabajto de libera loko disponeble vs %n gigabajtoj de libera loko disponebla.

es_CL: (de %n GB requerido) vs (de %n GB requeridos)

fr: %n Go d’espace libre disponible vs %n Go d’espace libre disponibles; and (%n Go nécessaire pour la chaîne complète) vs (%n Go nécessaires pour la chaîne complète)

he: ג״ב של מקום פנוי זמין vs %n ג״ב של מקום פנוי זמינים

hr: (od potrebnog prostora od %n GB) vs (od potrebnog %n GB); and (potreban je %n GB za cijeli lanac) vs (potrebna su %n GB-a za cijeli lanac) vs (potrebno je %n GB-a za cijeli lanac)

pl: (%n GB potrzebny na pełny łańcuch) vs (%n GB potrzebne na pełny łańcuch) vs (%n GB potrzebnych na pełny łańcuch)

ro: (din %n GB necesar) vs (din %n GB necesari)

sk: (z %n GB potrebného) vs (z %n GB potrebných); and (%n GB potrebný pre plný reťazec) vs (%n GB potrebné pre plný reťazec) vs (%n GB potrebných pre plný reťazec)

sl: (%n GB potreben za celotno verigo blokov) vs (%n GB potrebna za celotno verigo blokov) vs (%n GB potrebni za celotno verigo blokov) vs (%n GB potrebnih za celotno verigo blokov)

sv: %n GB fritt utrymme kvar vs %n GB ledigt utrymme kvar; and (av %n GB behövs) vs (av de %n GB som behövs)

szl: (z %n GB przidajnego) vs (z %n GB przidajnych)

@flack
Copy link
Contributor

flack commented Nov 4, 2021

just squinting at the above examples, it seems the logic of the ones I can somewhat decipher is like this:

1 GB free space is available
2 GB free space are available

1 GB is necessary for (...)
2 GB are necessary for (...)

I guess the question then is if all those languages have a way that covers both in cases in one phrase.

@luke-jr
Copy link
Member

luke-jr commented Nov 4, 2021

I guess the question then is if all those languages have a way that covers both in cases in one phrase.

Even if possible, we should go back to %n if forcing %1 would make the translation weirder.

@kybl
Copy link

kybl commented Nov 5, 2021

From the languages above, I can understand Slavic ones. There, it matters not even if the number is 1 or more, but if the number is 1, or (2, 3, or 4), or (5 and more, or 0).

For example, in the Slovak language case:

  • 0 GB potrebných <-- 0 and 5+ case
  • 1 GB potrebný <-- 1 case
  • 2 GB potrebné <-- 2-4 case
  • 3 GB potrebné <-- 2-4 case
  • 4 GB potrebné <-- 2-4 case
  • 5 GB potrebných <-- 0 and 5+ case

I found a very informative source here: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html

Not sure if it can be somehow easily implementable in Transifex. In the current case, the translator probably tries to guess the typical number it will be there (impossible) and put form of such number.

@westoleaboat
Copy link

In Spanish you may differentiate as follows: (similar as difference between 'is' and 'are' in English)

  • 0 GB requeridos for zero it is plural
  • 1 GB requerido for one it is singular
  • 2 GB requeridos for >1 follows plural, same as zero

@hebasto
Copy link
Member Author

hebasto commented Nov 6, 2021

If a subject or an object is measured in some units, it is wrong to substitute it with units.

Therefore, a phrase "%n GB needed for full chain" is bad worded, because a free space needed, not gigabytes.

Anyway, if this PR appeared so controversial, why do not just to open a new PR and revert these changes?

@hebasto
Copy link
Member Author

hebasto commented Nov 6, 2021

A relevant announcement on Transifex.com

@GChuf
Copy link
Contributor

GChuf commented Nov 6, 2021

I can confirm for slovenian and other slavic languages that we do have 3 or 4 different ways of saying "%n GB needed%, depending on the actual number of gigabytes. Similar to english "is/are". There's no way to cover all cases ... this is exactly why transifex allows you to have more than 2 options.

Maybe? you could cover all cases in all languages by saying something like "Amount of GB needed: %n", but I don't think this was ever broken to begin with, and you only translate this once.

hebasto added a commit that referenced this pull request Apr 3, 2022
…ers with a unit symbol"

0c64401 Revert "qt: Do not use QObject::tr plural syntax for numbers with a unit symbol" (Luke Dashjr)

Pull request description:

  Apparently this got forgotten. Maybe too late for 23.x (it's a bugfix, but changes translation strings).

  This reverts commit 3adde72 (#296)

  per [GChuf](#296 (comment))

  >I can confirm for slovenian and other slavic languages that we do have 3 or 4 different ways of saying "%n GB needed%, depending on the actual number of gigabytes. Similar to english "is/are". There's no way to cover all cases ... this is exactly why transifex allows you to have more than 2 options.

ACKs for top commit:
  hebasto:
    ACK 0c64401, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: c01bae44a32b3ec324f2f9b8e4923bbb2e83bbd1460b745c5c911b98a9b2806fcbf815cfb19a1f1a7038c5c14312e102e7df8744c9002ef784b36d158e08eb14
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 3, 2022
… syntax for numbers with a unit symbol"

0c64401 Revert "qt: Do not use QObject::tr plural syntax for numbers with a unit symbol" (Luke Dashjr)

Pull request description:

  Apparently this got forgotten. Maybe too late for 23.x (it's a bugfix, but changes translation strings).

  This reverts commit 3adde72 (#296)

  per [GChuf](bitcoin-core/gui#296 (comment))

  >I can confirm for slovenian and other slavic languages that we do have 3 or 4 different ways of saying "%n GB needed%, depending on the actual number of gigabytes. Similar to english "is/are". There's no way to cover all cases ... this is exactly why transifex allows you to have more than 2 options.

ACKs for top commit:
  hebasto:
    ACK 0c64401, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: c01bae44a32b3ec324f2f9b8e4923bbb2e83bbd1460b745c5c911b98a9b2806fcbf815cfb19a1f1a7038c5c14312e102e7df8744c9002ef784b36d158e08eb14
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin-core bitcoin-core locked and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants