-
Notifications
You must be signed in to change notification settings - Fork 261
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
Show sizes less than 1GB in more detail #737
base: qml
Are you sure you want to change the base?
Conversation
<location filename="../main.qml" line="891"/> | ||
<location filename="../main.qml" line="899"/> | ||
<source>Online - %1 MB download</source> | ||
<translation type="unfinished"></translation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could copy-paste from the message above, substituting GB for MB?
<message> | ||
<location filename="../imagewriter.cpp" line="604"/> | ||
<source>Format card as FAT32</source> | ||
<translation type="unfinished">将SD卡格式化为FAT32格式</translation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look right - it's marked as "Unfinished", but definitely has a translation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was like that previously. Probably the translator forgot to check the "finished" checkbox in Qt Linguist.
<location filename="../main.qml" line="891"/> | ||
<location filename="../main.qml" line="899"/> | ||
<source>Online - %1 MB download</source> | ||
<translation type="unfinished"></translation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in zh-TW, maybe adapt the message above?
@@ -894,7 +894,9 @@ ApplicationWindow { | |||
? qsTr("Cached on your computer") | |||
: url.startsWith("file://") | |||
? qsTr("Local file") | |||
: qsTr("Online - %1 GB download").arg((image_download_size/1073741824).toFixed(1)) | |||
: image_download_size >= 1073741824 | |||
? qsTr("Online - %1 GB download").arg((image_download_size/1073741824).toFixed(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking on this further - given we're reusing GB/MB across languages, perhaps we could make GB/MB and untranslated parameter to this string, and just prune it from the translations?
Conceptually, approved. Implementation-wise, however, I think it'd be simpler to just extract the GB/MB specifier and make that an untranslated argument |
Yeah, that sounds better 👍 |
Is it safe to assume that "GB" and "MB" are valid abbreviations for "GigaByte" and "MegaByte" in all foreign languages? E.g. IIRC French uses "MO" instead of "MB"? https://forums.commentcamarche.net/forum/affich-1921093-mb-en-mo-conversion-et-difference EDIT: See e.g. https://github.com/raspberrypi/rpi-imager/blob/qml/src/i18n/rpi-imager_fr.ts#L81-L82 |
Every day is a learning day! I had assumed that since 'byte' is a technical term, it would be conserved across languages. Clearly, that was an incorrect assumption, and I would hate to impose an Anglosphere choice on the French-speaking world. You've freedom of implementation, @AaronDewes, but I would strongly prefer that we copied over the skeleton of the GB text translations where possible - translations are offered on a best-effort basis, and I'm confident the translation suppliers would welcome you adapting their translation to cover this subtly different presentation case. |
Going out on a bit of a limb - and at the risk of overcomplicating things - perhaps it's worth having a set of "formatted_size" translatable strings which could then get used by translations? e.g. So it might display "Disk image Raspberry Pi OS (64-bit) is 1.1 GB" in English, or "L’image disque de USB Boot fait 0,8 Mo" in French? But I've no idea how or even if that would work with the QT localisation stuff. Note that I included both the number and the "MB/GB" in the same translatable string (rather than having "Disk image %1 is %2 %3"), because some languages might need to place the "MB/GB" part before the number part? EDIT: Oh, and of course some languages use the comma-character as the decimal-separator too 😀 (I've edited the examples above) |
I defer to @AaronDewes, but also suggest that could be a follow-up PR at a later date. |
PR is quite large due to the autogenerated .ts updates, the actual change is in
main.qml
.