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

Issue 5694103719247872: Issue 2133 - Allow to specify default translation inline in pages rather than in a separate file (Closed)

Created:
March 12, 2015, 7:34 p.m. by Wladimir Palant
Modified:
March 12, 2015, 9:15 p.m.
Reviewers:
Sebastian Noack
CC:
kzar
Visibility:
Public.

Description

Issue 2133 - Allow to specify default translation inline in pages rather than in a separate file

Patch Set 1 #

Total comments: 14

Patch Set 2 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -51 lines) Patch
M cms/bin/generate_static_pages.py View 1 chunk +3 lines, -1 line 0 comments Download
M cms/converters.py View 1 6 chunks +104 lines, -40 lines 0 comments Download
M cms/sources.py View 2 chunks +10 lines, -3 lines 0 comments Download
M cms/utils.py View 1 2 chunks +12 lines, -7 lines 0 comments Download

Messages

Total messages: 5
Wladimir Palant
March 12, 2015, 7:34 p.m. (2015-03-12 19:34:33 UTC) #1
Sebastian Noack
http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/converters.py File cms/converters.py (right): http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/converters.py#newcode45 cms/converters.py:45: class AttributeParser(HTMLParser.HTMLParser): That makes actually sense, using a proper ...
March 12, 2015, 8:33 p.m. (2015-03-12 20:33:46 UTC) #2
Wladimir Palant
http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/converters.py File cms/converters.py (right): http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/converters.py#newcode45 cms/converters.py:45: class AttributeParser(HTMLParser.HTMLParser): On 2015/03/12 20:33:46, Sebastian Noack wrote: > ...
March 12, 2015, 8:57 p.m. (2015-03-12 20:57:02 UTC) #3
Sebastian Noack
LGTM. The one remaining nit isn't worth arguing. http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/sources.py File cms/sources.py (right): http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/sources.py#newcode79 cms/sources.py:79: from ...
March 12, 2015, 9:08 p.m. (2015-03-12 21:08:18 UTC) #4
Wladimir Palant
March 12, 2015, 9:15 p.m. (2015-03-12 21:15:27 UTC) #5
http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/...
File cms/sources.py (right):

http://codereview.adblockplus.org/5694103719247872/diff/5629499534213120/cms/...
cms/sources.py:82: for format in converters.iterkeys()
On 2015/03/12 21:08:19, Sebastian Noack wrote:
> So you would also use ..
> 
> for (let key of Object.keys(o))
> 
> .. instead ..
> 
> for (let key in o)
> 
> .. in JavaScript? ;)

These constructs aren't actually equivalent. Besides, the for..in loop is meant
specifically to iterate over properties of objects, it won't do anything beyond
that. A Python loop on the other hand can iterate over all kinds of things, you
actually have to know what kind of object you have there. It's the same with the
for..of loop in JavaScript and I'm not sure I'd approve any non-obvious use of
it (meaning: not an array).

Powered by Google App Engine
This is Rietveld