external/grit-i18n.git
2 days agoFix processing newline on Windows chrome_html_unittests. master
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

3 days 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

4 days 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

3 weeks 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

3 weeks 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

3 weeks 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

4 weeks 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

2 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

2 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

2 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

2 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

2 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

4 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

4 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

4 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

4 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

5 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

5 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

5 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

5 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

5 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

5 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

5 months 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

5 months 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

6 months 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

6 months 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

6 months 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

6 months 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

6 months 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

6 months 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

7 months 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

7 months 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

7 months 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

7 months 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

7 months 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

7 months 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

7 months agoRemove copyright notices from generated files and PrintUsage()
benrg@chromium.org [Tue, 2 Oct 2012 16:22:03 +0000 (16:22 +0000)]
Remove copyright notices from generated files and PrintUsage()

BUG=None
TEST=grit unit

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

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

7 months agoChange the default max value for integer policies for ADM and ADMX templates.
pastarmovj@chromium.org [Thu, 27 Sep 2012 15:26:30 +0000 (15:26 +0000)]
Change the default max value for integer policies for ADM and ADMX templates.

If not specified ADM and ADMX templates set the max value for integer policies
to 9999 which is far from useful for policies because those often represent
values that are in milliseconds or bytes so large values are quite common.

Ideally we can specify the bounds for every policy but until then we can at least
provide useful default upper bound of 2*10^9.

BUG=chromium:152660
TEST=writer unit tests pass.
Review URL: https://codereview.chromium.org/10984066

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

7 months agoFix adml_writer_unittest.py to pass both on Lucid and Precise.
pastarmovj@chromium.org [Thu, 27 Sep 2012 15:25:31 +0000 (15:25 +0000)]
Fix adml_writer_unittest.py to pass both on Lucid and Precise.

In Python 2.7 a bug in dom.xml.minixml.toprettyxml() has been fixed that changes
the way strings are formatted removing indentation for them. This breaks our adml
tests. This change adds a hack to allow both Precise and Lucid to pass. The hack
can be removed once we phase Lucid completely off.

BUG=7
TEST=adml and admx tests pass.
Review URL: https://codereview.chromium.org/10982066

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

7 months agoInclude all recursively inlined includes in GetResourceFilenames.
flackr@chromium.org [Thu, 27 Sep 2012 15:25:30 +0000 (15:25 +0000)]
Include all recursively inlined includes in GetResourceFilenames.

BUG=chromium:152425
TEST=html_inline.testGetResourceFilenames
Review URL: https://chromiumcodereview.appspot.com/10993060

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

8 months agoAdd more unit tests for android2grd
cjhopman@chromium.org [Fri, 31 Aug 2012 21:14:56 +0000 (21:14 +0000)]
Add more unit tests for android2grd

BUG=137299

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

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

9 months agoFix sys.path handling in repack.py to fix build (failed at least with Ninja on Linux).
joi@chromium.org [Fri, 3 Aug 2012 14:46:35 +0000 (14:46 +0000)]
Fix sys.path handling in repack.py to fix build (failed at least with Ninja on Linux).

TBR=benrg@chromium.org
BUG=138752

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

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

9 months agoFix license header for android2grd.py
joi@chromium.org [Thu, 2 Aug 2012 10:06:50 +0000 (10:06 +0000)]
Fix license header for android2grd.py

See http://code.google.com/p/grit-i18n/source/detail?spec=svn63&r=57

BUG=138921

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

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

9 months agoAlways use an absolute path when munging sys.path
benrg@chromium.org [Tue, 31 Jul 2012 16:34:03 +0000 (16:34 +0000)]
Always use an absolute path when munging sys.path

It's safer in general and fixes a bug (see bug for details).

Some individually runnable files failed before this change and still fail with the same message after it:

   grit/format/rc_header_unittest.py
   grit/node/io_unittest.py
   grit/node/message_unittest.py
   grit/node/structure_unittest.py
   grit/pseudo_unittest.py
   grit/util_unittest.py

BUG=138752
TEST=Grit unit and run each affected file individually without arguments

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

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

9 months agoCall CheckConditionalElements before inlining scripts, CSS and include files
joi@chromium.org [Tue, 31 Jul 2012 15:41:31 +0000 (15:41 +0000)]
Call CheckConditionalElements before inlining scripts, CSS and include files
(i.e., before calling InlineScript, InlineCSSFile, and InlineIncludeFiles) in
order to exclude any files whose text would be filtered out anyway.

We still call CheckConditionalElements a second time to exclude text from
those files which were included by the aforementioned methods.

For example, given HTML such as:

  <if expr="pp_ifdef('android')">
    <link rel="stylesheet" href="about_version_android.css">
  </if>

html_inline would have previously included this CSS, then thrown
out its text. After this change about_version_android.css won't
be processed at all.

This fixes an issue where if the included css itself includes
items that may not exist given the defines, GRIT would error
out trying to inline the file that would eventually be excluded.
For example, about_version_android.css may have:

  #logo-img {
    /* Android does not support themes and can not use IDR_PRODUCT_LOGO. */
    content:
        url(../../app/theme/default_100_percent/%DISTRIBUTION%/product_logo.png);
  }

That file might not exist for certain definitions of %DISTRIBUTION%, but there
was previously no way to exclude it soon enough.

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

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

9 months agoRefactor chrome_html and add conversion of img tags.
flackr@chromium.org [Thu, 26 Jul 2012 15:03:31 +0000 (15:03 +0000)]
Refactor chrome_html and add conversion of img tags.

Adds a style attribute to <img> tags which don't contain a style (for safety)
giving them available high dpi image assets automatically. We preserve the
src in case this is referenced in script. Additionally this changes inlining
and image-set conversions to preserve the type of quotation used.

BUG=chromium:135179, chromium:135779
TEST=ChromeHtmlUnittest.testFileResourcesImageTag
Review URL: https://chromiumcodereview.appspot.com/10824026

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

9 months agoAccept CSS url()s without quotes.
newt@chromium.org [Wed, 25 Jul 2012 21:58:59 +0000 (21:58 +0000)]
Accept CSS url()s without quotes.

This inlines images in the CSS url() function, even if the image name
is not surrounded by quotes.  e.g. url(test.png) is now treated like
url('test.png').  The Google CSS style guide recommends using url()
without quotes, and this allows us to follow that style.

BUG=https://code.google.com/p/chromium/issues/detail?id=138849

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

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

9 months agoFix output encoding issue encountered in some versions of Python.
joi@chromium.org [Tue, 24 Jul 2012 16:44:13 +0000 (16:44 +0000)]
Fix output encoding issue encountered in some versions of Python.

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

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

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

9 months agoA bugfix for substitutions and a tweak in command-line processing.
joi@chromium.org [Mon, 23 Jul 2012 18:11:48 +0000 (18:11 +0000)]
A bugfix for substitutions and a tweak in command-line processing.

The bug was discovered while switching a Google-internal project over
to grit-i18n from the older internal branch.  The tweak helps minimize
adaptation of internal scripts (as you can see the new flag is ignored
by grit-i18n).

BUG=http://code.google.com/p/grit-i18n/issues/detail?id=4
Review URL: https://chromiumcodereview.appspot.com/10796090

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

9 months agoWhen looking up a file in the first IDs list, and the file is outside of the tree...
jochen@chromium.org [Mon, 23 Jul 2012 13:27:17 +0000 (13:27 +0000)]
When looking up a file in the first IDs list, and the file is outside of the tree starting at SRCDIR, just use the filename as key

BUG=none
TEST=building content_shell from within WebKit works for Release mode
Review URL: https://chromiumcodereview.appspot.com/10800072

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

10 months agoAdd tools to process Android's strings.xml files.
newt@chromium.org [Fri, 13 Jul 2012 20:56:58 +0000 (20:56 +0000)]
Add tools to process Android's strings.xml files.

This adds android2grd to convert from Android's strings.xml format to
the .grd format. This also adds android_xml.py to build Android-style
strings.xml files from a .grd file with translations.

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

10 months agoEncode chrome_html output using utf-8.
flackr@chromium.org [Thu, 12 Jul 2012 14:17:49 +0000 (14:17 +0000)]
Encode chrome_html output using utf-8.

BUG=chromium:136389
TEST=NTP page character 8249 is preserved correctly. grit.py unit passes.
Review URL: https://chromiumcodereview.appspot.com/10689160

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

10 months agochrome_html resources should be BINDATA, not HTML
flackr@chromium.org [Tue, 3 Jul 2012 13:47:40 +0000 (13:47 +0000)]
chrome_html resources should be BINDATA, not HTML

Chrome only looks at BINDATA when loading resources. Patch from thakis@chromium.org.

BUG=chromium:134988
TEST=about:memory works again on windows.
Review URL: https://chromiumcodereview.appspot.com/10702075

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

10 months agoFix bug in chrome-scaled-image error reporting
benrg@chromium.org [Mon, 2 Jul 2012 20:14:21 +0000 (20:14 +0000)]
Fix bug in chrome-scaled-image error reporting

The reporting of missing files was broken (see issue 10704053).

BUG=None
TEST=Added a regression test

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

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

10 months agoMisc Grit cleanup/modernization
benrg@chromium.org [Mon, 2 Jul 2012 18:01:00 +0000 (18:01 +0000)]
Misc Grit cleanup/modernization

- Use Python 2.6 features where useful: @decorators, with statements, "x if b else y", "open" (since "file" is deprecated).

- Use codecs.open when the mode is 'rb' or 'wb', but not when it's 'r' or 'w' (because codecs.open only supports binary mode). We should figure out what to do about the remaining cases later.

- Use super() everywhere. Don't use super(type(self), self) since it's only correct when type(self) is always the current class (i.e., when it's a leaf class). Also remove __init__ methods that do nothing but forward.

- Introduce a new function in util for reading the entire contents of an input file.

- Remove special support for encodings ending in "-sig" from node/structure.py. It's not used in any grd file, and utf-8-sig is a built-in codec starting with Python 2.5.

- Remove unused imports.

- Remove a local unit test hack that I accidentally checked in.

BUG=None
TEST=grit unit on Linux and Windows, Chrome build

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

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

10 months agoAllow chrome_html resources for rc outputs and flatten appropriately.
flackr@chromium.org [Wed, 27 Jun 2012 19:25:41 +0000 (19:25 +0000)]
Allow chrome_html resources for rc outputs and flatten appropriately.

BUG=chromium:134796
TEST=testChromeHtmlNodeOutputfile
Review URL: https://chromiumcodereview.appspot.com/10693006

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

11 months agoSupport for output contexts and "chrome_scaled_image" structure type
benrg@chromium.org [Sat, 16 Jun 2012 20:30:41 +0000 (20:30 +0000)]
Support for output contexts and "chrome_scaled_image" structure type

BUG=131216
TEST=Identical Chrome build outputs before and after

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

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

11 months agoFix XMB output of leading/trailing whitespace.
joi@chromium.org [Fri, 15 Jun 2012 15:27:48 +0000 (15:27 +0000)]
Fix XMB output of leading/trailing whitespace.

Fix assertion, to correctly deal with placeholder-only messages.

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

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

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

11 months agoAdd [grit xmb] tool, and the ability to switch FP implementations.
joi@chromium.org [Wed, 13 Jun 2012 11:19:45 +0000 (11:19 +0000)]
Add [grit xmb] tool, and the ability to switch FP implementations.

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

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

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

11 months agoChange language logic in GetInputFiles
benrg@chromium.org [Tue, 12 Jun 2012 20:39:05 +0000 (20:39 +0000)]
Change language logic in GetInputFiles

BUG=None
TEST=grit unit, identical grit_info.py output on all .grd files in the Chromium tree

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

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

11 months agoReplace SetOutputContext with SetOutputLanguage in GritNode
benrg@chromium.org [Tue, 12 Jun 2012 18:12:16 +0000 (18:12 +0000)]
Replace SetOutputContext with SetOutputLanguage in GritNode

I am about to add a new attribute called "context" to output tags, so the old
method name will be confusing. Unlike the language, the defines don't change
within a single run (except in unit tests), so it's not necessary to set them
every time the language is changed. There is already a SetDefines() method.

There appears to have been a bug in the old code: when SetOutputContext() was
called more than once with different defines, the substituter was updated with
the new substitutions instead of being cleared and recreated. The new code
recreates it from scratch.

It might be possible (and better?) to get rid of SetDefines() and always pass
the defines as a parameter on creation, or even place the defines in a global
variable or singleton (like sys.platform, which is used in a similar way in
the code).

BUG=None
TEST=Unit tests, rebuilt Chrome

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

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

11 months agoProduce a list of structure inputs for flattened structure nodes.
flackr@chromium.org [Fri, 8 Jun 2012 14:05:53 +0000 (14:05 +0000)]
Produce a list of structure inputs for flattened structure nodes.

BUG=chromium:131483
TEST=All tests pass. Run grit_info.py --inputs on a grd containing a structure type="chrome_html" with flattenhtml="true" and verify that all flattened files are listed.
Review URL: https://chromiumcodereview.appspot.com/10536057

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

11 months agoPass grd node to structure gatherers to allow evaluating expressions. (Reland)
flackr@chromium.org [Thu, 31 May 2012 00:20:04 +0000 (00:20 +0000)]
Pass grd node to structure gatherers to allow evaluating expressions. (Reland)

BUG=chromium:130124
TEST=Manual, conditions in chromium evaluate successfully.
Review URL: https://chromiumcodereview.appspot.com/10459024

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

11 months agoAdd allowexternalscript and flattenhtml attributes to chrome_html.
flackr@chromium.org [Thu, 31 May 2012 00:08:53 +0000 (00:08 +0000)]
Add allowexternalscript and flattenhtml attributes to chrome_html.

We use these attribute in Chrome WebUI includes and need to support continuing to pass allowexternalscript to HtmlInline and not flattening where desired.

BUG=chromium:130124
TEST=ChromeHtmlUnittest.* passes, manually tested allowexternalscript attribute value is passed.
Review URL: https://chromiumcodereview.appspot.com/10448062/

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

11 months agoAllow generating resource maps from structure nodes.
flackr@chromium.org [Thu, 31 May 2012 00:03:41 +0000 (00:03 +0000)]
Allow generating resource maps from structure nodes.

BUG=chromium:130124
TEST=Manual, add output type="resource_file_map_source" with chrome_html structure nodes and verify that the output file contains a source listing.
Review URL: https://chromiumcodereview.appspot.com/10448076

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

11 months agoPass grd node to structure gatherers to allow evaluating expressions.
flackr@chromium.org [Wed, 30 May 2012 23:58:59 +0000 (23:58 +0000)]
Pass grd node to structure gatherers to allow evaluating expressions.

BUG=chromium:130124
TEST=Manual, conditions in chromium evaluate successfully.
Review URL: https://chromiumcodereview.appspot.com/10459024

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

11 months agoRemove image-set images for unsupported scale factors in chrome_html structures.
flackr@chromium.org [Wed, 30 May 2012 13:42:16 +0000 (13:42 +0000)]
Remove image-set images for unsupported scale factors in chrome_html structures.

BUG=chromium:130087
TEST=ChromeHtmlUnitTest.testRemoveUnsupportedScale
Review URL: https://chromiumcodereview.appspot.com/10456015

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

11 months agoAdd chrome_html gatherer which inlines html and generates CSS image sets.
flackr@chromium.org [Fri, 25 May 2012 16:00:13 +0000 (16:00 +0000)]
Add chrome_html gatherer which inlines html and generates CSS image sets.

Add missing files from previous commit.

BUG=chromium:125315
TEST=All unittests still pass, chrome_html_unittest
Review URL: https://chromiumcodereview.appspot.com/10386189

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

11 months agoAdd chrome_html gatherer which inlines html and generates CSS image sets.
flackr@chromium.org [Fri, 25 May 2012 15:11:47 +0000 (15:11 +0000)]
Add chrome_html gatherer which inlines html and generates CSS image sets.

In Chromium we want to have high DPI assets in WebUI dependent on the platform
on which we are compiling. To accomplish this we will specify the set of scale
factors and search for matching image names in bottom-level directories.

BUG=chromium:125315
TEST=All unittests still pass, chrome_html_unittest
Review URL: https://chromiumcodereview.appspot.com/10386189

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

11 months agoAdd a few language codes for Windows.
joi@chromium.org [Tue, 22 May 2012 12:16:52 +0000 (12:16 +0000)]
Add a few language codes for Windows.

Patch submitted by Haicheng Sun <haicsun@google.com>
Review URL: https://chromiumcodereview.appspot.com/10414045

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

12 months agoAdd support for dictionary policies to grit.
joaodasilva@chromium.org [Mon, 7 May 2012 13:58:14 +0000 (13:58 +0000)]
Add support for dictionary policies to grit.

BUG=108994,108995,108996
TEST=All unittests still pass
Review URL: https://chromiumcodereview.appspot.com/10302014

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

12 months agoFixed bug in string splitting regex when it contains a tag that is a valid substring...
joaodasilva@chromium.org [Wed, 2 May 2012 15:26:14 +0000 (15:26 +0000)]
Fixed bug in string splitting regex when it contains a tag that is a valid substring of another tag.

BUG=http://code.google.com/p/grit-i18n/issues/detail?id=5
TEST=build policy_templates works
Review URL: https://chromiumcodereview.appspot.com/10316006

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

12 months agoRedact the word 'error' from messages shown in grit's output.
joi@chromium.org [Wed, 18 Apr 2012 17:02:06 +0000 (17:02 +0000)]
Redact the word 'error' from messages shown in grit's output.

This avoids issues with some build environments considering the tool
to have failed if it prints this text.

Patch by grt@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10035030

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

13 months agoFixed admx policy template generate on Chrome builds.
joaodasilva@chromium.org [Mon, 16 Apr 2012 09:15:41 +0000 (09:15 +0000)]
Fixed admx policy template generate on Chrome builds.

BUG=121700
TEST=admx templates doesn't have a duplicate 'google' category
Review URL: https://chromiumcodereview.appspot.com/9950130

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

13 months agoAdd SCons integration for [ grit build ] tool (inputs and outputs).
joi@chromium.org [Tue, 3 Apr 2012 17:11:36 +0000 (17:11 +0000)]
Add SCons integration for [ grit build ] tool (inputs and outputs).

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

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

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

13 months agoSkip output of resource defines (in resource header) if the resources
joi@chromium.org [Tue, 3 Apr 2012 16:58:23 +0000 (16:58 +0000)]
Skip output of resource defines (in resource header) if the resources
they refer to are not being output. This is to cause a build break if
code references resources that are not available.  Original author
David Dorwin.

NOTE: An addition made in this change to the above merged feature
makes it conditional on an attribute on the <grit> node, and turns it
off by default.

Make variable expansion more uniform.  Original author Vitaly Buka.

Update URLs for LCID and codepage resources.  Original author Tim
Haloun.

Fix typo in format string.  Original author Daniel Cheng.

Add a number of well-known resources.  Original author Thais Melo.

This was a manual merge of changes released to the Google-internal
branch of GRIT on 2010/01/13, 2010/02/26, 2010/09/01, 2011/09/16 and
2012/02/13.  Original authors as named above.

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

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

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

13 months agoAdd a buildinfo tool to GRIT.
joi@chromium.org [Tue, 3 Apr 2012 16:56:26 +0000 (16:56 +0000)]
Add a buildinfo tool to GRIT.

This lets build systems can ask GRIT what it is going to generate before it generates it, and what upstream dependencies that output will have.

This is a manual merge of changes committed 2009/01/15, 2009/06/04, 2009/06/08, 2009/08/07 and 2009/11/10 to the Google-internal branch of grit.  The original author of the tool was Greg Spencer, with several bugfixes and enhancements subsequently submitted by Vitaly Buka.

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

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

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

13 months agoFixing a bug in GRIT where messages with substitutions would
joi@chromium.org [Tue, 3 Apr 2012 10:15:24 +0000 (10:15 +0000)]
Fixing a bug in GRIT where messages with substitutions would
not get matched with their translations.

Also adding a catch-all so that messages containing only
whitespace do not get sent to the Translation Console.

Also, fix relative paths so unit tests can be run directly.

This is a manual merge of changes released 2008/09/02 to the
Google-internal version of grit.  Original author Joi Sigurdsson.

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

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

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

13 months agoAdd support for <\!--message-no-break--> in tr_html, causing the next
joi@chromium.org [Tue, 3 Apr 2012 10:14:23 +0000 (10:14 +0000)]
Add support for <\!--message-no-break--> in tr_html, causing the next
normally-splitting entity to not split translatable sections.

This is a manual merge of a change released 2008/08/13 to the internal
branch. Original author Lucas Eckels.

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

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

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

13 months agoAllow IfNode nesting in _IsValidChild.
joi@chromium.org [Tue, 3 Apr 2012 10:13:23 +0000 (10:13 +0000)]
Allow IfNode nesting in _IsValidChild.

This is a manual merge of a change released to the internal branch on
2008/07/30. Original author Marc-Antoine Parent.

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

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

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

13 months agoAllow duplicate Ids for a field that does not generate them in the resource header...
joi@chromium.org [Tue, 3 Apr 2012 10:12:11 +0000 (10:12 +0000)]
Allow duplicate Ids for a field that does not generate them in the resource header. Allow to define system ids in the identifiers elements. Make it easier to add system identifers. Add URLs for language resources.

This is a manual merge of changes released to the internal branch on 2008/6/13.  Original authors Marc-Antoine Parent and David Dorwin.

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

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

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

13 months agoAllow substitution of messages as variables in other messages.
joi@chromium.org [Tue, 3 Apr 2012 10:10:53 +0000 (10:10 +0000)]
Allow substitution of messages as variables in other messages.

This is part of a manual merge of changes released to the internal branch 2008/06/11.  Original author is Marc-Antoine Parent.

In addition to the merge, bring in all language directive mappings and codepage mappings from the latest internal version of grit to avoid warnings related to unknown output languages.  While updating the mapping, fix the name of the fake-bidi language.  Finally, to help debug differences in data_pack files, add a simple ASCII converter to data_pack.py

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

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

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

13 months agoAdd encoding to MuppetStrings. rc2grd improvements. Language charset/directive improv...
joi@chromium.org [Tue, 3 Apr 2012 10:08:43 +0000 (10:08 +0000)]
Add encoding to MuppetStrings. rc2grd improvements. Language charset/directive improvements. Fix for <if> nodes.

This is a merge of internal changes released 2007/12/01, 2008/02/19, 2008/03/03 and 2008/04/29.  Original authors Joi Sigurdsson, Marc-Antoine Parent, Stefan Kuhne, Vivek Rao and Xiyuan Xia.

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

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

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

13 months agoIntroduce the ability to run post-translation commands on structures,
joi@chromium.org [Tue, 3 Apr 2012 10:07:45 +0000 (10:07 +0000)]
Introduce the ability to run post-translation commands on structures,
to allow for things like html tidy.

Add support for XML files for the igoogle type of muppet gadgets.

This is a merge of a internal changes released 2007/11/20.  Original
changes by Jon Perkins and Rajesh Chandrashekaran.

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

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

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

13 months agoMake sure path to resource_ids file is relative. An earlier change git-svn
joi@chromium.org [Fri, 30 Mar 2012 11:42:03 +0000 (11:42 +0000)]
Make sure path to resource_ids file is relative.  An earlier change
that made the path absolute caused some Mac bots to barf on update.

BUG=none

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

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

13 months agoWhitespace folding for descriptions and optionally for HTML.
joi@chromium.org [Fri, 30 Mar 2012 10:06:23 +0000 (10:06 +0000)]
Whitespace folding for descriptions and optionally for HTML.

This is a merge of an internal changes released 2007/10/04.  Original
contributors Jon Perkins and Joi Sigurdsson.

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

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

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

13 months agoImprove <if> node handling, unit tests. Add Psyco support. Add ability
joi@chromium.org [Fri, 30 Mar 2012 10:05:23 +0000 (10:05 +0000)]
Improve <if> node handling, unit tests. Add Psyco support. Add ability
to specify that a given include file is generated by a build step,
which may be used by some dependency analyzers to locate the file in
the build output directory.

This is a merge of internal changes from 2007/09/26, 2007/09/30, and
2007/10/02.  Original contributors Jon Perkins and Joi Sigurdsson.

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

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

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

13 months agoAdd c_format as a format option.
joi@chromium.org [Fri, 30 Mar 2012 10:03:04 +0000 (10:03 +0000)]
Add c_format as a format option.

This is a merge of an internal change from 2007/09/21, original
contributor Brandon Farrell.

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

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

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

13 months agoMake first_ids_file an optional attribute of the .grd file.
joi@chromium.org [Thu, 29 Mar 2012 11:36:23 +0000 (11:36 +0000)]
Make first_ids_file an optional attribute of the .grd file.

Remove the default path for resource_ids; the default now is no first
IDs file.  This is part of unbranching grit, since I believe Chrome is
the only project to use a first_ids file.

To resolve landing sequence requirements, this change leaves the
default path in grit_info.py and allows overriding the path via a flag
to grit build, but once a WebKit-side change to WebKit.grd has landed,
both of these can be removed and the only way to specify a first_ids
file will be via each .grd file.

BUG=http://code.google.com/p/grit-i18n/issues/detail?id=4
Review URL: https://chromiumcodereview.appspot.com/9802029

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

13 months agoRecursively flatten html files.
joi@chromium.org [Fri, 23 Mar 2012 14:55:09 +0000 (14:55 +0000)]
Recursively flatten html files.

Committing for estade@chromium.org
Review URL https://chromiumcodereview.appspot.com/9766002/

M    grit/format/html_inline.py

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

14 months agoMake GRIT require Python 2.6 or later.
joi@chromium.org [Tue, 6 Mar 2012 14:05:47 +0000 (14:05 +0000)]
Make GRIT require Python 2.6 or later.

Add checks to grit_runner.py and grit_info.py to verify the version of
Python.

Remove code in grit_info.py to support Python 2.5.

Remove shebang lines that reference a specific Python version, and switch all shebang lines to be [ #!/usr/bin/env python ].

Fix copyright header for grit/node/custom/__init__.py (this part of the patch submitted by steveblock@chromium.org).

Update copyright year on touched files.
Review URL: https://chromiumcodereview.appspot.com/9605011

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