From 6a28f6f8fe6983b64da59117405c827ee1bd0c97 Mon Sep 17 00:00:00 2001 From: Trevor Perrier Date: Thu, 19 Dec 2019 19:23:33 +0000 Subject: [PATCH] android: add 25 new languages to bundles only The following 27 locales are being added to Android bundle builds: af, as, az, be, bs, eu, fr-CA, gl, hy, is, ka, kk, km, ky, lo, mk, mn, my, ne, or, pa, si, sq, ur, uz, zh-HK, zu The first language ("af") was added in this CL: https://crrev.com/c/1941058 This CL adds everything else except for "zh-HK" which is left out because currently "zh-HK" is mapped to "zh-TW" https://crbug.com/780847. A separate CL will add zh-HK. Note on size increase: Adding support for a language has an unavoidable increase in SystemWebview binary size. Since SystemWebView should support all languages that Android does this size increase is unavoidable. There is an increase in size even when language splits are used in bundles. A bug has been created to look into this: - APK Bundles wastes a lot of space in resources.arsc (400kb) - https://crbug.com/1031645 Bug: 812837 Binary-Size: Size increase is unavoidable (see above). Change-Id: I77cddf38d28ae8eacf37c3de9a09344646f5afb1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1952288 Reviewed-by: Nico Weber Reviewed-by: David Trainor Reviewed-by: Ken Rockot Reviewed-by: Changwan Ryu Reviewed-by: Andrew Grieve Reviewed-by: Eric Stevenson Reviewed-by: Sergey Volk Commit-Queue: Trevor Perrier Cr-Commit-Position: refs/heads/master@{#726463} --- .../java/strings/android_webview_strings.grd | 25 ++++++++++ android_webview/ui/aw_strings.grd | 25 ++++++++++ build/android/lint/suppressions.xml | 19 ++++++- build/config/locales.gni | 12 ++--- chrome/android/BUILD.gn | 2 +- chrome/android/chrome_public_apk_tmpl.gni | 2 +- ...roid_chrome_autofill_assistant_strings.grd | 27 +++++++++- .../android_keyboard_accessory_strings.grd | 25 ++++++++++ .../android_chrome_media_router_strings.grd | 25 ++++++++++ .../android_chrome_start_surface_strings.grd | 27 +++++++++- .../strings/android_chrome_tab_ui_strings.grd | 27 +++++++++- .../strings/android_chrome_vr_strings.grd | 25 ++++++++++ chrome/android/modules/chrome_bundle_tmpl.gni | 2 +- .../webapk/strings/android_webapk_strings.grd | 25 ++++++++++ chrome/app/chromium_strings.grd | 25 ++++++++++ chrome/app/generated_resources.grd | 50 +++++++++++++++++++ chrome/app/google_chrome_strings.grd | 25 ++++++++++ chrome/app/resources/locale_settings.grd | 25 ++++++++++ .../app/resources/locale_settings_linux.grd | 25 ++++++++++ .../strings/android_touch_to_fill_strings.grd | 25 ++++++++++ .../strings/android_chrome_strings.grd | 25 ++++++++++ chromecast/chromecast.gni | 2 +- .../android/java/strings/autofill_strings.grd | 27 +++++++++- components/components_chromium_strings.grd | 25 ++++++++++ .../components_google_chrome_strings.grd | 25 ++++++++++ components/components_locale_settings.grd | 50 +++++++++++++++++++ components/components_strings.grd | 50 +++++++++++++++++++ .../web_contents_delegate_android_strings.grd | 27 +++++++++- .../omnibox/resources/omnibox_resources.grd | 25 ++++++++++ .../java/strings/android_content_strings.grd | 25 ++++++++++ device/bluetooth/bluetooth_strings.grd | 25 ++++++++++ device/fido/fido_strings.grd | 25 ++++++++++ services/services_strings.grd | 25 ++++++++++ .../blink/public/strings/blink_strings.grd | 25 ++++++++++ .../chromium/address_input_strings.grd | 25 ++++++++++ ui/strings/app_locale_settings.grd | 27 +++++++++- ui/strings/ui_strings.grd | 25 ++++++++++ 37 files changed, 884 insertions(+), 17 deletions(-) diff --git a/android_webview/java/strings/android_webview_strings.grd b/android_webview/java/strings/android_webview_strings.grd index 3b2472d6139172..779ad49bbcaa77 100644 --- a/android_webview/java/strings/android_webview_strings.grd +++ b/android_webview/java/strings/android_webview_strings.grd @@ -4,8 +4,12 @@ + + + + @@ -16,34 +20,52 @@ + + + + + + + + + + + + + + + + + + @@ -52,9 +74,12 @@ + + + diff --git a/android_webview/ui/aw_strings.grd b/android_webview/ui/aw_strings.grd index b7f43e6a66d02a..1a7115fddf226d 100644 --- a/android_webview/ui/aw_strings.grd +++ b/android_webview/ui/aw_strings.grd @@ -7,8 +7,12 @@ + + + + @@ -19,36 +23,54 @@ + + + + + + + + + + + + + + + + + + @@ -57,9 +79,12 @@ + + + diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml index 004b4e0e0d3005..b0a71f6ff60241 100644 --- a/build/android/lint/suppressions.xml +++ b/build/android/lint/suppressions.xml @@ -40,9 +40,10 @@ Still reading? - + + @@ -283,14 +284,18 @@ Still reading? + + + + @@ -300,6 +305,10 @@ Still reading? + + + + @@ -311,24 +320,32 @@ Still reading? + + + + + + + + diff --git a/build/config/locales.gni b/build/config/locales.gni index 6f7efff1c43b46..bd57fc395cb3bc 100644 --- a/build/config/locales.gni +++ b/build/config/locales.gni @@ -9,7 +9,7 @@ # the fake bidirectional locale added. # The following additional platform specific lists are created: -# - |android_non_bundle_locales| subset for Android based apk builds +# - |android_apk_locales| subset for Android based apk builds # - |locales_as_mac_outputs| formated for mac output bundles # - |ios_packed_locales| subset for iOS # - |ios_packed_locales_as_mac_outputs| subset for iOS output @@ -171,14 +171,14 @@ android_only_chrome_locales = [ ] if (is_android) { - # Once bundles support all languages this will equal all_chrome_locales - locales = all_chrome_locales - android_only_chrome_locales + [ "af" ] + # Add all locales except "zh-HK" since this currently rendered as "zh-TW" + # https://crbug.com/780847 + locales = all_chrome_locales - [ "zh-HK" ] # Android doesn't ship all locales on KitKat in order to save space # (but webview does). http://crbug.com/369218 - android_non_bundle_locales = - all_chrome_locales - android_only_chrome_locales - - android_chrome_omitted_locales + android_apk_locales = all_chrome_locales - android_only_chrome_locales - + android_chrome_omitted_locales # List for Android locale names in .xml exports. Note: needs to stay in sync # with |ToAndroidLocaleName| in build/android/gyp/util/resource_utils.py. diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 5e6280c53f5725..8594da226b31d8 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -1375,7 +1375,7 @@ if (current_toolchain == default_toolchain) { disable_compression = _is_bundle_module renaming_sources = [] renaming_destinations = [] - foreach(_locale, android_non_bundle_locales) { + foreach(_locale, android_apk_locales) { renaming_sources += [ "$target_gen_dir/${_variant}_paks/locales/$_locale.pak" ] renaming_destinations += [ "locales/$_locale.pak" ] diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni index ab04856edbfa3c..29cf494a8680a1 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni @@ -184,7 +184,7 @@ template("chrome_public_common_apk_or_module_tmpl") { if (target_type == "android_apk") { # For APKs, do not include the resource strings files from our # omitted locale list in order to save size. - aapt_locale_whitelist = android_non_bundle_locales + aapt_locale_whitelist = android_apk_locales } else { # For bundles, only include resource strings files from our full # locale list, but nothing more. diff --git a/chrome/android/features/autofill_assistant/java/strings/android_chrome_autofill_assistant_strings.grd b/chrome/android/features/autofill_assistant/java/strings/android_chrome_autofill_assistant_strings.grd index d2574a89e3de54..f9ec72ed9b8e63 100644 --- a/chrome/android/features/autofill_assistant/java/strings/android_chrome_autofill_assistant_strings.grd +++ b/chrome/android/features/autofill_assistant/java/strings/android_chrome_autofill_assistant_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + - + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/features/keyboard_accessory/internal/java/strings/android_keyboard_accessory_strings.grd b/chrome/android/features/keyboard_accessory/internal/java/strings/android_keyboard_accessory_strings.grd index 1d8dcccec60a2e..9f93d160e6a4ee 100644 --- a/chrome/android/features/keyboard_accessory/internal/java/strings/android_keyboard_accessory_strings.grd +++ b/chrome/android/features/keyboard_accessory/internal/java/strings/android_keyboard_accessory_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/features/media_router/java/strings/android_chrome_media_router_strings.grd b/chrome/android/features/media_router/java/strings/android_chrome_media_router_strings.grd index 938dd02831d4e7..068fef65dbcc21 100644 --- a/chrome/android/features/media_router/java/strings/android_chrome_media_router_strings.grd +++ b/chrome/android/features/media_router/java/strings/android_chrome_media_router_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/features/start_surface/internal/java/strings/android_chrome_start_surface_strings.grd b/chrome/android/features/start_surface/internal/java/strings/android_chrome_start_surface_strings.grd index f42554e02ff1de..2f60ecf7f3246c 100644 --- a/chrome/android/features/start_surface/internal/java/strings/android_chrome_start_surface_strings.grd +++ b/chrome/android/features/start_surface/internal/java/strings/android_chrome_start_surface_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + - + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd index 84a55069463e82..cb1745ada5de3f 100644 --- a/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd +++ b/chrome/android/features/tab_ui/java/strings/android_chrome_tab_ui_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + - + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/features/vr/java/strings/android_chrome_vr_strings.grd b/chrome/android/features/vr/java/strings/android_chrome_vr_strings.grd index 9da6f9bfe250e6..9c64837d07f2ca 100644 --- a/chrome/android/features/vr/java/strings/android_chrome_vr_strings.grd +++ b/chrome/android/features/vr/java/strings/android_chrome_vr_strings.grd @@ -5,8 +5,12 @@ + + + + @@ -17,34 +21,52 @@ + + + + + + + + + + + + + + + + + + @@ -53,9 +75,12 @@ + + + diff --git a/chrome/android/modules/chrome_bundle_tmpl.gni b/chrome/android/modules/chrome_bundle_tmpl.gni index c694a6a57877af..f4d4d3e87c9b93 100644 --- a/chrome/android/modules/chrome_bundle_tmpl.gni +++ b/chrome/android/modules/chrome_bundle_tmpl.gni @@ -84,7 +84,7 @@ template("chrome_bundle") { proguard_enabled = !is_java_debug enable_language_splits = true extra_modules = _extra_modules - system_image_locale_whitelist = android_non_bundle_locales + system_image_locale_whitelist = android_apk_locales is_multi_abi = _is_multi_abi # NOTE: Only sign bundle for official builds since this is very slow. diff --git a/chrome/android/webapk/strings/android_webapk_strings.grd b/chrome/android/webapk/strings/android_webapk_strings.grd index c75f7f7cfde8dd..1e69d960ad8d4f 100644 --- a/chrome/android/webapk/strings/android_webapk_strings.grd +++ b/chrome/android/webapk/strings/android_webapk_strings.grd @@ -4,8 +4,12 @@ + + + + @@ -16,34 +20,52 @@ + + + + + + + + + + + + + + + + + + @@ -52,9 +74,12 @@ + + + diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 34c80e72a12263..99d97fd41cb991 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd @@ -10,6 +10,31 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 1200872e0fdf10..98cc37d45be426 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -15,6 +15,31 @@ are declared in tools/grit/grit_rule.gni. + + + + + + + + + + + + + + + + + + + + + + + + + @@ -79,8 +104,12 @@ are declared in tools/grit/grit_rule.gni. + + + + @@ -91,34 +120,52 @@ are declared in tools/grit/grit_rule.gni. + + + + + + + + + + + + + + + + + + @@ -127,9 +174,12 @@ are declared in tools/grit/grit_rule.gni. + + + diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 1fea58fe6b4e4a..505ee7b7132dbc 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd @@ -12,6 +12,31 @@ chromium_strings.grd. --> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index a8aa746aa18aa2..5c6c1bf8da6fb7 100644 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd @@ -6,6 +6,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/app/resources/locale_settings_linux.grd b/chrome/app/resources/locale_settings_linux.grd index 55a192b4a3b040..c02b58384e3d89 100644 --- a/chrome/app/resources/locale_settings_linux.grd +++ b/chrome/app/resources/locale_settings_linux.grd @@ -6,6 +6,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/browser/touch_to_fill/android/internal/java/strings/android_touch_to_fill_strings.grd b/chrome/browser/touch_to_fill/android/internal/java/strings/android_touch_to_fill_strings.grd index a9ba22c2c02342..bb9ef9ee96bef1 100644 --- a/chrome/browser/touch_to_fill/android/internal/java/strings/android_touch_to_fill_strings.grd +++ b/chrome/browser/touch_to_fill/android/internal/java/strings/android_touch_to_fill_strings.grd @@ -8,8 +8,12 @@ + + + + @@ -20,34 +24,52 @@ + + + + + + + + + + + + + + + + + + @@ -56,9 +78,12 @@ + + + diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index dea9c5fd701725..d4c37700d5cd8e 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd @@ -35,8 +35,12 @@ CHAR-LIMIT guidelines: + + + + @@ -47,34 +51,52 @@ CHAR-LIMIT guidelines: + + + + + + + + + + + + + + + + + + @@ -83,9 +105,12 @@ CHAR-LIMIT guidelines: + + + diff --git a/chromecast/chromecast.gni b/chromecast/chromecast.gni index b4abc0d01356e6..6ea014bdd270d4 100644 --- a/chromecast/chromecast.gni +++ b/chromecast/chromecast.gni @@ -163,7 +163,7 @@ cast_locales = locales # If Cast will also the android files update this and the Cast grd files. if (is_android) { # Subtract out additional Android locales - cast_locales -= [ "af" ] + cast_locales -= android_only_chrome_locales - [ "zh-HK" ] } enable_chromecast_extensions = enable_extensions diff --git a/components/autofill/android/java/strings/autofill_strings.grd b/components/autofill/android/java/strings/autofill_strings.grd index 3288222754320f..1c65758fa2c34a 100644 --- a/components/autofill/android/java/strings/autofill_strings.grd +++ b/components/autofill/android/java/strings/autofill_strings.grd @@ -6,8 +6,12 @@ + + + + @@ -18,34 +22,52 @@ + + + - + + + + + + + + + + + + + + + + @@ -54,9 +76,12 @@ + + + diff --git a/components/components_chromium_strings.grd b/components/components_chromium_strings.grd index f0aadf1296f142..b5d1b5ceaa5ab6 100644 --- a/components/components_chromium_strings.grd +++ b/components/components_chromium_strings.grd @@ -8,6 +8,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/components_google_chrome_strings.grd b/components/components_google_chrome_strings.grd index 7eb6a71e0b1a9b..7ba36ff54143e5 100644 --- a/components/components_google_chrome_strings.grd +++ b/components/components_google_chrome_strings.grd @@ -8,6 +8,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/components_locale_settings.grd b/components/components_locale_settings.grd index 3f19ca291c7515..7755f21c92724c 100644 --- a/components/components_locale_settings.grd +++ b/components/components_locale_settings.grd @@ -6,6 +6,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -82,8 +107,12 @@ + + + + @@ -94,34 +123,52 @@ + + + + + + + + + + + + + + + + + + @@ -130,9 +177,12 @@ + + + diff --git a/components/components_strings.grd b/components/components_strings.grd index b726a117d53d9b..34423b46122e8e 100644 --- a/components/components_strings.grd +++ b/components/components_strings.grd @@ -8,6 +8,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84,8 +109,12 @@ + + + + @@ -96,34 +125,52 @@ + + + + + + + + + + + + + + + + + + @@ -132,9 +179,12 @@ + + + diff --git a/components/embedder_support/android/java/strings/web_contents_delegate_android_strings.grd b/components/embedder_support/android/java/strings/web_contents_delegate_android_strings.grd index bba3d0e064e8e5..2bb9fc9a449672 100644 --- a/components/embedder_support/android/java/strings/web_contents_delegate_android_strings.grd +++ b/components/embedder_support/android/java/strings/web_contents_delegate_android_strings.grd @@ -6,8 +6,12 @@ + + + + @@ -18,34 +22,52 @@ + + + - + + + + + + + + + + + + + + + + @@ -54,9 +76,12 @@ + + + diff --git a/components/omnibox/resources/omnibox_resources.grd b/components/omnibox/resources/omnibox_resources.grd index 4b16321b3b28a5..fdc106112d4129 100644 --- a/components/omnibox/resources/omnibox_resources.grd +++ b/components/omnibox/resources/omnibox_resources.grd @@ -10,6 +10,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/public/android/java/strings/android_content_strings.grd b/content/public/android/java/strings/android_content_strings.grd index b22d8c491c2ffd..88fbfe8bf93944 100644 --- a/content/public/android/java/strings/android_content_strings.grd +++ b/content/public/android/java/strings/android_content_strings.grd @@ -4,8 +4,12 @@ + + + + @@ -16,34 +20,52 @@ + + + + + + + + + + + + + + + + + + @@ -52,9 +74,12 @@ + + + diff --git a/device/bluetooth/bluetooth_strings.grd b/device/bluetooth/bluetooth_strings.grd index c6793f4e059ae0..b795cac0740549 100644 --- a/device/bluetooth/bluetooth_strings.grd +++ b/device/bluetooth/bluetooth_strings.grd @@ -12,6 +12,31 @@ This file contains the strings for bluetooth. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device/fido/fido_strings.grd b/device/fido/fido_strings.grd index 028ee85dcaaaaf..672ef90eab50cb 100644 --- a/device/fido/fido_strings.grd +++ b/device/fido/fido_strings.grd @@ -12,6 +12,31 @@ This file contains the strings for //device/fido. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/services_strings.grd b/services/services_strings.grd index de5ca7ad26fd4a..645008df4681e7 100644 --- a/services/services_strings.grd +++ b/services/services_strings.grd @@ -12,6 +12,31 @@ This file contains strings for code in //services. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/blink/public/strings/blink_strings.grd b/third_party/blink/public/strings/blink_strings.grd index d130c9d4cc4539..52452cac79addc 100644 --- a/third_party/blink/public/strings/blink_strings.grd +++ b/third_party/blink/public/strings/blink_strings.grd @@ -48,6 +48,31 @@ below: + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/libaddressinput/chromium/address_input_strings.grd b/third_party/libaddressinput/chromium/address_input_strings.grd index 50d66da6e2ca9f..69a66cd64270bd 100644 --- a/third_party/libaddressinput/chromium/address_input_strings.grd +++ b/third_party/libaddressinput/chromium/address_input_strings.grd @@ -25,6 +25,31 @@ third_party/libaddressinput/BUILD.gn. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/strings/app_locale_settings.grd b/ui/strings/app_locale_settings.grd index 4a4f5eeeb853ba..a62426e9ff1be5 100644 --- a/ui/strings/app_locale_settings.grd +++ b/ui/strings/app_locale_settings.grd @@ -6,6 +6,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -138,7 +163,7 @@ the family specified. This should be default for locales other than Indian locales. TODO(jungshik): This and IDS_UI_FONT_SIZE_SCALER are only used - on Windows now and are likely to be so in the future because Mac and + on Windows now and are likely to be so in the future because Mac and Linux fonts do not have the issue Windows fonts for some locales (Indian) have. In that case, this need to be enclosed by platform-dependent if-clause. --> diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd index be36419ff108dd..3e8001303add57 100644 --- a/ui/strings/ui_strings.grd +++ b/ui/strings/ui_strings.grd @@ -18,6 +18,31 @@ need to be translated for each locale.--> + + + + + + + + + + + + + + + + + + + + + + + + +