Use plural formats and native digits
With codesearch, look for '<ex>[0-9]+</ex> file:grd'. Review each of
matches and change them to use plural formats(C++), toLocaleString(JavaScript),
or other i18n-safe ways.
Moreover, change GetStringFUTF16Int() to use 'FormatNumber' instead
of Int*ToString(). Call sites of GetStringFUTF16Int() were reviewed
Where native digits are not appropriate (non-UI), call sites were
adjusted.
Besides, add a warning about 'ASCII digits vs native digits' to
base/strings/string_number_conversions.h and add more details
on GetPlural* to ui/base/l10n/l10n_util.h.
BUG=613331
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation;tryserver.blink:linux_blink_rel,mac_blink_rel
Review-Url: https://codereview.chromium.org/2002783002
Cr-Commit-Position: refs/heads/master@{#397608}
diff --git a/chrome/app/bookmarks_strings.grdp b/chrome/app/bookmarks_strings.grdp
index b6daec1b..2a496e9 100644
--- a/chrome/app/bookmarks_strings.grdp
+++ b/chrome/app/bookmarks_strings.grdp
@@ -142,8 +142,11 @@
</message>
</if>
</if>
- <message name="IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL" desc="Message in the message box shown if user asks to open a lot of bookmarks in a folder">
- Are you sure you want to open <ph name="TAB_COUNT">$1<ex>20</ex></ph> tabs?
+ <message name="IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL" desc="Message in the message box shown if user asks to open a lot of bookmarks in a folder. The number will never be 1. [ICU Syntax]">
+ {TAB_COUNT, plural,
+ one{Are you sure you want to open # tab?}
+ other{Are you sure you want to open # tabs?}
+ }
</message>
<!-- End of Bookmarks Bar Context Menu strings. -->
@@ -221,8 +224,10 @@
<message name="IDS_BOOKMARK_EDITOR_NEW_FOLDER_MENU_ITEM" desc="Text on the new folder context menu item.">
&New folder
</message>
- <message name="IDS_BOOKMARK_EDITOR_CONFIRM_DELETE" desc="The message shown in the dialog asking the user to confirm deleting a folder.">
- This folder contains <ph name="COUNT">$1<ex>5</ex></ph> bookmarks. Are you sure you want to delete it?
+ <message name="IDS_BOOKMARK_EDITOR_CONFIRM_DELETE" desc="The message shown in the dialog asking the user to confirm deleting a folder. [ICU Syntax]">
+ {NUM_BOOKMARKS, plural,
+ =1 {This folder contains a bookmark. Are you sure you want to delete it?}
+ =other {This folder contains # bookmarks. Are you sure you want to delete it?}}
</message>
<message name="IDS_BOOKMARK_FOLDER_EDITOR_WINDOW_TITLE" desc="Window title of editor for bookmark folders">
Edit folder name