New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 923017 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Chrome bundles include resource strings for unwanted locales

Project Member Reported by digit@google.com, Jan 17 (5 days ago)

Issue description

Since the release of bundletool 0.8.0, we can now place WebView string resources into the base module correctly. However, a new problem was found: the bundle contains strings for locales we don't care about, e.g.:

  res_id=0x7f040000 name=__arcore_cancel count=117 {
    config (default) "Cancel"
    config af        "Kanselleer"
    config am        "ይቅር"
>    config ar-EG     "إلغاء"
>    config ar-SA     "إلغاء"
>    config ar-XB     "<U+200F><U+202E>Cancel<U+202C><U+200F>"
    config az        "Ləğv edin"
    config be        "Скасаваць"
    config bg        "Отказ"
    config bn        "বাতিল করুন"
    config bs        "Otkaži"
    config ca        "Cancel·la"
    config cs        "Zrušit"
    config da        "Annuller"
    config de        "Abbrechen"
>    config de-AT     "Abbrechen"
>    config de-CH     "Abbrechen"
    config el        "Άκυρο"
>    config en-AU     "Cancel"
>    config en-CA     "Cancel"
    config en-GB     "Cancel"
>   config en-IE     "Cancel"
>   config en-SG     "Cancel"
>    config en-XA     "[Çåñçéļ one]"

IMPORTANT NOTE: You need https://chromium-review.googlesource.com/c/chromium/src/+/1417834 to be able to dump the bundle's strings now.

 

Comment 1 by digit@google.com, Jan 17 (5 days ago)

Short answer for now: these strings come from extra bundle modules (vr and ar), which do not set aapt_locale_whitelist in their GN target definitions.

This means that the corresponding bundles will include all the strings from the corresponding prebuilt resource directories that these modules link in.

One solution is to add aapt_locale_whitelist manually to each extra module definition, but this doesn't scale well. Thinking about an alternative way to fix this.
Project Member

Comment 2 by bugdroid1@chromium.org, Jan 18 (4 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59c90558b3ce3cb025324dd1f30ffe00ce4fb9cb

commit 59c90558b3ce3cb025324dd1f30ffe00ce4fb9cb
Author: David 'Digit' Turner <digit@google.com>
Date: Fri Jan 18 16:53:07 2019

android: Prevent AR and VR modules from using too many strings.

As discovered recently, when building the Monochrome bundle, the
AR and VR feature modules embed all localized strings from their
source packages, which is much more than needed.

This CL fixes the issue by setting aapt_locale_whitelist on
each module definition. This is a quick fix, though we may
consider in the future supporting setting this variable on
the top-level bundle target instead.

+ Small change to compile_resources.py to fix a runtime
  crash due to a variable not properly assigned before
  being referenced (this happens when using a locale
  whitelist without a resource blacklist regex).

BUG=923017
R=agrieve@chromium.org,tiborg@chromium.org,benmason@chromium.org

Change-Id: I59e0c305a94521d8c873ffa682613504710c427b
Reviewed-on: https://chromium-review.googlesource.com/c/1420798
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: David Turner <digit@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624165}
[modify] https://crrev.com/59c90558b3ce3cb025324dd1f30ffe00ce4fb9cb/build/android/gyp/compile_resources.py
[modify] https://crrev.com/59c90558b3ce3cb025324dd1f30ffe00ce4fb9cb/chrome/android/modules/ar/ar_module_tmpl.gni
[modify] https://crrev.com/59c90558b3ce3cb025324dd1f30ffe00ce4fb9cb/chrome/android/modules/vr/vr_module_tmpl.gni

Sign in to add a comment