summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 04:53:09 +0000
committerrouslan@chromium.org <rouslan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 04:53:09 +0000
commitfd2b06f0bebfb48ec56b8ffc9ce446c3ad124a9d (patch)
tree960a9d26fbb3916fa802d3abc5bc87d3a0523e00
parent1b2c2fc3a6996c8fdc8efcff5aa5376ae4c10810 (diff)
downloadchromium_src-fd2b06f0bebfb48ec56b8ffc9ce446c3ad124a9d.zip
chromium_src-fd2b06f0bebfb48ec56b8ffc9ce446c3ad124a9d.tar.gz
chromium_src-fd2b06f0bebfb48ec56b8ffc9ce446c3ad124a9d.tar.bz2
Pull libaddressinput strings to work better with translation tools.
This patch adds the upstream libaddressinput strings into the Chrome build inside of chrome/app/address_input.grdp to work well with the translation tools. TBR=estade@chromium.org BUG=327046 Review URL: https://codereview.chromium.org/312883005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275325 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--.gitignore1
-rw-r--r--DEPS10
-rwxr-xr-xthird_party/libaddressinput/chromium/tools/update-strings.py43
3 files changed, 54 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index a4e0098..391be8d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -66,6 +66,7 @@ v8.log
/chrome/gles2_conform_test_run.xml
/chrome/tab_capture_performance_tests_run.xml
/chrome/telemetry_gpu_test_run.xml
+/chrome/app/address_input_strings.grdp
/chrome/app/theme/default_100_percent/google_chrome
/chrome/app/theme/default_200_percent/google_chrome
/chrome/app/theme/google_chrome
diff --git a/DEPS b/DEPS
index af6376c..062cdda 100644
--- a/DEPS
+++ b/DEPS
@@ -763,6 +763,16 @@ hooks = [
"-s", "src/build/linux/bin/eu-strip.sha1",
],
},
+ # Pull libaddressinput strings to work better with translation tools.
+ # This is a no-op on android and ios platforms.
+ {
+ "name": "libaddressinput-strings",
+ "pattern": ".",
+ "action": [
+ "python",
+ "src/third_party/libaddressinput/chromium/tools/update-strings.py",
+ ],
+ },
{
"name": "drmemory",
"pattern": ".",
diff --git a/third_party/libaddressinput/chromium/tools/update-strings.py b/third_party/libaddressinput/chromium/tools/update-strings.py
new file mode 100755
index 0000000..39bfa6b
--- /dev/null
+++ b/third_party/libaddressinput/chromium/tools/update-strings.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script updates the address_input_strings.grdp file based on the strings
+# in libaddressinput.
+
+import os
+import sys
+
+HEADER = """<!--
+
+DO NOT MODIFY.
+
+This file is generated by "gclient runhooks" from
+src/third_party/libaddressinput/src/cpp/res/messages.grdp. Submit modifications
+to the upstream library at https://libaddressinput.googlecode.com/.
+
+-->
+"""
+
+script_dir = os.path.dirname(os.path.realpath(__file__))
+from_file = os.path.abspath(os.path.join(
+ script_dir, os.pardir, os.pardir, 'src', 'cpp', 'res', 'messages.grdp'))
+
+if not os.path.isfile(from_file):
+ # Android and iOS do not use src/third_party/libaddressinput/src/. Gclient
+ # cannot filter out hooks based on OS or (when using git) based on file name
+ # patterns.
+ print('No libaddressinput for this target OS.')
+ sys.exit()
+
+to_file = os.path.abspath(os.path.join(
+ script_dir, os.pardir, os.pardir, os.pardir, os.pardir, 'chrome', 'app',
+ 'address_input_strings.grdp'))
+
+with open(from_file, 'r') as source:
+ with open(to_file, 'w') as destination:
+ destination.write(source.readline()) # XML declaration.
+ destination.write(HEADER)
+ destination.write(source.read())