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

Unified Diff: tools/grit/grit/tool/build.py

Issue 2112653003: grit: Automatically replace ... with … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move replace to Translate() to avoid changing message IDs Created 4 years, 5 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 | « tools/grit/grit/node/message_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/tool/build.py
diff --git a/tools/grit/grit/tool/build.py b/tools/grit/grit/tool/build.py
index 65a966f5ac041b30a72a202a856c05f0dc025765..51d33415b99cf9c4003f1eaef33770cb373137b1 100755
--- a/tools/grit/grit/tool/build.py
+++ b/tools/grit/grit/tool/build.py
@@ -15,9 +15,12 @@ import shutil
import sys
from grit import grd_reader
+from grit import shortcuts
from grit import util
+from grit.node import include
+from grit.node import message
+from grit.node import structure
from grit.tool import interface
-from grit import shortcuts
# It would be cleaner to have each module register itself, but that would
@@ -145,10 +148,12 @@ are exported to translation interchange files (e.g. XMB files), etc.
output_all_resource_defines = None
write_only_new = False
depend_on_stamp = False
+ replace_ellipsis = True
(own_opts, args) = getopt.getopt(args, 'a:o:D:E:f:w:t:h:',
('depdir=','depfile=','assert-file-list=',
'output-all-resource-defines',
'no-output-all-resource-defines',
+ 'no-replace-ellipsis',
'depend-on-stamp',
'write-only-new='))
for (key, val) in own_opts:
@@ -176,6 +181,8 @@ are exported to translation interchange files (e.g. XMB files), etc.
output_all_resource_defines = True
elif key == '--no-output-all-resource-defines':
output_all_resource_defines = False
+ elif key == '--no-replace-ellipsis':
+ replace_ellipsis = False
elif key == '-t':
target_platform = val
elif key == '-h':
@@ -227,6 +234,13 @@ are exported to translation interchange files (e.g. XMB files), etc.
if rc_header_format:
self.res.AssignRcHeaderFormat(rc_header_format)
self.res.RunGatherers()
+
+ # Replace ... with the single-character version. http://crbug.com/621772
+ if replace_ellipsis:
+ for node in self.res:
+ if isinstance(node, message.MessageNode):
+ node.SetReplaceEllipsis(True)
+
self.Process()
if assert_output_files:
@@ -267,9 +281,6 @@ are exported to translation interchange files (e.g. XMB files), etc.
def AddWhitelistTags(start_node, whitelist_names):
# Walk the tree of nodes added attributes for the nodes that shouldn't
# be written into the target files (skip markers).
- from grit.node import include
- from grit.node import message
- from grit.node import structure
for node in start_node:
# Same trick data_pack.py uses to see what nodes actually result in
# real items.
« no previous file with comments | « tools/grit/grit/node/message_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698