Skip to content

Commit

Permalink
Add a localised title including the app name to the search widget.
Browse files Browse the repository at this point in the history
BUG=622743

Review-Url: https://codereview.chromium.org/2883253002
Cr-Commit-Position: refs/heads/master@{#472568}
  • Loading branch information
lod authored and Commit bot committed May 17, 2017
1 parent 6813c14 commit b35b5d6
Show file tree
Hide file tree
Showing 115 changed files with 778 additions and 7 deletions.
26 changes: 22 additions & 4 deletions ios/chrome/search_widget_extension/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import("//build/config/locales.gni")
import("//build/config/mac/base_rules.gni")
import("//build/mac/tweak_info_plist.gni")
import("//ios/build/chrome_build.gni")
import("//ios/chrome/extension_repack.gni")
import("//tools/grit/repack.gni")
import("//ios/chrome/tools/strings/generate_localizable_strings.gni")

tweak_info_plist("tweak_info_plist") {
Expand Down Expand Up @@ -97,10 +97,19 @@ bundle_data("resources") {
]
}

extension_repack_all_locales("packed_resources") {
extension = "search_widget_extension"
repack_locales("packed_resources") {
input_locales = ios_packed_locales
output_locales = ios_packed_locales_as_mac_outputs

source_patterns = [
"$root_gen_dir/ios/search_widget_extension/ios_search_widget_extension_strings_",
"$root_gen_dir/ios/search_widget_extension/ios_search_widget_extension_${branding_path_component}_strings_",
]

deps = [
"//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_${branding_path_component}_strings",
"//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_strings",
]
}

generate_localizable_strings("system_strings") {
Expand All @@ -109,8 +118,17 @@ generate_localizable_strings("system_strings") {
config_file = "search_widget_extension_localize_strings_config.plist"
datapack_dir = get_label_info(_packed_resources_target, "target_gen_dir")
packed_locales = ios_packed_locales_as_mac_outputs
output_filenames = [ "Localizable.strings" ]
output_filenames = [
"InfoPlist.strings",
"Localizable.strings",
]
deps = [
"//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_chromium_strings",

# Depends on both branding strings target to ensure the proper .h exists
# (the .plist configuration can only reference one of them, and their
# content is identical).
"//ios/chrome/search_widget_extension/strings:ios_search_widget_extension_google_chrome_strings",
_packed_resources_target,
]
}
2 changes: 1 addition & 1 deletion ios/chrome/search_widget_extension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${CHROMIUM_SHORT_NAME}</string>
<string>IDS_IOS_SEARCH_WIDGET_TITLE</string>
<key>CFBundleExecutable</key>
<string>search_widget_extension</string>
<key>CFBundleIdentifier</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<key>headers</key>
<array>
<string>ios/search_widget_extension/grit/ios_search_widget_extension_strings.h</string>
<string>ios/search_widget_extension/grit/ios_search_widget_extension_chromium_strings.h</string>
</array>
<key>outputs</key>
<array>
Expand All @@ -22,6 +23,19 @@
<string>IDS_IOS_OPEN_COPIED_LINK</string>
</array>
</dict>
<dict>
<key>name</key>
<string>InfoPlist.strings</string>
<key>strings</key>
<array>
<dict>
<key>input</key>
<string>IDS_IOS_SEARCH_WIDGET_TITLE</string>
<key>output</key>
<string>CFBundleDisplayName</string>
</dict>
</array>
</dict>
</array>
</dict>
</plist>
33 changes: 32 additions & 1 deletion ios/chrome/search_widget_extension/strings/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
import("//build/config/locales.gni")
import("//tools/grit/grit_rule.gni")

grit("strings") {
group("strings") {
public_deps = [
":ios_search_widget_extension_chromium_strings",
":ios_search_widget_extension_google_chrome_strings",
":ios_search_widget_extension_strings",
]
}

grit("ios_search_widget_extension_strings") {
source = "ios_search_widget_extension_strings.grd"
output_dir = "$root_gen_dir/ios/search_widget_extension"
outputs = [
Expand All @@ -15,3 +23,26 @@ grit("strings") {
outputs += [ "ios_search_widget_extension_strings_$locale.pak" ]
}
}

grit("ios_search_widget_extension_chromium_strings") {
source = "ios_search_widget_extension_chromium_strings.grd"
output_dir = "$root_gen_dir/ios/search_widget_extension"
outputs = [
"grit/ios_search_widget_extension_chromium_strings.h",
]
foreach(locale, locales_with_fake_bidi) {
outputs += [ "ios_search_widget_extension_chromium_strings_$locale.pak" ]
}
}

grit("ios_search_widget_extension_google_chrome_strings") {
source = "ios_search_widget_extension_google_chrome_strings.grd"
output_dir = "$root_gen_dir/ios/search_widget_extension"
outputs = [
"grit/ios_search_widget_extension_google_chrome_strings.h",
]
foreach(locale, locales_with_fake_bidi) {
outputs +=
[ "ios_search_widget_extension_google_chrome_strings_$locale.pak" ]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file contains definition of resources that will be translated for each
locale. The variables is_win, is_macosx, is_linux, is_ios and is_posix are
available for making strings OS specific. Other platform defines such as
use_titlecase are declared in build/common.gypi.
The strings in this file are specific to iOS, thus is_ios will be true and
all other OS specific variables will be false.
-->

<grit base_dir="." latest_public_release="0" current_release="1"
output_all_resource_defines="false" source_lang_id="en" enc_check="möl">
<outputs>
<output filename="grit/ios_search_widget_extension_chromium_strings.h" type="rc_header">
<emit emit_type="prepend"></emit>
</output>
<output filename="ios_search_widget_extension_chromium_strings_am.pak" type="data_package" lang="am" />
<output filename="ios_search_widget_extension_chromium_strings_ar.pak" type="data_package" lang="ar" />
<output filename="ios_search_widget_extension_chromium_strings_bg.pak" type="data_package" lang="bg" />
<output filename="ios_search_widget_extension_chromium_strings_bn.pak" type="data_package" lang="bn" />
<output filename="ios_search_widget_extension_chromium_strings_ca.pak" type="data_package" lang="ca" />
<output filename="ios_search_widget_extension_chromium_strings_cs.pak" type="data_package" lang="cs" />
<output filename="ios_search_widget_extension_chromium_strings_da.pak" type="data_package" lang="da" />
<output filename="ios_search_widget_extension_chromium_strings_de.pak" type="data_package" lang="de" />
<output filename="ios_search_widget_extension_chromium_strings_el.pak" type="data_package" lang="el" />
<output filename="ios_search_widget_extension_chromium_strings_en-GB.pak" type="data_package" lang="en-GB" />
<output filename="ios_search_widget_extension_chromium_strings_en-US.pak" type="data_package" lang="en" />
<output filename="ios_search_widget_extension_chromium_strings_es.pak" type="data_package" lang="es" />
<output filename="ios_search_widget_extension_chromium_strings_es-MX.pak" type="data_package" lang="es-419" />
<output filename="ios_search_widget_extension_chromium_strings_et.pak" type="data_package" lang="et" />
<output filename="ios_search_widget_extension_chromium_strings_fa.pak" type="data_package" lang="fa" />
<output filename="ios_search_widget_extension_chromium_strings_fake-bidi.pak" type="data_package" lang="fake-bidi" />
<output filename="ios_search_widget_extension_chromium_strings_fi.pak" type="data_package" lang="fi" />
<output filename="ios_search_widget_extension_chromium_strings_fil.pak" type="data_package" lang="fil" />
<output filename="ios_search_widget_extension_chromium_strings_fr.pak" type="data_package" lang="fr" />
<output filename="ios_search_widget_extension_chromium_strings_gu.pak" type="data_package" lang="gu" />
<output filename="ios_search_widget_extension_chromium_strings_he.pak" type="data_package" lang="he" />
<output filename="ios_search_widget_extension_chromium_strings_hi.pak" type="data_package" lang="hi" />
<output filename="ios_search_widget_extension_chromium_strings_hr.pak" type="data_package" lang="hr" />
<output filename="ios_search_widget_extension_chromium_strings_hu.pak" type="data_package" lang="hu" />
<output filename="ios_search_widget_extension_chromium_strings_id.pak" type="data_package" lang="id" />
<output filename="ios_search_widget_extension_chromium_strings_it.pak" type="data_package" lang="it" />
<output filename="ios_search_widget_extension_chromium_strings_ja.pak" type="data_package" lang="ja" />
<output filename="ios_search_widget_extension_chromium_strings_kn.pak" type="data_package" lang="kn" />
<output filename="ios_search_widget_extension_chromium_strings_ko.pak" type="data_package" lang="ko" />
<output filename="ios_search_widget_extension_chromium_strings_lt.pak" type="data_package" lang="lt" />
<output filename="ios_search_widget_extension_chromium_strings_lv.pak" type="data_package" lang="lv" />
<output filename="ios_search_widget_extension_chromium_strings_ml.pak" type="data_package" lang="ml" />
<output filename="ios_search_widget_extension_chromium_strings_mr.pak" type="data_package" lang="mr" />
<output filename="ios_search_widget_extension_chromium_strings_ms.pak" type="data_package" lang="ms" />
<output filename="ios_search_widget_extension_chromium_strings_nl.pak" type="data_package" lang="nl" />
<!-- The translation console uses 'no' for Norwegian Bokmål. It should
be 'nb'. -->
<output filename="ios_search_widget_extension_chromium_strings_nb.pak" type="data_package" lang="no" />
<output filename="ios_search_widget_extension_chromium_strings_pl.pak" type="data_package" lang="pl" />
<output filename="ios_search_widget_extension_chromium_strings_pt.pak" type="data_package" lang="pt-BR" />
<output filename="ios_search_widget_extension_chromium_strings_pt-PT.pak" type="data_package" lang="pt-PT" />
<output filename="ios_search_widget_extension_chromium_strings_ro.pak" type="data_package" lang="ro" />
<output filename="ios_search_widget_extension_chromium_strings_ru.pak" type="data_package" lang="ru" />
<output filename="ios_search_widget_extension_chromium_strings_sk.pak" type="data_package" lang="sk" />
<output filename="ios_search_widget_extension_chromium_strings_sl.pak" type="data_package" lang="sl" />
<output filename="ios_search_widget_extension_chromium_strings_sr.pak" type="data_package" lang="sr" />
<output filename="ios_search_widget_extension_chromium_strings_sv.pak" type="data_package" lang="sv" />
<output filename="ios_search_widget_extension_chromium_strings_sw.pak" type="data_package" lang="sw" />
<output filename="ios_search_widget_extension_chromium_strings_ta.pak" type="data_package" lang="ta" />
<output filename="ios_search_widget_extension_chromium_strings_te.pak" type="data_package" lang="te" />
<output filename="ios_search_widget_extension_chromium_strings_th.pak" type="data_package" lang="th" />
<output filename="ios_search_widget_extension_chromium_strings_tr.pak" type="data_package" lang="tr" />
<output filename="ios_search_widget_extension_chromium_strings_uk.pak" type="data_package" lang="uk" />
<output filename="ios_search_widget_extension_chromium_strings_vi.pak" type="data_package" lang="vi" />
<output filename="ios_search_widget_extension_chromium_strings_zh-CN.pak" type="data_package" lang="zh-CN" />
<output filename="ios_search_widget_extension_chromium_strings_zh-TW.pak" type="data_package" lang="zh-TW" />
</outputs>
<translations>
<file path="resources/ios_search_widget_extension_chromium_strings_am.xtb" lang="am" />
<file path="resources/ios_search_widget_extension_chromium_strings_ar.xtb" lang="ar" />
<file path="resources/ios_search_widget_extension_chromium_strings_bg.xtb" lang="bg" />
<file path="resources/ios_search_widget_extension_chromium_strings_bn.xtb" lang="bn" />
<file path="resources/ios_search_widget_extension_chromium_strings_ca.xtb" lang="ca" />
<file path="resources/ios_search_widget_extension_chromium_strings_cs.xtb" lang="cs" />
<file path="resources/ios_search_widget_extension_chromium_strings_da.xtb" lang="da" />
<file path="resources/ios_search_widget_extension_chromium_strings_de.xtb" lang="de" />
<file path="resources/ios_search_widget_extension_chromium_strings_el.xtb" lang="el" />
<file path="resources/ios_search_widget_extension_chromium_strings_en-GB.xtb" lang="en-GB" />
<file path="resources/ios_search_widget_extension_chromium_strings_es.xtb" lang="es" />
<file path="resources/ios_search_widget_extension_chromium_strings_es-419.xtb" lang="es-419" />
<file path="resources/ios_search_widget_extension_chromium_strings_et.xtb" lang="et" />
<file path="resources/ios_search_widget_extension_chromium_strings_fa.xtb" lang="fa" />
<file path="resources/ios_search_widget_extension_chromium_strings_fi.xtb" lang="fi" />
<file path="resources/ios_search_widget_extension_chromium_strings_fil.xtb" lang="fil" />
<file path="resources/ios_search_widget_extension_chromium_strings_fr.xtb" lang="fr" />
<file path="resources/ios_search_widget_extension_chromium_strings_gu.xtb" lang="gu" />
<file path="resources/ios_search_widget_extension_chromium_strings_hi.xtb" lang="hi" />
<file path="resources/ios_search_widget_extension_chromium_strings_hr.xtb" lang="hr" />
<file path="resources/ios_search_widget_extension_chromium_strings_hu.xtb" lang="hu" />
<file path="resources/ios_search_widget_extension_chromium_strings_id.xtb" lang="id" />
<file path="resources/ios_search_widget_extension_chromium_strings_it.xtb" lang="it" />
<!-- The translation console uses 'iw' for Hebrew, but we use 'he'. -->
<file path="resources/ios_search_widget_extension_chromium_strings_iw.xtb" lang="he" />
<file path="resources/ios_search_widget_extension_chromium_strings_ja.xtb" lang="ja" />
<file path="resources/ios_search_widget_extension_chromium_strings_kn.xtb" lang="kn" />
<file path="resources/ios_search_widget_extension_chromium_strings_ko.xtb" lang="ko" />
<file path="resources/ios_search_widget_extension_chromium_strings_lt.xtb" lang="lt" />
<file path="resources/ios_search_widget_extension_chromium_strings_lv.xtb" lang="lv" />
<file path="resources/ios_search_widget_extension_chromium_strings_ml.xtb" lang="ml" />
<file path="resources/ios_search_widget_extension_chromium_strings_mr.xtb" lang="mr" />
<file path="resources/ios_search_widget_extension_chromium_strings_ms.xtb" lang="ms" />
<file path="resources/ios_search_widget_extension_chromium_strings_nl.xtb" lang="nl" />
<file path="resources/ios_search_widget_extension_chromium_strings_no.xtb" lang="no" />
<file path="resources/ios_search_widget_extension_chromium_strings_pl.xtb" lang="pl" />
<file path="resources/ios_search_widget_extension_chromium_strings_pt-BR.xtb" lang="pt-BR" />
<file path="resources/ios_search_widget_extension_chromium_strings_pt-PT.xtb" lang="pt-PT" />
<file path="resources/ios_search_widget_extension_chromium_strings_ro.xtb" lang="ro" />
<file path="resources/ios_search_widget_extension_chromium_strings_ru.xtb" lang="ru" />
<file path="resources/ios_search_widget_extension_chromium_strings_sk.xtb" lang="sk" />
<file path="resources/ios_search_widget_extension_chromium_strings_sl.xtb" lang="sl" />
<file path="resources/ios_search_widget_extension_chromium_strings_sr.xtb" lang="sr" />
<file path="resources/ios_search_widget_extension_chromium_strings_sv.xtb" lang="sv" />
<file path="resources/ios_search_widget_extension_chromium_strings_sw.xtb" lang="sw" />
<file path="resources/ios_search_widget_extension_chromium_strings_ta.xtb" lang="ta" />
<file path="resources/ios_search_widget_extension_chromium_strings_te.xtb" lang="te" />
<file path="resources/ios_search_widget_extension_chromium_strings_th.xtb" lang="th" />
<file path="resources/ios_search_widget_extension_chromium_strings_tr.xtb" lang="tr" />
<file path="resources/ios_search_widget_extension_chromium_strings_uk.xtb" lang="uk" />
<file path="resources/ios_search_widget_extension_chromium_strings_vi.xtb" lang="vi" />
<file path="resources/ios_search_widget_extension_chromium_strings_zh-CN.xtb" lang="zh-CN" />
<file path="resources/ios_search_widget_extension_chromium_strings_zh-TW.xtb" lang="zh-TW" />
</translations>
<release seq="1" allow_pseudo="false">
<messages fallback_to_english="true">
<message name="IDS_IOS_SEARCH_WIDGET_TITLE" desc="Title of the widget.">
Chromium - Quick Actions
</message>
</messages>
</release>
</grit>
Loading

0 comments on commit b35b5d6

Please sign in to comment.