Blink needs plural and other complex message support |
||
Issue descriptionChromium (C++ UI code [1] ) can use ICU's MessageFormat (base/i18n/message_formatter.h along with some helper functions in ui/base/l10n/l10n_util.*). However, blink does not have support for plural and other complex messages, yet. Blink's Locale::queryString does not yet support it. So far, I found only one in Blink, but there may be other messages that require plural support. MultipleFileUploadText / IDS_FORM_FILE_MULTIPLE_UPLOAD used in form-file. [1] There's a separate bug for web UI in JS.
,
Aug 14
Archiving old bugs that haven't been modified in over two years. If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks! |
||
►
Sign in to add a comment |
||
Comment 1 by js...@chromium.org
, May 20 2016Status: Assigned (was: Untriaged)
<ph name="NUMBER_OF_FILES">$1<ex>3</ex></ph> files 'files' will take different forms depending on # of files. With a plural support, the message should read (and translators will do the right thing): {NUM_FILES, plural, =1{NOT_USED} other{# files}} Because I haven't yet found a more complex use case in Blink, I can port a subset of base::i18n::MessageFormatter to Blink's Locale (with some adjustments). locale.queryString(<msg>, locale.convertToLocalizedNumber(String::number(<num>)) can also be simplified to locale.messageformat(<msg>, <num>) And, Locale::convertToLocalizedNumber can be dropped if there's no use other than for the user-facing string generation.