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

Zoom percentage localization not sufficient for some languages #1650

Open
scribblemaniac opened this issue Jul 24, 2021 · 4 comments
Open

Zoom percentage localization not sufficient for some languages #1650

scribblemaniac opened this issue Jul 24, 2021 · 4 comments
Labels
Bug Translation UI Related to the visual appearance of the program

Comments

@scribblemaniac
Copy link
Member

Issue Summary

The zoom amount is indicated on the bottom status bar and it should be possible to display this correctly in any supported locale.

Actual Results

The decimal separator is localized, and we get a locale-specific percentage sign character, but that character always appears to the right of the zoom number.

Expected Results

It should be possible to change the following things for a specific locale:

  • The character used for the percentage sign
  • The order of the percentage sign and number
  • The decimal separator character

See also: https://phrase.com/blog/posts/number-localization/#Percentages

The common percent sign (%) may seem like it would be uniform across all locales, but that’s not actually the case. Different locales use different symbols for the percent sign. And like currency symbols, the percent sign can go to the left or right of its associated number depending on the locale.

System Information


Developer Notes

This issue has been discussed some in #1442. The issue existed prior to that PR, but some improvements the the localization were made as related code was changed. Here is my relevant comments on the solution to this issue:

there does not seem to actually be any good way to do this. The [current solution] is basically as good as I could come up with. We could do something hackish like tr("%1%2).arg(locale.toString(...), locale.percent()), but even with comments that would be quite difficult for our translators to understand.

@scribblemaniac scribblemaniac added Bug UI Related to the visual appearance of the program labels Jul 24, 2021
@scribblemaniac scribblemaniac added this to Needs triage in Bug Fix Priority via automation Jul 24, 2021
@scribblemaniac scribblemaniac moved this from Needs triage to Low priority in Bug Fix Priority Jul 24, 2021
@J5lx
Copy link
Member

J5lx commented Sep 29, 2021

@scribblemaniac I looked into this a bit more and honestly I’m not sure if there’s more to be done here. We already have localised number format and percent sign, the only thing missing is the order of number and sign. However, Qt doesn’t provide any mechanisms to deal with this, and even Qt’s own QProgressBar doesn’t handle that. ICU has icu::NumberFormat, but as far as I can tell from the documentation (since I’m on Linux rn), Qt doesn’t even come with ICU on Windows because it’s apparently somewhat heavyweight. Of course we could also just take a look at CLDR data and make something ourselves but honestly at that point it seems like overkill. I say we just accept that our percentage localisation won’t be perfect anytime soon and close this issue. Any thoughts?

@scribblemaniac
Copy link
Member Author

I agree there is currently no simple fix for this. I don't intend to fix this anytime soon myself, nor do I think it should be a high priority for anyone else. However I don't think that this issue should be closed just because we can't/won't do anything about this soon. It's still an issue until we fix it, so I would be in favour of leaving it open, indefinitely if necessary, as long as we agree that it ideally should be fixed at some point. It all comes down to how we think issues should be used.

@J5lx
Copy link
Member

J5lx commented Sep 29, 2021

Okay then. But in that case we should track down all the other places we use percentages as well and update the issue description accordingly. This issue is in no way specific to the zoom control.

@J5lx
Copy link
Member

J5lx commented Sep 29, 2021

Related Qt bug reports: QTBUG-24202, QTBUG-79902, QTBUG-81054

Vaguely related blog post: Teaching QLocale more about number formats (regarding a QLocale rework mentioned in one of the reports)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Translation UI Related to the visual appearance of the program
Projects
Status: Low priority
Bug Fix Priority
  
Low priority
Development

No branches or pull requests

2 participants