Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: cms/utils.py

Issue 29317015: Issue 2625 - [cms] Crowdin synchronisation script (Closed)
Patch Set: Created June 15, 2015, 2:12 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« cms/sources.py ('K') | « cms/sources.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2015 Eyeo GmbH 4 # Copyright (C) 2006-2015 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 12 matching lines...) Expand all
23 for format in converters.iterkeys(): 23 for format in converters.iterkeys():
24 if source.has_page(page, format): 24 if source.has_page(page, format):
25 break 25 break
26 else: 26 else:
27 format = "md" 27 format = "md"
28 28
29 params = { 29 params = {
30 "source": source, 30 "source": source,
31 "template": "default", 31 "template": "default",
32 "locale": locale, 32 "locale": locale,
33 "localecomments": {},
Wladimir Palant 2015/06/29 19:05:38 This should no longer be necessary if locale data
kzar 2015/07/02 12:33:13 Done.
33 "page": page, 34 "page": page,
34 "pagedata": source.read_page(page, format), 35 "pagedata": source.read_page(page, format),
35 "config": source.read_config(), 36 "config": source.read_config(),
36 } 37 }
37 38
38 localefile = page 39 localefile = page
39 if params["config"].has_option("locale_overrides", page): 40 if params["config"].has_option("locale_overrides", page):
40 localefile = params["config"].get("locale_overrides", page) 41 localefile = params["config"].get("locale_overrides", page)
41 params["localedata"] = source.read_locale(params["locale"], localefile) 42 params["localedata"] = source.read_locale(params["locale"], localefile)
42 43
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 else: 76 else:
76 params["translation_ratio"] = 1 77 params["translation_ratio"] = 1
77 78
78 return params 79 return params
79 80
80 def process_page(source, locale, page, format=None, site_url_override=None): 81 def process_page(source, locale, page, format=None, site_url_override=None):
81 return TemplateConverter( 82 return TemplateConverter(
82 get_page_params(source, locale, page, format, site_url_override), 83 get_page_params(source, locale, page, format, site_url_override),
83 key="templatedata" 84 key="templatedata"
84 )() 85 )()
OLDNEW
« cms/sources.py ('K') | « cms/sources.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld