Commit 2b5a36d5 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Commit Bot

[intl] translate locale en_US_POSIX to en-US

en_US_POSIX is ICU's fallback locale on POSIX platforms for when it
cannot detect a default locale.  Consider it equivalent to en-US.

I won't claim this is the best possible fix but it makes the following
tests pass again for me locally:

    intl/break-iterator/default-locale
    intl/break-iterator/wellformed-unsupported-locale
    intl/collator/default-locale
    intl/collator/wellformed-unsupported-locale
    intl/date-format/default-locale
    intl/date-format/wellformed-unsupported-locale
    intl/number-format/default-locale
    intl/number-format/wellformed-unsupported-locale

R=jgruber@chromium.org

Cq-Include-Trybots: master.tryserver.v8:v8_linux_noi18n_rel_ng
Change-Id: I0e8029f4ffaf5fd3ca72a1cc5db2878891744864
Reviewed-on: https://chromium-review.googlesource.com/567981
Commit-Queue: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46730}
parent 19cfe697
......@@ -143,6 +143,11 @@ RUNTIME_FUNCTION(Runtime_GetDefaultICULocale) {
icu::Locale default_locale;
// Translate ICU's fallback locale to a well-known locale.
if (strcmp(default_locale.getName(), "en_US_POSIX") == 0) {
return *factory->NewStringFromStaticChars("en-US");
}
// Set the locale
char result[ULOC_FULLNAME_CAPACITY];
UErrorCode status = U_ZERO_ERROR;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment