Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: third_party/libaddressinput/chromium/tools/update-strings.py

Issue 312883005: Pull libaddressinput strings to work better with translation tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libaddressinput/chromium/tools/update-strings.py
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 0000000000000000000000000000000000000000..39bfa6bc497130ab4086a8e0b586f5b975ed6017
--- /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())
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698