• Mike Wittman's avatar
    Revert "Partial revert of "Use preferred language in extension i18n"" · df2c70fc
    Mike Wittman authored
    This reverts commit ce0ec6fc.
    
    Reason for revert: While the perf regression may have been caused by the original CL, it was transient. 
    
    Original change's description:
    > Partial revert of "Use preferred language in extension i18n"
    > 
    > This is a logical revert of "Use preferred language in extension i18n"
    > (commit 693d01a6). Because of some
    > intervening changes causing more complicated merges, it's simpler to
    > just undo the side effects of the original change, leaving the changed
    > boilerplate intact.
    > 
    > Reason for revert: Testing perf regression in crbug.com/898191
    > 
    > If this exonerates the original CL, we will revert this change.
    > Otherwise, we will clean up the boilerplate added for the original CL.
    > 
    > Original change's description:
    > > Use preferred language in extension i18n
    > >
    > > When localizing an extension, prioritize the user's preferred language
    > > over the application locale.
    > >
    > > Normally, these are the same. In some cases, they differ. For example,
    > > the user may choose to display Chrome in "en-CA" (the intl.app_locale
    > > pref), but because we don't have translations for that, the actual
    > > UI locale is "en-GB".
    > >
    > > This CL makes extensions try to use the user's preferred locale for i18n
    > > ("en_CA"), falling back to the UI locale ("en_GB") if no locale
    > > directory is found for the preferred locale.
    > >
    > > This change also updates the "current_locale" manifest key to reflect
    > > the user's preferred locale, or the UI locale if intl.app_locale is
    > > unset.
    > >
    > > Note: Like the application locale, the preferred locale is only set at
    > > startup (and in certain situations in CrOS). If the user changes their
    > > intl.app_locale pref, they have to restart Chrome before extensions are
    > > re-localized, just like before.
    > >
    > > Bug: 874225
    > > Change-Id: I1aabe3c3680b77d6522193e764aec15a3d618d2d
    > > Reviewed-on: https://chromium-review.googlesource.com/c/1244666
    > > Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
    > > Reviewed-by: Scott Violet <sky@chromium.org>
    > > Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
    > > Cr-Commit-Position: refs/heads/master@{#600619}
    > 
    > Bug: 898191
    > Change-Id: Iaddceb16d61ffc5572a25ed31276443ea5b5baa4
    > Reviewed-on: https://chromium-review.googlesource.com/c/1308765
    > Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
    > Commit-Queue: Michael Giuffrida <michaelpg@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#604819}
    
    TBR=lazyboy@chromium.org,michaelpg@chromium.org
    
    # Not skipping CQ checks because original CL landed > 1 day ago.
    
    Bug: 898191
    Change-Id: Iead107f46039f01b5d5b97b36d1b8fb242f0aee3
    Reviewed-on: https://chromium-review.googlesource.com/c/1334194Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
    Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
    Commit-Queue: Mike Wittman <wittman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#607719}
    df2c70fc
extension_l10n_util_unittest.cc 25.3 KB