Resolving duplicate ids issue while generating xmb file

17 views
Skip to first unread message

Viatcheslav Gachkaylo

unread,
Mar 25, 2013, 6:16:47 AM3/25/13
to grit-...@googlegroups.com
I'm generating an .xmb file from chromium sources chrome/app/generated_resources.grd. I run the following command with the following error:
How do I resolve this?

~/dev/grit-i18n$ python grit.py -i ../houseoflife/generated_resources.grd xmb -D use_titlecase -
D remoting -D enable_extensions -D enable_themes -D scale_factors=2x -D _chromium ../houseoflife/generated_resour
ces.xmb
parse exception: run GRIT with the -x flag to debug .grd problems
Traceback (most recent call last):
  File "grit.py", line 15, in <module>
    grit.grit_runner.Main(sys.argv[1:])
  File "/Users/admin/dev/grit-i18n/grit/grit_runner.py", line 268, in Main
    toolobject.Run(options, args[1:])
  File "/Users/admin/dev/grit-i18n/grit/tool/xmb.py", line 199, in Run
    res_tree = grd_reader.Parse(opts.input, debug=opts.extra_verbose)
  File "/Users/admin/dev/grit-i18n/grit/grd_reader.py", line 180, in Parse
    xml.sax.parse(filename_or_stream, handler)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/__init__.py", line 33, in parse
    parser.parse(source)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/sax/expatreader.py", line 304, in end_element
    self._cont_handler.endElement(name)
  File "/Users/admin/dev/grit-i18n/grit/grd_reader.py", line 93, in endElement
    self.stack.pop().EndParsing()
  File "/Users/admin/dev/grit-i18n/grit/node/misc.py", line 209, in EndParsing
    self.ValidateUniqueIds()
  File "/Users/admin/dev/grit-i18n/grit/node/misc.py", line 242, in ValidateUniqueIds
    raise exception.DuplicateKey(', '.join(duplicate_names))
grit.exception.DuplicateKey: A duplicate key attribute was found.: IDS_CONTENT_CONTEXT_PASTE, IDS_CONTENT_CONTEXT_SPELLCHECK_MENU, IDS_PASTE

Viatcheslav Gachkaylo

unread,
Mar 25, 2013, 6:53:05 AM3/25/13
to grit-...@googlegroups.com
Seems like it's working fine with the Chromium's repo grit code. However I would like to manually select the platform (is_win, is_macosx) to generate the .xmb file for. How can I do that?

Jói Sigurðsson

unread,
Apr 3, 2013, 10:35:25 AM4/3/13
to grit-...@googlegroups.com
The [ grit build ] tool has a -t parameter for overriding the target
platform. This was never added to the [ grit xmb ] tool as nobody
needed it yet. See grit/tool/build.py and search for -t to see how
it's implemented. If you'd like to submit a patch to add the same flag
to [ grit xmb ] I would be happy to review it.

Cheers,
Jói
> --
> You received this message because you are subscribed to the Google Groups
> "grit-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grit-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages