external/grit-i18n.git
3 weeks agoSet the MAXLEN/maxLength attribute for strings in ADM[X] templates. master
joaodasilva@chromium.org [Wed, 5 Nov 2014 11:12:28 +0000 (11:12 +0000)]
Set the MAXLEN/maxLength attribute for strings in ADM[X] templates.

This allows strings and JSON blobs in the registry and GPO
objects to have a length longer than the default of 1023 characters.

BUG=chromium:428340

Review URL: https://codereview.chromium.org/687073003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@182 7262f16d-afe8-6277-6482-052fa10e57b1

3 weeks agoFix duplicated strings in ADMX templates.
joaodasilva@chromium.org [Wed, 5 Nov 2014 11:10:50 +0000 (11:10 +0000)]
Fix duplicated strings in ADMX templates.

Also fixed the generated <string> IDs, which can't contain "."
characters.

BUG=chromium:429117

Review URL: https://codereview.chromium.org/702793003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@181 7262f16d-afe8-6277-6482-052fa10e57b1

3 weeks agoAdd support to override output_all_resource_defines from command line.
newt@chromium.org [Tue, 4 Nov 2014 18:51:39 +0000 (18:51 +0000)]
Add support to override output_all_resource_defines from command line.

If --output_all_resource_defines or --nooutput_all_resource_defines
is specified to grit's build tool, then the value in the .grd will be
overridden.

Because gyp sends the same args to grit_info.py and grit.py, this CL
also updates grit_info.py to accept these arguments to avoid
unsupported argument errors.

BUG=428947
R=newt@chromium.org

Review URL: https://codereview.chromium.org/691873002

Patch from Lane LiaBraaten <lliabraa@chromium.org>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@180 7262f16d-afe8-6277-6482-052fa10e57b1

3 weeks agoApply whitelist file to structure elements.
newt@chromium.org [Fri, 31 Oct 2014 16:24:47 +0000 (16:24 +0000)]
Apply whitelist file to structure elements.

Resources specified with structure elements were being included in
.pak and .h files even if they were not included in a specified
whitelist file.

The .pak file issue is fixed in build.py by including structure nodes
in the collection of node types that are checked against the whitelist.
This seems to be an oversight as the code has a comment like "Apply
the same trick that data_pack.py uses" but the corresponding code in
data_pack.py was updated to include structure noded in [1]. This method
that contained this code is no longer in data_pack.py.

The .h file issue is fixed in rc_header.py by treating structure nodes
in the same manner as message nodes (i.e. only output them if they're
active). The correct fix seems to be to set output_all_resource_defines
to true in all the .grd files, but until then a structure element should
not generate an entry in a header file if it's not in the whitelist.

https://chromiumcodereview.appspot.com/10386189/diff/29002/grit/format/data_pack.py

BUG=None
R=joaodasilva@chromium.org, newt@chromium.org

Review URL: https://codereview.chromium.org/669763002

Patch from Lane LiaBraaten <lliabraa@chromium.org>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@179 7262f16d-afe8-6277-6482-052fa10e57b1

5 weeks agoAdd a chromium version to policy template files.
joaodasilva@chromium.org [Thu, 16 Oct 2014 12:01:31 +0000 (12:01 +0000)]
Add a chromium version to policy template files.

CL by cschuet@chromium.org, reviewed at
https://codereview.chromium.org/631223003.

BUG=108941
TEST=python test_suite_all.py

Review URL: https://codereview.chromium.org/642443004

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@178 7262f16d-afe8-6277-6482-052fa10e57b1

2 months agoMake it easier to parse the output assertion
thakis@chromium.org [Wed, 24 Sep 2014 20:32:28 +0000 (20:32 +0000)]
Make it easier to parse the output assertion

Currently, when the list of outputs doesn't match the expected outputs,
grit just prints a big unreadable block of text. This change just makes
it much easier to parse that output and fix the offending expectations.

Review URL: https://codereview.chromium.org/576613002/
Patch from Chris Hopman <cjhopman@chromium.org>!

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@177 7262f16d-afe8-6277-6482-052fa10e57b1

2 months agoAdd optional mandatory policy setting for template generation
joaodasilva@chromium.org [Mon, 8 Sep 2014 14:09:25 +0000 (14:09 +0000)]
Add optional mandatory policy setting for template generation

This CL modifies template writer such that mandatory policy templates are not generated when a flag is set.

CL by kaliamoorthi@chromium.org, reviewed at https://codereview.chromium.org/544113002.

BUG=410856

Review URL: https://codereview.chromium.org/550163002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@176 7262f16d-afe8-6277-6482-052fa10e57b1

2 months agoLink to the documentation for complex policies on Windows.
joaodasilva@chromium.org [Thu, 28 Aug 2014 15:34:40 +0000 (15:34 +0000)]
Link to the documentation for complex policies on Windows.

This change also makes that description localized.

BUG=chromium:381627
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/515923002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@175 7262f16d-afe8-6277-6482-052fa10e57b1

2 months agoFixed the example JSON strings for Windows and Linux.
joaodasilva@chromium.org [Thu, 28 Aug 2014 15:22:41 +0000 (15:22 +0000)]
Fixed the example JSON strings for Windows and Linux.

The example policies weren't valid JSON because they used single quotes
instead of double quotes.

BUG=None
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/512733004

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@174 7262f16d-afe8-6277-6482-052fa10e57b1

3 months agoRespect output_all_resource_defines when generating includes in resource maps.
thestig@chromium.org [Wed, 6 Aug 2014 23:40:21 +0000 (23:40 +0000)]
Respect output_all_resource_defines when generating includes in resource maps.

BUG=chromium:333201
TEST=included unit test.
R=tony@chromium.org

Review URL: https://codereview.chromium.org/444233002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@173 7262f16d-afe8-6277-6482-052fa10e57b1

3 months agoRespect output_all_resource_defines when generating structures in resource
tony@chromium.org [Wed, 6 Aug 2014 21:54:32 +0000 (21:54 +0000)]
Respect output_all_resource_defines when generating structures in resource
maps.

BUG=chromium:333201
TEST=included unit test.

Original patch by Lei Zhang at:
https://codereview.chromium.org/444053003/

Review URL: https://codereview.chromium.org/443183003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@172 7262f16d-afe8-6277-6482-052fa10e57b1

4 months agoFix .d file outputs, add support for asserting outputs.
brettw@chromium.org [Mon, 21 Jul 2014 20:05:21 +0000 (20:05 +0000)]
Fix .d file outputs, add support for asserting outputs.

Fixes .d file generation by putting the first output file name as the
destination file, rather than the .d file itself.

Adds support for asserting that given files are in the output. This allows
the user of the build tool to assume that certain output files will be
generated while providing a way to catch errors.

R=thakis@chromium.org
Review=https://codereview.chromium.org/407693002/

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@171 7262f16d-afe8-6277-6482-052fa10e57b1

5 months agoAdded support for string-enum-list.
joaodasilva@chromium.org [Thu, 26 Jun 2014 11:37:29 +0000 (11:37 +0000)]
Added support for string-enum-list.

Added string-enum-list as a valid policy type. This acts just like 'list' in
terms of the policy templates generated, but the documentation generated is
different (it allows enumerating the valid values).

Landing on behalf of atwilson@chromium.org, reviewed at
https://codereview.chromium.org/352163003.

Review URL: https://codereview.chromium.org/347293003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@170 7262f16d-afe8-6277-6482-052fa10e57b1

5 months agoTeach grit that file.svg is an SVG.
newt@chromium.org [Thu, 12 Jun 2014 18:36:17 +0000 (18:36 +0000)]
Teach grit that file.svg is an SVG.

When dropping the reliance of platform mime databases we also lost
support for the svg mime type. Readding it specifically.

Also added an explicit failure if something similar happens in the future.

BUG=383189
R=newt@chromium.org

Review URL: https://codereview.chromium.org/324383003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@169 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoHave grit survive a Windows registry with Unicode keys.
thakis@chromium.org [Thu, 24 Apr 2014 17:51:46 +0000 (17:51 +0000)]
Have grit survive a Windows registry with Unicode keys.

grit triggered a python bug http://bugs.python.org/issue9291 that
broke the build. This change is to rely only on the internal
python mime type list which contains everything we need anyway.

BUG=chromium:365188
Review URL: https://codereview.chromium.org/253443002/

Patch from Daniel Bratell <bratell@opera.com>!

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@168 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoList removed (non-whitelisted) resources when repacking.
newt@chromium.org [Tue, 22 Apr 2014 20:54:49 +0000 (20:54 +0000)]
List removed (non-whitelisted) resources when repacking.

R=newt@chromium.org

Review URL: https://codereview.chromium.org/246623004

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@167 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoSpeed-up whitelist check in data_pack.py
newt@chromium.org [Mon, 21 Apr 2014 22:10:08 +0000 (22:10 +0000)]
Speed-up whitelist check in data_pack.py

Previously whitelist was passed as a list causing a slow down when doing
'key in whitelist' check. Converting the list to a set to speed that up.

Local testing shows about 4x speedup in running RePack().

BUG=338759
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/244893005

Patch from Aurimas Liutikas <aurimas@chromium.org>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@166 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoFix leading/trailing whitespace form chrome_extension_json output.
sergeyu@chromium.org [Fri, 18 Apr 2014 18:10:32 +0000 (18:10 +0000)]
Fix leading/trailing whitespace form chrome_extension_json output.

Leading and trailing whitespace wasn't included in the output even if marked up
with appropriate ''' delimiters in the .grd file

R=sergeyu@chromium.org

Review URL: https://codereview.chromium.org/242183004

Patch from Peter Lundblad <plundblad@chromium.org>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@165 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoMake grit aware that nb and no language codes are equivalent.
tony@chromium.org [Fri, 11 Apr 2014 22:03:58 +0000 (22:03 +0000)]
Make grit aware that nb and no language codes are equivalent.

Translation console uses non-standard language codes 'iw' and 'no'
for Hebrew and Norwegian Bokm\u00e5l instead of 'he' and 'nb' used in
Chrome. Previously grit handled that properly for Hebrew, but not
for Nerwegian Bokm\u00e5l.

Patch by Sergey Ulanov at
https://codereview.chromium.org/235893002/

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@161 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoAdded files missing from revision 159.
joaodasilva@chromium.org [Mon, 7 Apr 2014 17:20:07 +0000 (17:20 +0000)]
Added files missing from revision 159.

BUG=360508
TBR=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/227493005

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@160 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoAdded a policy writer for iOS Plists.
joaodasilva@chromium.org [Mon, 7 Apr 2014 13:38:29 +0000 (13:38 +0000)]
Added a policy writer for iOS Plists.

BUG=360508
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/227073006

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@159 7262f16d-afe8-6277-6482-052fa10e57b1

7 months agoAdd whitelist support to repack.
newt@chromium.org [Wed, 2 Apr 2014 23:05:04 +0000 (23:05 +0000)]
Add whitelist support to repack.

- Added ability to filter out resources by specifying a file that contains
  a list of resource id whitelist.
- Fixed lint errors in data_pack.py, data_pack_unittest.py and repack.py
- Added tests for RePack()

BUG=338759
R=newt@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/217273003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@158 7262f16d-afe8-6277-6482-052fa10e57b1

8 months agoRevert of Ignore whitelist when generating android xml. (https://codereview.chromium...
joi@chromium.org [Wed, 26 Mar 2014 09:57:14 +0000 (09:57 +0000)]
Revert of Ignore whitelist when generating android xml. (https://codereview.chromium.org/196923002/)

Reason for revert:
This CL breaks the <if expr=""> for Android XML generation.

Original issue's description:
> Ignore whitelist when generating android xml.
>
> Whitelist should only apply to the resources used outside of Java.
> This helps us to only need to specify the whitelist for C++ resources
> without affecting Android XML file generation.
>
> BUG=338759
>
> Patch from issue 196273004, landing for aurimas@chromium.org
>
> Committed: https://code.google.com/p/grit-i18n/source/detail?r=156

TBR=joi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=338759

Landing for aurimas@chromium.org, original patch at https://codereview.chromium.org/211743003/

Review URL: https://codereview.chromium.org/212563002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@157 7262f16d-afe8-6277-6482-052fa10e57b1

8 months agoIgnore whitelist when generating android xml.
joi@chromium.org [Wed, 12 Mar 2014 09:21:22 +0000 (09:21 +0000)]
Ignore whitelist when generating android xml.

Whitelist should only apply to the resources used outside of Java.
This helps us to only need to specify the whitelist for C++ resources
without affecting Android XML file generation.

BUG=338759

Patch from issue 196273004, landing for aurimas@chromium.org

Review URL: https://codereview.chromium.org/196923002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@156 7262f16d-afe8-6277-6482-052fa10e57b1

8 months agoStart to implicitly include \n in rc_header_format.
joi@chromium.org [Mon, 3 Mar 2014 14:36:43 +0000 (14:36 +0000)]
Start to implicitly include \n in rc_header_format.

Certain tools such as ninja perform escaping on the arguments passed to grit
and that makes it difficult to pass \n at the end of the rc_header_format.

This CL makes the new line at the end implicit by adding automatically.

BUG=338759

Landing for aurimas@chromium.org, patch from issue 183513005.

Review URL: https://codereview.chromium.org/176993010

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@155 7262f16d-afe8-6277-6482-052fa10e57b1

9 months agoAdding support for custom rc header formatting.
joi@chromium.org [Fri, 21 Feb 2014 11:05:55 +0000 (11:05 +0000)]
Adding support for custom rc header formatting.

Adding ability to overwride the default rc header file format
to be able to replace the default:
with:

This is needed to be able to collect the symbols that get used during
the compilation step.

BUG=338759

Original patch by aurimas@chromium.org, issue 171863002.

Review URL: https://codereview.chromium.org/172533003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@152 7262f16d-afe8-6277-6482-052fa10e57b1

9 months agoAdd a definition for "is_bsd"
joi@chromium.org [Mon, 10 Feb 2014 10:16:30 +0000 (10:16 +0000)]
Add a definition for "is_bsd"

Needed for Chromium code reviews 138003017 and 146963007.

BUG=

Landing for r.c.ladan@gmail.com, patch from https://codereview.chromium.org/156493003

Review URL: https://codereview.chromium.org/158743002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@151 7262f16d-afe8-6277-6482-052fa10e57b1

9 months agoProvide defines as local variables in if-expressions.
newt@chromium.org [Fri, 7 Feb 2014 21:01:12 +0000 (21:01 +0000)]
Provide defines as local variables in if-expressions.

If-expressions can now access the values of variables defined at the
command line (using -D or -E). Undefined variables default to False.
This enables many if-expressions to be simplified, e.g.:

Before: <if expr="pp_ifdef('enable_foo')">
After:  <if expr="enable_foo">

Before: <if expr="defs['foo'] == 'bar'">
After:  <if expr="foo == 'bar'">

This also improves evaluation performance by caching compiled code
objects, leading to a 3x evaluation speedup while processing
generated_resources.grd (0.35 -> 0.12 sec on my machine).

R=joi@chromium.org

Review URL: https://codereview.chromium.org/156443002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@150 7262f16d-afe8-6277-6482-052fa10e57b1

9 months agoAdd back 'android' and 'ios' for is_posix, and fix check for bsd.
joi@chromium.org [Wed, 29 Jan 2014 16:51:09 +0000 (16:51 +0000)]
Add back 'android' and 'ios' for is_posix, and fix check for bsd.

BUG=none
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/135273011

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@149 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoStrip IDS_ as well as IDR_ in the chrome_messages_json generator.
sergeyu@chromium.org [Thu, 23 Jan 2014 03:22:29 +0000 (03:22 +0000)]
Strip IDS_ as well as IDR_ in the chrome_messages_json generator.

This is needed for renaming string resources in Chrome Remote
Desktop webapp from IDR_ to IDS_ for consistency with other
Chrome string resources.

R=sergeyu@chromium.org

Review URL: https://codereview.chromium.org/138903021

Patch from Lambros Lambrou <lambroslambrou@chromium.org>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@148 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoAdded support for Android and iOS to the grit policy generators.
joaodasilva@chromium.org [Thu, 16 Jan 2014 12:53:57 +0000 (12:53 +0000)]
Added support for Android and iOS to the grit policy generators.

BUG=275292
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/140783003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@147 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoOutput the subkey type for list policies on the plist generator.
joaodasilva@chromium.org [Wed, 15 Jan 2014 10:54:13 +0000 (10:54 +0000)]
Output the subkey type for list policies on the plist generator.

BUG=61734
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/138343003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@146 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoAdd a --depfile flag that explicitly names the generated depfile.
thakis@chromium.org [Wed, 8 Jan 2014 00:58:46 +0000 (00:58 +0000)]
Add a --depfile flag that explicitly names the generated depfile.

--depdir stays around, since the base directory of paths in the depfile needs
to be specified as well.

BUG=chromium:297672
Review URL: https://codereview.chromium.org/99463008/

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@145 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoDon't include _unittest.py files in `grit_info --inputs` output.
thakis@chromium.org [Wed, 8 Jan 2014 00:49:24 +0000 (00:49 +0000)]
Don't include _unittest.py files in `grit_info --inputs` output.

If only a test changes, it shouldn't affect the files created by grit, so
this is useless output.

Reduces the size of chrome's ninja files by about 120kB / 1%.

Review URL: https://codereview.chromium.org/125353002/

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@144 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoandroid2grd tool now puts <outputs> element first.
newt@chromium.org [Tue, 7 Jan 2014 15:08:36 +0000 (15:08 +0000)]
android2grd tool now puts <outputs> element first.

By convention, most grd files have the <outputs> element first, followed
by <translations> and then <release>. This updates the android2grd tool
to follow that order.

R=thakis@chromium.org

Review URL: https://codereview.chromium.org/125523002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@143 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoSimplify how variable_map is initialized. Suggestion by thakis@chromium.org.
joi@chromium.org [Thu, 2 Jan 2014 16:05:39 +0000 (16:05 +0000)]
Simplify how variable_map is initialized. Suggestion by thakis@chromium.org.

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=23

Review URL: https://codereview.chromium.org/122253002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@142 7262f16d-afe8-6277-6482-052fa10e57b1

10 months agoSet target platform on root node earlier.
joi@chromium.org [Fri, 27 Dec 2013 14:33:26 +0000 (14:33 +0000)]
Set target platform on root node earlier.

Fix to grd_reader.py proposed by thakis@chromium.org and used verbatim
from his proposal. I added the regression test to surface the problem
(prior to this fix) in a unit test on all platforms where one of the
is_xyz shortcuts in .grd expressions is true.

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=23

Review URL: https://codereview.chromium.org/118663003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@141 7262f16d-afe8-6277-6482-052fa10e57b1

11 months agoAdd support for Chrome policy type that references external data
joaodasilva@chromium.org [Wed, 27 Nov 2013 18:40:48 +0000 (18:40 +0000)]
Add support for Chrome policy type that references external data

This CL adds support for a Chrome policy type that references external data.

BUG=256635
TEST=Ran Chrome's target policy_templates
R=joaodasilva@chromium.org

Review URL: https://codereview.chromium.org/92213002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@140 7262f16d-afe8-6277-6482-052fa10e57b1

11 months agoImprove platform support indications for policy documentation.
joaodasilva@chromium.org [Wed, 27 Nov 2013 13:23:17 +0000 (13:23 +0000)]
Improve platform support indications for policy documentation.

The generated policy documentation indicates example values and preferences
paths. This change only shows the data relevant for the platforms where the
policy is actually supported.

BUG=None
R=joi@chromium.org, pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/91233003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@139 7262f16d-afe8-6277-6482-052fa10e57b1

12 months agoProperly substitute variables that reference paths outside SRCDIR.
joi@chromium.org [Tue, 12 Nov 2013 13:48:50 +0000 (13:48 +0000)]
Properly substitute variables that reference paths outside SRCDIR.

Apply the same kind of trick added in r58 and use a define's base name if it
refers to a location outside SRCDIR; so far, GritNode::AssignFirstIds() would
parse a file name differently than _ReadFirstIdsFromFile() even though they
refer to the same entry.

TEST=in Chromium, make BUILDTYPE=Release builddir_name=/outside/srcdir/out tracing_resources
R=joi@chromium.org

Landing for original author raphael.kubo.da.costa@intel.com,
https://codereview.chromium.org/69463002/

Review URL: https://codereview.chromium.org/68163013

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@138 7262f16d-afe8-6277-6482-052fa10e57b1

13 months agoAdd the ability to generate a depfile when running grit build.
joi@chromium.org [Fri, 11 Oct 2013 09:53:28 +0000 (09:53 +0000)]
Add the ability to generate a depfile when running grit build.

This is analogous to the ability of some compilers to generate depfiles
that contain the .h files a .cc file depends on when it compiles it.
This is useful for speeding up build systems because the input
dependencies don't need to be determined before compilation.

As there are no pre-determined outputs from a .grd file (all the outputs
are determined by the file contents) the depfile refers to itself and
acts as a stamp for the generated outputs.

BUG=297672

Original author koz@chromium.org. Original patch is issue 25683011.

Review URL: https://codereview.chromium.org/27001002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@137 7262f16d-afe8-6277-6482-052fa10e57b1

14 months agoDefault target_platform in grit_info to None.
flackr@chromium.org [Thu, 5 Sep 2013 22:17:36 +0000 (22:17 +0000)]
Default target_platform in grit_info to None.

TEST=./grit.py unit

Review URL: https://codereview.chromium.org/23978009

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@136 7262f16d-afe8-6277-6482-052fa10e57b1

14 months agoMake image set insertion work in more cases
flackr@chromium.org [Tue, 3 Sep 2013 20:58:45 +0000 (20:58 +0000)]
Make image set insertion work in more cases

In case there was a background with multiple layers (background: url(...),
url(...);), code would just replace first URL occurrence with -webkit-image-set
rule. Handles multiple layers in case there are only url() functions. Still
won't work if value contains more values than just url()s.

Additionally, use \s for matching white space, so that Windows line endings are
also handled.

And allow line breaks between 'content|background[...]:' and the following
value. Code would previously stop matching if there was a line break between
the colon and the value.

Code review at https://codereview.chromium.org/23591022/
Patch from issue 23591022, by rchlodnicki@opera.com

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@135 7262f16d-afe8-6277-6482-052fa10e57b1

15 months agoChanges grit_info.py to respect target_platform when generating output lists.
joi@chromium.org [Sun, 25 Aug 2013 17:19:58 +0000 (17:19 +0000)]
Changes grit_info.py to respect target_platform when generating output lists.

Patch from issue 22923027, by rohitrao@chromium.org

Review URL: https://codereview.chromium.org/23102022

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@134 7262f16d-afe8-6277-6482-052fa10e57b1

15 months agoMake grit resource maps generate maps for strings.
tony@chromium.org [Tue, 13 Aug 2013 17:29:57 +0000 (17:29 +0000)]
Make grit resource maps generate maps for strings.

This allows mapping from "IDS_FOO" to IDS_FOO to
get generated string identifiers.

Patch by sigbjorn@opera.com.  Code review at
https://codereview.chromium.org/22739002/ .

R=tony

Review URL: https://codereview.chromium.org/23090002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@133 7262f16d-afe8-6277-6482-052fa10e57b1

16 months agoCorected LANGID for 'sr'.
joi@chromium.org [Tue, 9 Jul 2013 20:00:53 +0000 (20:00 +0000)]
Corected LANGID for 'sr'.

[LANG_SERBIAN, SUBLANG_SERBIAN_LATIN] corresponds to the LANGID 0x081a.

Original by alexeypa@chromium.org, patch from issue 18333009.

Review URL: https://codereview.chromium.org/18695006

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@132 7262f16d-afe8-6277-6482-052fa10e57b1

16 months agoCorrected LANGID for 'es'.
joi@chromium.org [Tue, 9 Jul 2013 11:36:53 +0000 (11:36 +0000)]
Corrected LANGID for 'es'.

[LANG_SPANISH, SUBLANG_SPANISH_MODERN] corresponds to the LANGID 0x0c0a.

Original by alexeypa@chromium.org, patch from issue 18132016.

Review URL: https://codereview.chromium.org/18892002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@131 7262f16d-afe8-6277-6482-052fa10e57b1

16 months agoCorrected mappings for Norwegian:
joi@chromium.org [Tue, 9 Jul 2013 11:35:13 +0000 (11:35 +0000)]
Corrected mappings for Norwegian:

- 'no' -> 'LANG_NORWEGIAN, SUBLANG_DEFAULT'
- 'nb' -> 'LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL'
- 'nn' -> 'LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK'

Original by alexeypa@chromium.org, patch from issue 18339009.

Review URL: https://codereview.chromium.org/18646003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@130 7262f16d-afe8-6277-6482-052fa10e57b1

16 months agoUse JSONEncoder to escape JSON strings.
joi@chromium.org [Mon, 8 Jul 2013 16:51:15 +0000 (16:51 +0000)]
Use JSONEncoder to escape JSON strings.

This CL fixes escaping of '\n' and unicode characters.

BUG=grit-i18n:20

Landing for alexeypa@chromium.org, patch from issue 18301005.

Review URL: https://codereview.chromium.org/18860003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@129 7262f16d-afe8-6277-6482-052fa10e57b1

16 months agoFix LINK and INCLUDE HTML inlining Regexes to Support End Tags on Different Lines
joi@chromium.org [Tue, 2 Jul 2013 19:41:33 +0000 (19:41 +0000)]
Fix LINK and INCLUDE HTML inlining Regexes to Support End Tags on Different Lines

BUG=19

Patch from issue 18386002, landing for robliao@chromium.org.

Review URL: https://codereview.chromium.org/18568003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@128 7262f16d-afe8-6277-6482-052fa10e57b1

17 months agoHigh DPI support for Themes
flackr@chromium.org [Thu, 13 Jun 2013 16:58:00 +0000 (16:58 +0000)]
High DPI support for Themes

Modified processing of Theme URLs. We will now insert the scale factor text
before the first ? instead of just appending it. This is necessary for parsing
to work properly (see ParsePathAndScale in src/ui/webui/web_ui_util.cc).
See also recent CL which modified related *.css and *.js files:
https://codereview.chromium.org/16610002/

Example:
Old: url(chrome://theme/IDR_THEME_NTP_ATTRIBUTION?$1@2x)
New: url(chrome://theme/IDR_THEME_NTP_ATTRIBUTION?@2x$1)

BUG=chromium:248189,chromium:133934
TEST=ChromeHtmlUnittest.testThemeResources

Landing for sschmitz@chromium.org

Review URL: https://codereview.chromium.org/15713020/

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@127 7262f16d-afe8-6277-6482-052fa10e57b1

17 months agoAdded initial support for android to the grit policy generators.
joaodasilva@chromium.org [Mon, 10 Jun 2013 08:57:24 +0000 (08:57 +0000)]
Added initial support for android to the grit policy generators.

Some policies may be flagged as supported on the android platform;
this change makes the policy templates generators recognize but ignore
that platform, so that the policy resources can still be generated.

BUG=chromium:247641
R=pastarmovj@chromium.org

Review URL: https://codereview.chromium.org/16132009

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@126 7262f16d-afe8-6277-6482-052fa10e57b1

17 months agoGRIT: Enable variable expansion in filenames during HTML inlining.
joaodasilva@chromium.org [Mon, 10 Jun 2013 08:22:38 +0000 (08:22 +0000)]
GRIT: Enable variable expansion in filenames during HTML inlining.

BUG=232048
R=flackr@chromium.org

Review URL: https://codereview.chromium.org/16539002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@125 7262f16d-afe8-6277-6482-052fa10e57b1

17 months agoNormalize image/x-png mime type to the standard one
joi@chromium.org [Sat, 8 Jun 2013 14:20:31 +0000 (14:20 +0000)]
Normalize image/x-png mime type to the standard one

On Windows, Python's mimetypes.guess_type() would return image/x-png
type for PNG files as its default mappings are overriden by
a Windows specific mappings read from the registry.

Using image/x-png for such resources would trigger a warning when
such inlined resource is loaded in the browser (Blink engine at least).

Create a helper function that normalizes such known, but unwanted
mime types to standard ones.

Review URL: https://codereview.chromium.org/15981005

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@124 7262f16d-afe8-6277-6482-052fa10e57b1

18 months agoAdd is_ios to the list of grit variables
joi@chromium.org [Wed, 22 May 2013 14:45:50 +0000 (14:45 +0000)]
Add is_ios to the list of grit variables

Adds is_ios mirroring the other platforms, and makes is_macosx false
and is_posix true for iOS (matching the behavior in gyp).

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=10

Originally by stuartmorgan@chromium.org, https://codereview.chromium.org/15730002/

Review URL: https://codereview.chromium.org/15747003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@123 7262f16d-afe8-6277-6482-052fa10e57b1

18 months agoFix processing newline on Windows chrome_html_unittests.
flackr@chromium.org [Thu, 16 May 2013 17:26:51 +0000 (17:26 +0000)]
Fix processing newline on Windows chrome_html_unittests.

BUG=16
TEST=./grit.py unit passes testRemoveUnsupportedScale

Review URL: https://codereview.chromium.org/15132011

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@122 7262f16d-afe8-6277-6482-052fa10e57b1

18 months agoFixes the policy template generator to work predictably even with Python hash randomi...
pastarmovj@chromium.org [Wed, 15 May 2013 08:43:14 +0000 (08:43 +0000)]
Fixes the policy template generator to work predictably even with Python hash randomization turned on.

Unit tests that were using directly str() on dictionaries were failing in a flaky manner when hash
randomization is switched on because the order in which dictionary entries are printed is not stable
anymore. To fix this we always sort the dictionaries in alphabetic order in values to make this
behavior stable and predictable.

BUG=18
TEST=Run unit tests with python 2.7+ and the -R flag and verify that they are not flaky.

Review URL: https://codereview.chromium.org/14940026

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@121 7262f16d-afe8-6277-6482-052fa10e57b1

18 months agoSupport android as a target platform.
joi@chromium.org [Tue, 14 May 2013 18:11:41 +0000 (18:11 +0000)]
Support android as a target platform.

Provide an is_android condition, and set is_posix to true when the
target platform is android to match the OS_* defines in Chromium.
grit_info didn't previously support -t to set the target platform, so
add that as well.

BUG=chromium:239434

Patch by torne@chromium.org, original issue 14813026

Review URL: https://codereview.chromium.org/15051003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@120 7262f16d-afe8-6277-6482-052fa10e57b1

19 months agoDon't use python 2.7 syntax.
joaodasilva@chromium.org [Fri, 26 Apr 2013 11:19:58 +0000 (11:19 +0000)]
Don't use python 2.7 syntax.

r117 introduced a line using dictionary comprehensions, which requires python
2.7 but Chromium uses 2.6.

Reviewed at https://codereview.chromium.org/14042007/.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@119 7262f16d-afe8-6277-6482-052fa10e57b1

19 months agoAdded test file missing from r117.
joaodasilva@chromium.org [Fri, 26 Apr 2013 09:03:10 +0000 (09:03 +0000)]
Added test file missing from r117.

r117 includes the changes from https://codereview.chromium.org/14042007/ but is
missing this test file.

Review URL: https://codereview.chromium.org/14509010

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@118 7262f16d-afe8-6277-6482-052fa10e57b1

19 months agogit-svn-id: http://grit-i18n.googlecode.com/svn/trunk@117 7262f16d-afe8-6277-6482...
joaodasilva@chromium.org [Fri, 26 Apr 2013 08:56:10 +0000 (08:56 +0000)]
git-svn-id: grit-i18n.googlecode.com/svn/trunk@117 7262f16d-afe8-6277-6482-052fa10e57b1

19 months agoSwitch to lazy_re for a few regexps in html_inline.
joi@chromium.org [Wed, 17 Apr 2013 11:01:19 +0000 (11:01 +0000)]
Switch to lazy_re for a few regexps in html_inline.

Fix several unit tests on Windows.
Review URL: https://codereview.chromium.org/13843003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@116 7262f16d-afe8-6277-6482-052fa10e57b1

20 months agoAdd formatter_data attibute and ouput only tagged Android Java strings.
newt@chromium.org [Fri, 15 Mar 2013 18:01:16 +0000 (18:01 +0000)]
Add formatter_data attibute and ouput only tagged Android Java strings.

formatter_data enables per-message customization of ouput options.

Using formatter_data, android_xml now has support to output only
tagged strings, so a small subset of strings from a large grd file can
be outputted without excessive use of <if> tags.

android_xml also adds support for controlling the product and name
attributes on outputted <string> elements via formatter_data.

BUG=chromium:176069

Review URL: https://codereview.chromium.org/12450017

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@115 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoFix type-check in Python 2.6's re.sub implementation.
joi@chromium.org [Mon, 25 Feb 2013 14:36:50 +0000 (14:36 +0000)]
Fix type-check in Python 2.6's re.sub implementation.

BUG=none

Review URL: https://codereview.chromium.org/12320093

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@114 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoFix html_inline to work with Python 2.6.
joi@chromium.org [Mon, 25 Feb 2013 12:14:59 +0000 (12:14 +0000)]
Fix html_inline to work with Python 2.6.

Prior to this, the |flags| parameter of |re.sub| was being used, but
this didn't get added until Python 2.7. Instead, compile all regexes
that require this flag; passing flags to |re.compile| has been
supported much longer.

BUG=none

Review URL: https://codereview.chromium.org/12317096

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@113 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoMemoize Node::EvaluateExpression()
joi@chromium.org [Mon, 25 Feb 2013 10:40:15 +0000 (10:40 +0000)]
Memoize Node::EvaluateExpression()

Part of goal to speed up gyp.

This function was identified as hot in cProfile. On Z600
with GYP_PARALLEL=1, this reduces gyp_chromium time by 1.2s.

BUG=chromium:82230

TBR=ilevy@chromium.org
Landing for ilevy@chromium.org, patch from issue 12317089.

Review URL: https://codereview.chromium.org/12326099

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@112 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agogrit: Can't handle multi-line <link> tags when inlining
joi@chromium.org [Thu, 21 Feb 2013 11:28:23 +0000 (11:28 +0000)]
grit: Can't handle multi-line <link> tags when inlining

BUG=176593

TBR=dbeam@chromium.org
Landing for dbeam@chromium.org, patch from issue 12289018.

Review URL: https://codereview.chromium.org/12321045

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@111 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoCorrectly resolve relative paths when inlining @import directives in CSS files.
joi@chromium.org [Fri, 15 Feb 2013 12:09:12 +0000 (12:09 +0000)]
Correctly resolve relative paths when inlining @import directives in CSS files.

TBR=bauerb@chromium.org
BUG=176233

Committing for bauerb@chromium.org, patch from issue 12271020.

Review URL: https://codereview.chromium.org/12261055

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@110 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoInline @import directives in CSS files.
joi@chromium.org [Thu, 14 Feb 2013 12:07:19 +0000 (12:07 +0000)]
Inline @import directives in CSS files.

TBR=bauerb@chromium.org
BUG=176233

Committing for bauerb@, patch from issue 12263034.

Review URL: https://codereview.chromium.org/12253029

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@109 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoandroid2grd: include non-translatable strings.
newt@chromium.org [Wed, 13 Feb 2013 17:36:29 +0000 (17:36 +0000)]
android2grd: include non-translatable strings.

This includes non-translatable strings in the output of the android2grd
tool. As expected, they're marked with translateable="false".

BUG=12

Review URL: https://codereview.chromium.org/12221163

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@108 7262f16d-afe8-6277-6482-052fa10e57b1

21 months agoMake grit support my scenario of dynamic generation of an included file.
joi@chromium.org [Fri, 1 Feb 2013 16:09:46 +0000 (16:09 +0000)]
Make grit support my scenario of dynamic generation of an included file.

This makes it possible to pass an input file path using an environment (-E)
variable that contains variables expanded at build time - e.g. $(out).

This is made more complex by the fact the path looks like $(out)/something
at the time we produce input file list, but is expanded to an absolute path
at build time.

To reliably support both scenarios, just add option to ignore the base dir.

BUG=160424

Landing for phajdan@chromium.org, original patch https://codereview.chromium.org/12095081/

Review URL: https://codereview.chromium.org/12090119

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@107 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoStable order of messages and stable choice of description.
joi@chromium.org [Thu, 24 Jan 2013 10:57:27 +0000 (10:57 +0000)]
Stable order of messages and stable choice of description.

This keeps the output of [ grit xmb ] stable between subsequent runs
with the same input data, which is great for regression testing.

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=11

Review URL: https://codereview.chromium.org/12051038

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@106 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoAllow multiple use_name_for_id messages with identical ID.
joi@chromium.org [Tue, 22 Jan 2013 19:42:32 +0000 (19:42 +0000)]
Allow multiple use_name_for_id messages with identical ID.

Normally, messages with different contents get different IDs (in the
Clique or XTB ID sense), but separate messages using use_name_for_id
may have different contents, so the assertion was incorrect.

Also in this change, unify the expression evaluation used for <if>
nodes in .xtb files with that in .grd files. This is unrelated to the
bug referenced below, but I noted that a pending patch wants to use
some of the variables previously unavailable to expressions in .xtb
files, and it makes sense to unify it. Output context and language do
not make sense when evaluating an .xtb file and hence are still only
available to expressions in .grd files.

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=8

Review URL: https://codereview.chromium.org/12036015

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@105 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoFix the regex flatting html to prevent misdetection
joi@chromium.org [Tue, 22 Jan 2013 12:36:45 +0000 (12:36 +0000)]
Fix the regex flatting html to prevent misdetection

In some case, the previous regex may mistake to detect a wrong part as a
script/link tag. This patch fixes it.

Landing for yoshiki@chromium.org, original patch at https://codereview.chromium.org/11953014/

Review URL: https://codereview.chromium.org/12036024

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@104 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoAllow users to optionally specify target OS.
joi@chromium.org [Mon, 21 Jan 2013 15:54:06 +0000 (15:54 +0000)]
Allow users to optionally specify target OS.

BUG=https://code.google.com/p/grit-i18n/issues/detail?id=10

Review URL: https://codereview.chromium.org/12048002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@103 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoSort GritSourceFiles() output.
joi@chromium.org [Thu, 17 Jan 2013 22:02:22 +0000 (22:02 +0000)]
Sort GritSourceFiles() output.

os.walk() is not guaranteed to return output in any particular order, so
Help gyp-generated build files be consistent by sorting the list of grit
source files used for dependencies, the same way the input file list is
already sorted.

BUG=

Landing this patch from torne@, originally issue 11946054.

Review URL: https://chromiumcodereview.appspot.com/11968053

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@102 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoMake grit build's -f flag relative to cwd.
newt@chromium.org [Tue, 15 Jan 2013 18:40:52 +0000 (18:40 +0000)]
Make grit build's -f flag relative to cwd.

When passing a first ids file to grit build using -f, the file path
is now given relative to the cwd, instead of the .grd's directory.
The first_ids_file attribute in the <grit> node is still specified
relative to the grd file.

Review URL: https://codereview.chromium.org/11878035

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@101 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoSupport generating English strings.xml files in android2grd.
newt@chromium.org [Fri, 4 Jan 2013 19:16:05 +0000 (19:16 +0000)]
Support generating English strings.xml files in android2grd.

English needs to be treated differently:
 - There is no xtb file containing English translations
 - The output file is values/strings.xml, not values-en/strings.xml

Review URL: https://codereview.chromium.org/11742035

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@100 7262f16d-afe8-6277-6482-052fa10e57b1

22 months agoDon't fail on ID overlap for 0th offset when 'offset' attribute is used.
joi@chromium.org [Fri, 4 Jan 2013 11:23:29 +0000 (11:23 +0000)]
Don't fail on ID overlap for 0th offset when 'offset' attribute is used.

TBR=benrg@chromium.org
BUG=none

Review URL: https://chromiumcodereview.appspot.com/11742040

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@94 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoImplement --xml-dir option to android2grd.
newt@chromium.org [Fri, 21 Dec 2012 19:17:54 +0000 (19:17 +0000)]
Implement --xml-dir option to android2grd.

The --xml-dir option to android2grd was previously a no-op. This
implements it and clarifies the meaning of several other options.

BUG=none

Review URL: https://codereview.chromium.org/11663002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@93 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoFix chrome_messages_json generator to handle <if> properly.
sergeyu@chromium.org [Thu, 13 Dec 2012 22:19:13 +0000 (22:19 +0000)]
Fix chrome_messages_json generator to handle <if> properly.

Previously chrome_messages_json formatter wasn't handling <if> properly -
it was putting all messages to the generated files, even when they are inside
of a disabled <if>.

Review URL: https://codereview.chromium.org/11549036

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@92 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoAdd UTF-8 BOM for chrome_messages_json formatter.
sergeyu@chromium.org [Thu, 13 Dec 2012 21:41:57 +0000 (21:41 +0000)]
Add UTF-8 BOM for chrome_messages_json formatter.

When uploading extension Chrome Web Store currently expects to find BOM
in UTF-8 files.

Review URL: https://codereview.chromium.org/11557029

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@91 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoGet the list of valid policy features from the feature description list.
joaodasilva@chromium.org [Mon, 10 Dec 2012 09:15:13 +0000 (09:15 +0000)]
Get the list of valid policy features from the feature description list.
Review URL: https://codereview.chromium.org/11478044

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@90 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoTurns out using sys.path[0] is incompatible with at least one build
joi@chromium.org [Fri, 7 Dec 2012 17:18:23 +0000 (17:18 +0000)]
Turns out using sys.path[0] is incompatible with at least one build
tool, where the root of the client workspace gets prepended to the
sys.path.  Switching back to appending to sys.path based on the path
of __file__.

BUG=None

Review URL: https://codereview.chromium.org/11416174

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@89 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoUse count parameter to limit splits of environment variables and defines to first...
joi@chromium.org [Fri, 7 Dec 2012 17:13:59 +0000 (17:13 +0000)]
Use count parameter to limit splits of environment variables and defines to first equal sign.

BUG=None

Review URL: https://codereview.chromium.org/11475022

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@88 7262f16d-afe8-6277-6482-052fa10e57b1

23 months agoUse -E flags in grit_info tool to modify env (previously -E was accepted but unused).
joi@chromium.org [Wed, 5 Dec 2012 09:57:03 +0000 (09:57 +0000)]
Use -E flags in grit_info tool to modify env (previously -E was accepted but unused).

TBR=phajdan.jr@chromium.org
BUG=None

Review URL: https://codereview.chromium.org/11445012

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@87 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agogit-svn-id: http://grit-i18n.googlecode.com/svn/trunk@86 7262f16d-afe8-6277-6482...
joaodasilva@chromium.org [Tue, 20 Nov 2012 15:15:48 +0000 (15:15 +0000)]
git-svn-id: grit-i18n.googlecode.com/svn/trunk@86 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoRemove shbang line from PRESUBMIT.py.
joi@chromium.org [Tue, 20 Nov 2012 11:06:02 +0000 (11:06 +0000)]
Remove shbang line from PRESUBMIT.py.

This make checkperms happy. PRESUBMIT.py has no main
function so it doesn't make sense to have a #!.

Patch contributed by sbc@chromium.org

BUG=none

Review URL: https://codereview.chromium.org/11418086

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@85 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoFix grit to substitute GRIT_DIR properly on Windows.
sergeyu@chromium.org [Mon, 5 Nov 2012 19:00:37 +0000 (19:00 +0000)]
Fix grit to substitute GRIT_DIR properly on Windows.

Previously GRIT_DIR was replaced with the current path only when it's
followed by forward slash. GYP msvs generator replaces forward slashes
with back slashes which breaks GRIT_DIR substitution. Fixed GRIT_DIR
processing code to handle the case when GRIT_DIR is followed by back
slash.

Review URL: https://codereview.chromium.org/11312072

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@84 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoAdd custom chunks after IHDR chunk so that the PNG remains valid
flackr@chromium.org [Fri, 2 Nov 2012 15:10:08 +0000 (15:10 +0000)]
Add custom chunks after IHDR chunk so that the PNG remains valid

Adding custom chunks before the IHDR chunks makes the PNG invalid. This
necessitates extra logic in Chrome to extract custom chunks from 'image data'
read from the data packs and can lead to subtle bugs such as crbug.com/157192
Adding the custom chunks after the IHDR keeps the PNG valid and avoids having
to do extra parsing in places where we don't care about these extra chunks.

Patch by: pkotwicz@chromium.org

BUG=chromium:158827
Test=None
Review URL: https://chromiumcodereview.appspot.com/11358029

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@83 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoPrint missing translation warnings when verbose output is set.
tony@chromium.org [Mon, 22 Oct 2012 21:14:20 +0000 (21:14 +0000)]
Print missing translation warnings when verbose output is set.

Previously, we would only print missing translation warnings if
_google_chrome was set.  This makes the warnings more general.

Also, remove an import for a file that was removed in r79.

BUG=None
Review URL: https://codereview.chromium.org/11229039

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@82 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoEnable running [ grit build ] in changed context without modifying .grd files.
joi@chromium.org [Mon, 22 Oct 2012 09:35:18 +0000 (09:35 +0000)]
Enable running [ grit build ] in changed context without modifying .grd files.

This is currently useful for the internal regression tests, and both
changes should be useful in general.

The two situations this tackles are:

a) Running [ grit build ] from a copy of the .grd file, where the
   relative path to translations is different.  For this, being able
   to have environment variables expanded in paths is useful.

b) Running [ grit build ] on a .grd file that uses 'run_command'
   attributes where the command is platform-specific.  The added
   'run_command_on_platforms' attribute allows limiting the command to
   run only on certain platforms when needed.

BUG=none

Review URL: https://codereview.chromium.org/11235004

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@81 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoIf-then-else support for GRIT
benrg@chromium.org [Fri, 19 Oct 2012 18:11:48 +0000 (18:11 +0000)]
If-then-else support for GRIT

This adds a new syntax, <if><then>...</then><else>...</else></if>, with the semantics you'd expect. The <if>...</if> syntax is still supported.

BUG=145118
TEST=new unit test

Review URL: https://codereview.chromium.org/11155024

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@80 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoGRIT formatter overhaul
benrg@chromium.org [Fri, 19 Oct 2012 17:31:48 +0000 (17:31 +0000)]
GRIT formatter overhaul

Before this change, there was a formatter per node type per output type (for example, the formatter for <include> nodes in 'rc_header' produced text like "#define SYMBOL 1234\n"). After this change, there is one formatter per output type, which receives the root node as an argument and does its own iteration over the tree. This enables various other internal simplifications.

Visible changes:

* IDs should now be consistent across all builds. This means that maximum ID numbers may be higher if there are, e.g., symbols included only in Mac builds and others included only in Windows builds. They may also be smaller if the same symbol is defined differently in different builds, since this no longer leads to duplicate IDs being assigned.

* resource_map used to write duplicate entries to the output files; it doesn't any more.

* Functions in data_pack.DataPack.* are now in data_pack.*. The old location is temporarily supported, but external tools that use it should be changed.

* grit unit was missing some unit tests; it now runs all (?) of them.

BUG=none
TEST=grit unit and similar-enough outputs on the Chrome tree

Review URL: https://codereview.chromium.org/11154003

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@79 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoPNG chunk handling in the chrome_scaled_image gatherer:
benrg@chromium.org [Wed, 17 Oct 2012 17:45:46 +0000 (17:45 +0000)]
PNG chunk handling in the chrome_scaled_image gatherer:

1. Add a custom "csCl" PNG chunk to scale-fallback images.

2. Move custom chunks to the beginning of the data, where we detect them by hand in resource_bundle.

3. Drop ancillary chunks not on our whitelist (see bug 146632 for the reason).

BUG=153892, 146632
TEST=grit unit, issue 11028064

Review URL: https://codereview.chromium.org/11065043

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@78 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoAdd support for messages.json format used to localize Chrome extensions.
sergeyu@chromium.org [Tue, 16 Oct 2012 18:19:26 +0000 (18:19 +0000)]
Add support for messages.json format used to localize Chrome extensions.

Chrome uses JSON format for extension and webapps localization. This change
adds new output format chrome_messages_json. It will be used to generate
resrouces for Chrome Remote Desktop webapp.

Review URL: https://codereview.chromium.org/11152002

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@77 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoAdd a .gitignore file for *.pyc files, so git 1.7 doesn't complain about dirty submodules
jochen@chromium.org [Mon, 15 Oct 2012 10:43:09 +0000 (10:43 +0000)]
Add a .gitignore file for *.pyc files, so git 1.7 doesn't complain about dirty submodules

BUG=none
Review URL: https://codereview.chromium.org/11154009

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@76 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoAllow to specify resources_ids file in grit_info.py.
joi@chromium.org [Thu, 11 Oct 2012 11:18:02 +0000 (11:18 +0000)]
Allow to specify resources_ids file in grit_info.py.

Previously location of resources_ids was hard-coded in grit_info.py.

Landing for sergeyu@chromium.org, original patch at
http://codereview.chromium.org/11085048/

BUG=none

Review URL: https://codereview.chromium.org/11087075

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@75 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoFix <part>-related bugs in grit_info
benrg@chromium.org [Wed, 10 Oct 2012 19:02:29 +0000 (19:02 +0000)]
Fix <part>-related bugs in grit_info

grit_info ignored <messages> when calculating dependencies, but <messages> can now contain <part> which needs to be included. Make it ignore <message> instead. This caused bug 155068.

Also, the part file path was resolved relative to the base_dir instead of the directory containing the grd file, but this doesn't affect generated_resources.grd because it has base_dir=".".

BUG=155068

Review URL: https://codereview.chromium.org/11088055

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@74 7262f16d-afe8-6277-6482-052fa10e57b1

2 years agoAllow including grd files from other grd files with <part file="sub.grp"/>
benrg@chromium.org [Fri, 5 Oct 2012 18:24:36 +0000 (18:24 +0000)]
Allow including grd files from other grd files with <part file="sub.grp"/>

The top-level element of included files must be <grit-part>. Subelements of <grit-part> behave as though they were spliced in at the location of the <part> node in the including file. The extension ".grp" is suggested for included files.

Included files have to be in the same directory as the parent, to avoid complications related to relative paths.

<part> nodes are allowed in the same places as <if> nodes. This may be too restrictive.

BUG=142381
TEST=new unit tests

Review URL: https://codereview.chromium.org/11046013

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@73 7262f16d-afe8-6277-6482-052fa10e57b1