1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-12-02 00:38:27 +09:00
whippy-edition/app/javascript/mastodon/utils
Sasha Sorokin cb2adaaf9d
Replace shortNumberFormat with <ShortNumber> (#14061)
This commit introduces new utility component - ShortNumber. It should
work almost the same way as original shortNumberFormat function,
though it also localizes units and accepts one more prop - renderer.

Renderer is a function that takes rendered short formatted number
and also ready-to-pluralize number to format display result accordingly.
Ready-to-pluralize number allows to correctly select plural for
compactly notated numbers, respecting thousands and other units.

Issue #12451 accurately describes the issue with using raw numbers
when replacing counter with short version. In short, it doesn't work
with languages such as Russian, that require different plurals,
according to the unit number was compacted to.

All previous usages of shortNumberFormat were replaced with new
function, and as it became unused, it was removed to avoid misleading.
2020-07-06 14:27:32 +02:00
..
__tests__ Add comment, test to unescapeHTML (#7949) 2018-07-05 19:19:38 +09:00
base64.js Refactor resizeImage method (#7236) 2018-04-23 09:15:51 +02:00
html.js Add comment, test to unescapeHTML (#7949) 2018-07-05 19:19:38 +09:00
log_out.js Migrate Rails ujs as required for Rails 6 Upgrade. (#13280) 2020-03-21 03:14:50 +01:00
numbers.js Replace shortNumberFormat with <ShortNumber> (#14061) 2020-07-06 14:27:32 +02:00
resize_image.js Fix uninformative error message when uploading unsupported image files (#13540) 2020-04-25 12:27:29 +02:00
scrollbar.js Do not add margin light when opening modal on mobile (#11830) 2019-09-29 14:30:58 +02:00