#50194 closed enhancement (fixed)
Add i18n to size_format
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Hello,
The units of the size_format function aren't translatable.
They are already translated on the network settings pages for the size of the upload folder or the size of the uploadable files.
Nicolas,
Change History (12)
This ticket was mentioned in PR #275 on WordPress/wordpress-develop by Rahe.
3 years ago
#1
#2
@
3 years ago
- Keywords has-patch added
Hey,
This change makes sense to me.
I’d just suggest to add an additional translator comment when the file size is null, as the translation may be different for some locales in this specific case.
Maybe something like /* translators: File size in bytes, when the file size is null. */
?
#3
@
3 years ago
- Milestone changed from Awaiting Review to 5.5
Let's move this ticket to milestone 5.5.
#8
@
3 years ago
- Keywords commit added
- Owner set to audrasjb
- Status changed from new to accepted
Patch looks good to go, marking this for commit
.
whyisjake commented on PR #275:
3 years ago
#10
#11
@
3 years ago
We could go a step further here and implement _nx()
with a placeholder for the numeric value instead of always appending the unit to the end.
Question: Are there actually any languages where the unit for the size of a value differs depending on the plurality of the number? (eg. is KB
/KBS
a thing?) I don't know, maybe this would be an unnecessary change.
#12
@
3 years ago
Hello,
I think that unit symbols are not sensitive to plural, we say 10 milliseconds and write 10ms, or 10 meters but write 10m.
According to this answer https://physics.stackexchange.com/a/384189
"Symbols for units are always written in roman (upright) type, irrespective of the type used in the rest of the text. The unit symbol shall remain unaltered in the plural and is not followed by a full stop except for normal punctuation, e.g. at the end of a sentence."
Change the size_format and wp_convert_bytes_to_hr to add translatable strings for the units
Trac ticket: https://core.trac.wordpress.org/ticket/50194