~chromium-team/chromium-browser/translations-pump

« back to all changes in this revision

Viewing changes to fileformats/gettext.py

  • Committer: Chad MILLER
  • Date: 2015-10-19 18:42:18 UTC
  • Revision ID: chad.miller@canonical.com-20151019184218-benco7vjulfva1lc
.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    r"""Used to sort .items of txln_info pairs so gettext output files are
10
10
    consistently ordered.
11
11
 
12
 
    >>> gettext_file_sorting_function(("s", {"langs":{"l":["1","2"]}, "refs":[{"file":"f1"},{"file":"f2"}]}))
 
12
    >>> gettext_file_sorting_function(("s", {"langs":{"l":["1","2"]}, "refs":[{"grdfile":"f1"},{"grdfile":"f2"}]}))
13
13
    (('f1', 'f2'), 's')
14
 
    >>> gettext_file_sorting_function(("s", {"refs":[{"file":"f1"},{"file":"f2"}]}))
 
14
    >>> gettext_file_sorting_function(("s", {"refs":[{"grdfile":"f1"},{"grdfile":"f2"}]}))
15
15
    (('f1', 'f2'), 's')
16
16
    >>> gettext_file_sorting_function(("s", {"langs":{"l":["1","2"]}, "refs":[]}))
17
17
    ((), 's')
18
18
    >>> gettext_file_sorting_function(("s", {"langs":{"l":["1","2"]},}))
19
19
    ((), 's')
20
20
    """
21
 
    return tuple([tuple(sorted(r["file"] for r in item[1].get("refs", []))), item[0]])
 
21
    return tuple([tuple(sorted(r["grdfile"] for r in item[1].get("refs", []))), item[0]])
22
22
 
23
23
 
24
24
def grd_msg_write_in_po(header, text, outfile):