Add ICU message format support
commit8b581d8b638951f98c0fb0c0116ac18b355b825e
authorjshin <jshin@chromium.org>
Fri, 7 Aug 2015 10:11:09 +0000 (7 03:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 7 Aug 2015 10:11:42 +0000 (7 10:11 +0000)
tree58623cbfa64540aca8cb288b29bf8a0efbb2327b
parent3bc71b8291a88cc35c21d05d9fb99787cccfddf5
Add ICU message format support

Adopt and customize a ICU message format wrapper used at Google to meet
Chromium's need.

This will enable formatting of 'complex messages' requiring plural and/or
selector (e.g. gender or 'single vs multiple') support with more than one
parameters.

Besides, l10n_util::GetPluralStringF* is rewritten to use this API.

I'm also planning to use this API to add a similar support to Chromium's
JavaScript-based UI and extensions.

References:
MessageFormat specs:
  http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html
  http://icu-project.org/apiref/icu4c/classicu_1_1DecimalFormat.html#details
Examples:
  http://userguide.icu-project.org/formatparse/messages
  message_formatter_unittest.cc
  go/plurals inside Google.

BUG=481734
TEST=base_unittests --gtest_filter="MessageFormat*"

Review URL: https://codereview.chromium.org/1140153005

Cr-Commit-Position: refs/heads/master@{#342327}
19 files changed:
base/BUILD.gn
base/base.gyp
base/base.gypi
base/i18n/message_formatter.cc [new file with mode: 0644]
base/i18n/message_formatter.h [new file with mode: 0644]
base/i18n/message_formatter_unittest.cc [new file with mode: 0644]
chrome/app/generated_resources.grd
chrome/browser/ssl/ssl_error_info.cc
extensions/browser/BUILD.gn
extensions/browser/api/device_permissions_prompt.cc
extensions/extensions.gyp
extensions/extensions_strings.grd
ui/base/BUILD.gn
ui/base/l10n/formatter.cc
ui/base/l10n/l10n_util.cc
ui/base/l10n/l10n_util.h
ui/base/l10n/l10n_util_plurals.cc [deleted file]
ui/base/l10n/l10n_util_plurals.h [deleted file]
ui/base/ui_base.gyp