)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":18,"context_line":"./run_tests.sh --compilemessages"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Run your dev server.  Log in and change to the language you pseudo translated."},{"line_number":21,"context_line":"It should look weird.  Note the following:"},{"line_number":22,"context_line":"- If you see a string in English it\u0027s not tranlsatable.  Should it be?"},{"line_number":23,"context_line":"- If you see brackets next to each other that might be concatenation."},{"line_number":24,"context_line":"- If there is unexpected wrapping/truncation there might not be enough"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_0b606b34","line":21,"updated":"2014-12-16 23:00:22.000000000","message":"What does weird mean?","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"023a5c2a3ffe9587b7ac08d0db1b426a2a8b9a37","unresolved":false,"context_lines":[{"line_number":18,"context_line":"./run_tests.sh --compilemessages"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Run your dev server.  Log in and change to the language you pseudo translated."},{"line_number":21,"context_line":"It should look weird.  Note the following:"},{"line_number":22,"context_line":"- If you see a string in English it\u0027s not tranlsatable.  Should it be?"},{"line_number":23,"context_line":"- If you see brackets next to each other that might be concatenation."},{"line_number":24,"context_line":"- If there is unexpected wrapping/truncation there might not be enough"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_8be0c6cd","line":21,"in_reply_to":"3a961159_0b606b34","updated":"2014-12-17 13:40:20.000000000","message":"added detail.  There is a better explanation in the blueprint too.","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Run your dev server.  Log in and change to the language you pseudo translated."},{"line_number":21,"context_line":"It should look weird.  Note the following:"},{"line_number":22,"context_line":"- If you see a string in English it\u0027s not tranlsatable.  Should it be?"},{"line_number":23,"context_line":"- If you see brackets next to each other that might be concatenation."},{"line_number":24,"context_line":"- If there is unexpected wrapping/truncation there might not be enough"},{"line_number":25,"context_line":"  space for translations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_8b6c5b38","line":22,"updated":"2014-12-16 23:00:22.000000000","message":"s/tranlsatable/translatable/","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"023a5c2a3ffe9587b7ac08d0db1b426a2a8b9a37","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Run your dev server.  Log in and change to the language you pseudo translated."},{"line_number":21,"context_line":"It should look weird.  Note the following:"},{"line_number":22,"context_line":"- If you see a string in English it\u0027s not tranlsatable.  Should it be?"},{"line_number":23,"context_line":"- If you see brackets next to each other that might be concatenation."},{"line_number":24,"context_line":"- If there is unexpected wrapping/truncation there might not be enough"},{"line_number":25,"context_line":"  space for translations"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_cbeaceab","line":22,"in_reply_to":"3a961159_8b6c5b38","updated":"2014-12-17 13:40:20.000000000","message":"Done","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":14223,"name":"Brian Fischer","email":"brian.fischer@hp.com","username":"bfischer"},"change_message_id":"3adf2028c60fd66d0eb85bc6a8af7e6c5be72dfc","unresolved":false,"context_lines":[{"line_number":21,"context_line":"It should look weird.  More specficically, every translatable string is going"},{"line_number":22,"context_line":"to start and end witha bracket and they are going to have some added"},{"line_number":23,"context_line":"characeters.  For example, \"Log In\" will become \"[~Log In~您好яшçあ]\""},{"line_number":24,"context_line":"This is useful because you can inpsect for the following:"},{"line_number":25,"context_line":"- If you see a string in English it\u0027s not translatable.  Should it be?"},{"line_number":26,"context_line":"- If you see brackets next to each other that might be concatenation."},{"line_number":27,"context_line":"- If there is unexpected wrapping/truncation there might not be enough"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"3a961159_f2c2a784","line":24,"updated":"2015-01-15 18:52:38.000000000","message":"\"inspect\"","commit_id":"87404bb63dc3b5463f8464423d41757f50089946"}],"doc/source/contributing.rst":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[{"line_number":130,"context_line":"that your code is ready for translation."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"To use the tool:"},{"line_number":133,"context_line":"Make sure your English po file is up to date:"},{"line_number":134,"context_line":"``./run_tests.sh --makemessages``"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"Run the pseudo tool to create pseudo translations.  For example, to replace the"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_1cac3636","line":133,"updated":"2015-01-20 14:29:26.000000000","message":"Two lines are both terminated with a colon. It seems a incomplete sentence.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"8c466ca78341ecfe721ac64c302a5cb3f14e6e05","unresolved":false,"context_lines":[{"line_number":130,"context_line":"that your code is ready for translation."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"To use the tool:"},{"line_number":133,"context_line":"Make sure your English po file is up to date:"},{"line_number":134,"context_line":"``./run_tests.sh --makemessages``"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"Run the pseudo tool to create pseudo translations.  For example, to replace the"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_e93324c2","line":133,"in_reply_to":"3a961159_1cac3636","updated":"2015-01-20 18:12:40.000000000","message":"I agree.  It\u0027s not right to have 2 lines terminated by a colon like this.  Broadly, I think I was sloppy with formatting.  I\u0027ll rework this whole section a bit more carefully.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[{"line_number":147,"context_line":"to start and end with a bracket and they are going to have some added"},{"line_number":148,"context_line":"characters.  For example, \"Log In\" will become \"[~Log In~您好яшçあ]\""},{"line_number":149,"context_line":"This is useful because you can inspect for the following, and consider if your"},{"line_number":150,"context_line":"code is working like it should:"},{"line_number":151,"context_line":"* If you see a string in English it\u0027s not translatable.  Should it be?"},{"line_number":152,"context_line":"* If you see brackets next to each other that might be concatenation."},{"line_number":153,"context_line":"Concatenation can make quality translations difficult or impossible.  See"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_421df861","line":150,"updated":"2015-01-20 14:29:26.000000000","message":"We need a blank line before the itemized list.\nThe list below is not itemized: http://docs-draft.openstack.org/39/142239/13/check/gate-horizon-docs/23fe8e8//doc/build/html/contributing.html#translatability","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"58e82495c394af339fd0caae6be16436660dd934","unresolved":false,"context_lines":[{"line_number":147,"context_line":"to start and end with a bracket and they are going to have some added"},{"line_number":148,"context_line":"characters.  For example, \"Log In\" will become \"[~Log In~您好яшçあ]\""},{"line_number":149,"context_line":"This is useful because you can inspect for the following, and consider if your"},{"line_number":150,"context_line":"code is working like it should:"},{"line_number":151,"context_line":"* If you see a string in English it\u0027s not translatable.  Should it be?"},{"line_number":152,"context_line":"* If you see brackets next to each other that might be concatenation."},{"line_number":153,"context_line":"Concatenation can make quality translations difficult or impossible.  See"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_ff0672cc","line":150,"in_reply_to":"3a961159_421df861","updated":"2015-01-20 18:14:17.000000000","message":"Done","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[{"line_number":150,"context_line":"code is working like it should:"},{"line_number":151,"context_line":"* If you see a string in English it\u0027s not translatable.  Should it be?"},{"line_number":152,"context_line":"* If you see brackets next to each other that might be concatenation."},{"line_number":153,"context_line":"Concatenation can make quality translations difficult or impossible.  See"},{"line_number":154,"context_line":"https://wiki.openstack.org/wiki/I18n/TranslatableStrings#Use_string_formating_variables.2C_never_perform_string_concatenation"},{"line_number":155,"context_line":"for additional information."},{"line_number":156,"context_line":"* If there is unexpected wrapping/truncation there might not be enough"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_a23a1cc2","line":153,"updated":"2015-01-20 14:29:26.000000000","message":"Don\u0027t we need spaces at the beginning of line to indent the line? Same for the next two lines.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"58e82495c394af339fd0caae6be16436660dd934","unresolved":false,"context_lines":[{"line_number":150,"context_line":"code is working like it should:"},{"line_number":151,"context_line":"* If you see a string in English it\u0027s not translatable.  Should it be?"},{"line_number":152,"context_line":"* If you see brackets next to each other that might be concatenation."},{"line_number":153,"context_line":"Concatenation can make quality translations difficult or impossible.  See"},{"line_number":154,"context_line":"https://wiki.openstack.org/wiki/I18n/TranslatableStrings#Use_string_formating_variables.2C_never_perform_string_concatenation"},{"line_number":155,"context_line":"for additional information."},{"line_number":156,"context_line":"* If there is unexpected wrapping/truncation there might not be enough"}],"source_content_type":"text/x-rst","patch_set":13,"id":"3a961159_1f0c1eec","line":153,"in_reply_to":"3a961159_a23a1cc2","updated":"2015-01-20 18:14:17.000000000","message":"Done","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"b81b959ea4c2f7d4a0b0021b13bd1415fc00ca20","unresolved":false,"context_lines":[{"line_number":122,"context_line":"  commit message."},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"Translatability"},{"line_number":125,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":126,"context_line":"Horizon gets translated into multiple languages.  The pseudo translation tool"},{"line_number":127,"context_line":"can be used to verify that code is ready to be translated.  The pseudo tool"},{"line_number":128,"context_line":"replaces a language\u0027s translation with a complete, fake translation.  Then"}],"source_content_type":"text/x-rst","patch_set":15,"id":"3a961159_226b81ba","line":125,"updated":"2015-01-20 18:31:04.000000000","message":"While we\u0027re at it, looks like there is an extra white space at the beginning of each sentence.","commit_id":"1f76ebb8beaf7182c68555da8ea83eed7f13c235"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"8a2ef62037e730e810282bc18bc55a97242c64e3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"  commit message."},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"Translatability"},{"line_number":125,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":126,"context_line":"Horizon gets translated into multiple languages.  The pseudo translation tool"},{"line_number":127,"context_line":"can be used to verify that code is ready to be translated.  The pseudo tool"},{"line_number":128,"context_line":"replaces a language\u0027s translation with a complete, fake translation.  Then"}],"source_content_type":"text/x-rst","patch_set":15,"id":"3a961159_9da9f67e","line":125,"in_reply_to":"3a961159_226b81ba","updated":"2015-01-20 19:05:30.000000000","message":"Hey, that\u0027s how we used to do it back in the day!","commit_id":"1f76ebb8beaf7182c68555da8ea83eed7f13c235"}],"pseudo.py":[{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":31,"context_line":"# Utility functions"},{"line_number":32,"context_line":"def translate(segment):"},{"line_number":33,"context_line":"    prefix \u003d u\"[~\""},{"line_number":34,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":35,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":36,"context_line":"    orig_size \u003d len(segment)"},{"line_number":37,"context_line":"    #TODO: (doug-fish) add extra length sometimes"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_8b5d3b4b","line":34,"updated":"2014-12-16 23:00:22.000000000","message":"Why treating case where starts with \\n differently?","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def translate(segment):"},{"line_number":33,"context_line":"    prefix \u003d u\"[~\""},{"line_number":34,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":35,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":36,"context_line":"    orig_size \u003d len(segment)"},{"line_number":37,"context_line":"    #TODO: (doug-fish) add extra length sometimes"},{"line_number":38,"context_line":"    return prefix + segment + u\"~您好яшçあ\" + u\"]\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_d630c6ea","line":35,"updated":"2014-12-16 23:00:22.000000000","message":"Should you strip it off?   Why have it twice?","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"023a5c2a3ffe9587b7ac08d0db1b426a2a8b9a37","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def translate(segment):"},{"line_number":33,"context_line":"    prefix \u003d u\"[~\""},{"line_number":34,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":35,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":36,"context_line":"    orig_size \u003d len(segment)"},{"line_number":37,"context_line":"    #TODO: (doug-fish) add extra length sometimes"},{"line_number":38,"context_line":"    return prefix + segment + u\"~您好яшçあ\" + u\"]\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_ebdcea76","line":35,"in_reply_to":"3a961159_d630c6ea","updated":"2014-12-17 13:40:20.000000000","message":"Without this block the po files that get generated cannot be compiled to mo files.  I see errors like:\n\nCommandError: Execution of msgfmt failed: /home/drf/horizon/horizon/locale/fr/LC_MESSAGES/django.po:309: \u0027msgid\u0027 and \u0027msgstr\u0027 entries do not both begin with \u0027\\n\u0027\n/home/drf/horizon/horizon/locale/fr/LC_MESSAGES/django.po:345: \u0027msgid\u0027 and \u0027msgstr\u0027 entries do not both begin with \u0027\\n\u0027\n\nI think the idea is that if the id starts with a newline (a multiline segement) then the message must start with a newline also.  \n\nWithout this check, my prepended bracket breaks this structure (the id may have started with a newline, but now the translated string starts with a bracket).","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def handle_plural_message(msg):"},{"line_number":45,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0]) for i in range(0, num_plurals)]"},{"line_number":46,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"# Create the new Catalog"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_8baffb2a","line":45,"updated":"2014-12-16 23:00:22.000000000","message":"What if bad and missing a translation?","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"023a5c2a3ffe9587b7ac08d0db1b426a2a8b9a37","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def handle_plural_message(msg):"},{"line_number":45,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0]) for i in range(0, num_plurals)]"},{"line_number":46,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"# Create the new Catalog"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_6b371ab1","line":45,"in_reply_to":"3a961159_8baffb2a","updated":"2014-12-17 13:40:20.000000000","message":"Remember this is not a checking tool.  I\u0027m creating \"translations\" by transforming the ids.  There will always be a translation.","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"acc22385e6df6c5e1e06c4a8c6c48a1387f0c291","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# Utility functions"},{"line_number":44,"context_line":"def translate(segment):"},{"line_number":45,"context_line":"    prefix \u003d u\"[~\""},{"line_number":46,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":47,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":48,"context_line":"    orig_size \u003d len(segment)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_ba26a666","line":45,"updated":"2014-12-17 15:58:44.000000000","message":"Thanks for explaining in your response in the previous patch.\n\nI think its worth adding a brief comment about what you\u0027re doing and why.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"ca0680f0281c1456e4ff13765eeaae81cc78ad6f","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"# Utility functions"},{"line_number":44,"context_line":"def translate(segment):"},{"line_number":45,"context_line":"    prefix \u003d u\"[~\""},{"line_number":46,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":47,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":48,"context_line":"    orig_size \u003d len(segment)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_963e2228","line":45,"in_reply_to":"3a961159_ba26a666","updated":"2014-12-17 17:19:00.000000000","message":"Done","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"acc22385e6df6c5e1e06c4a8c6c48a1387f0c291","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":47,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":48,"context_line":"    orig_size \u003d len(segment)"},{"line_number":49,"context_line":"    # Add extra expansion space, if needed"},{"line_number":50,"context_line":"    if orig_size \u003c 20:"},{"line_number":51,"context_line":"        multiplier \u003d 1"},{"line_number":52,"context_line":"    elif orig_size \u003c 30:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_dae0d2fc","line":49,"updated":"2014-12-17 15:58:44.000000000","message":"Is this random?   Why these numbers?\n\nIs this something you can make so we can it control via a command line option?  (i.e. add a TODO here?)\n\nThe reason I ask, is that then I could do my prefix thing with this same script just as a different command line option.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"ca0680f0281c1456e4ff13765eeaae81cc78ad6f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":47,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":48,"context_line":"    orig_size \u003d len(segment)"},{"line_number":49,"context_line":"    # Add extra expansion space, if needed"},{"line_number":50,"context_line":"    if orig_size \u003c 20:"},{"line_number":51,"context_line":"        multiplier \u003d 1"},{"line_number":52,"context_line":"    elif orig_size \u003c 30:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_f671260d","line":49,"in_reply_to":"3a961159_dae0d2fc","updated":"2014-12-17 17:19:00.000000000","message":"As we discussed it\u0027s not random; I didn\u0027t even make it up.  I\u0027ll comment.\n\nWe should rethink resuse more broadly.  It seems like what you want to do is structurally really similar, but several details are different (iterate over translation vs ids, provide a different translation).  My first thought is that this is bigger than a flag, but we should plan for this reuse.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"acc22385e6df6c5e1e06c4a8c6c48a1387f0c291","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def handle_plural_message(msg):"},{"line_number":71,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":72,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":73,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_daae1298","line":71,"updated":"2014-12-17 15:58:44.000000000","message":"I know you aren\u0027t a checker, but this will blow up if there are less than the number of plurals translations.\n\nIf you aren\u0027t a checker, instead of going to num_plurals you should go to len(msg.id)","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"ca0680f0281c1456e4ff13765eeaae81cc78ad6f","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"def handle_plural_message(msg):"},{"line_number":71,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":72,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":73,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3a961159_56d11acc","line":71,"in_reply_to":"3a961159_daae1298","updated":"2014-12-17 17:19:00.000000000","message":"As we discussed the msg.id is actually a tuple, and I\u0027m generating the number of plurals described by the new Catalog.  I\u0027ll fix the if isinstance(msg.string, tuple) check below to actually check the id.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import babel.messages.catalog as catalog"},{"line_number":19,"context_line":"import babel.messages.pofile as pofile"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Check arguements"},{"line_number":22,"context_line":"if len(sys.argv) !\u003d 4:"},{"line_number":23,"context_line":"    print (\u0027Usage: python pseudo.py potfilename pofilename locale\u0027)"},{"line_number":24,"context_line":"    exit(1)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_982608cd","line":21,"updated":"2014-12-19 15:14:43.000000000","message":"argparse module would make your life easier and code cleaner.\nWith \"type\u003dargparse.FileType(...)\" it can even open files for you.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"eb5947106c11507f0d90b6a28dd304d3dfde4d48","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import babel.messages.catalog as catalog"},{"line_number":19,"context_line":"import babel.messages.pofile as pofile"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Check arguements"},{"line_number":22,"context_line":"if len(sys.argv) !\u003d 4:"},{"line_number":23,"context_line":"    print (\u0027Usage: python pseudo.py potfilename pofilename locale\u0027)"},{"line_number":24,"context_line":"    exit(1)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8f1dc075","line":21,"in_reply_to":"3a961159_7bace488","updated":"2015-01-07 11:04:02.000000000","message":"IMHO once you learn it you\u0027ll never want to parse argv manually. Mainly because by using argparse you create one point in code where everything argument-related is processed making it easy to add or change sth in future. Let me provide a quick example:\n\n parser \u003d argparse.ArgumentParser(description\u003d\u0027...\u0027)\n parser.add_argument(\u0027in_file\u0027, type\u003dargparse.FileType(\u0027r\u0027), help\u003d\u0027...\u0027)\n parser.add_argument(\u0027out_file\u0027, type\u003dargparse.FileType(\u0027w\u0027), help\u003d\u0027...\u0027)\n parser.add_argument(\u0027locale\u0027, help\u003d\u0027...\u0027)\n args \u003d parser.parse_args()\n\nIt\u0027ll prepare help and usage basing on argument names and help strings you provided, so \"if len(sys.argv) !\u003d 4\" won\u0027t be needed any more. Then you can use parsed args like that:\n\n pot_cat \u003d pofile.read_po(args.in_file, ...)\n ...\n new_cat \u003d catalog.Catalog(locale\u003dargs.locale, ...)\n ...\n pofile.write_po(args.out_file, ...)\n\nI hope it convinced you :)","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"173ab866caf3ad70b779cf7a9c7e507f7e62950b","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import babel.messages.catalog as catalog"},{"line_number":19,"context_line":"import babel.messages.pofile as pofile"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Check arguements"},{"line_number":22,"context_line":"if len(sys.argv) !\u003d 4:"},{"line_number":23,"context_line":"    print (\u0027Usage: python pseudo.py potfilename pofilename locale\u0027)"},{"line_number":24,"context_line":"    exit(1)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_b7a2ca3c","line":21,"in_reply_to":"3a961159_8f1dc075","updated":"2015-01-07 14:52:19.000000000","message":"Yes - my initial comment was based on looking at the documentation very briefly (it was the end of my day + I had to run!).  After spending a bit of time actually learning with it, I see it is as simple as you\u0027ve described here.  I agree, it\u0027s the right thing to do.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":18,"context_line":"import babel.messages.catalog as catalog"},{"line_number":19,"context_line":"import babel.messages.pofile as pofile"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"# Check arguements"},{"line_number":22,"context_line":"if len(sys.argv) !\u003d 4:"},{"line_number":23,"context_line":"    print (\u0027Usage: python pseudo.py potfilename pofilename locale\u0027)"},{"line_number":24,"context_line":"    exit(1)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_7bace488","line":21,"in_reply_to":"3a961159_982608cd","updated":"2015-01-06 22:10:21.000000000","message":"This is your only suggestion I haven\u0027t implemented yet.  I haven\u0027t used argparse before; my first impression is that it is a bit heavyweight for a developer tool.  How strongly do you feel about this?","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # When the id starts with a newline the mo compiler enforces that"},{"line_number":42,"context_line":"    # the translated message must also start with a newline.  Make"},{"line_number":43,"context_line":"    # sure that doesn\u0027t get broken when prepending the bracket."},{"line_number":44,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":45,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":46,"context_line":"    orig_size \u003d len(segment)"},{"line_number":47,"context_line":"    # Add extra expansion space based on recommenation from"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_18c93826","line":44,"updated":"2014-12-19 15:14:43.000000000","message":"Can be done with segment.startswith(\u0027\\n\u0027).","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    # When the id starts with a newline the mo compiler enforces that"},{"line_number":42,"context_line":"    # the translated message must also start with a newline.  Make"},{"line_number":43,"context_line":"    # sure that doesn\u0027t get broken when prepending the bracket."},{"line_number":44,"context_line":"    if segment and segment[0] \u003d\u003d \u0027\\n\u0027:"},{"line_number":45,"context_line":"        prefix \u003d segment[0] + prefix"},{"line_number":46,"context_line":"    orig_size \u003d len(segment)"},{"line_number":47,"context_line":"    # Add extra expansion space based on recommenation from"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_bbc9ec5b","line":44,"in_reply_to":"3a961159_18c93826","updated":"2015-01-06 22:10:21.000000000","message":"Done","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    else:"},{"line_number":58,"context_line":"        multiplier \u003d 0.3"},{"line_number":59,"context_line":"    extra_length \u003d int(max(0, (orig_size * multiplier) - 10))"},{"line_number":60,"context_line":"    extra_chars \u003d \"~\" * extra_length"},{"line_number":61,"context_line":"    return prefix + segment + u\"~您好яшçあ\" + extra_chars + u\"]\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d89090ef","line":60,"updated":"2014-12-19 15:14:43.000000000","message":"\"\".format(...) would probably be more clear. \nEx:\n  return u\"{}[~{}~????ç?{}]\".format(prefix, segment, extra_chars)","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    else:"},{"line_number":58,"context_line":"        multiplier \u003d 0.3"},{"line_number":59,"context_line":"    extra_length \u003d int(max(0, (orig_size * multiplier) - 10))"},{"line_number":60,"context_line":"    extra_chars \u003d \"~\" * extra_length"},{"line_number":61,"context_line":"    return prefix + segment + u\"~您好яшçあ\" + extra_chars + u\"]\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_1bbda0b1","line":60,"in_reply_to":"3a961159_d89090ef","updated":"2015-01-06 22:10:21.000000000","message":"agreed.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def handle_single_message(msg):"},{"line_number":65,"context_line":"    msg.string \u003d translate(msg.id)"},{"line_number":66,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"def handle_plural_message(msg):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_b8ad84eb","line":66,"updated":"2014-12-19 15:14:43.000000000","message":"Why don\u0027t you simply use new_cat[msg.id] \u003d msg ?","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def handle_single_message(msg):"},{"line_number":65,"context_line":"    msg.string \u003d translate(msg.id)"},{"line_number":66,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"def handle_plural_message(msg):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9be8b0b4","line":66,"in_reply_to":"3a961159_b8ad84eb","updated":"2015-01-06 22:10:21.000000000","message":"No idea why I wrote it the way I did.  Maybe looking forward to vacation too early?","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":69,"context_line":"def handle_plural_message(msg):"},{"line_number":70,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":71,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":72,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"# Process messages from template"},{"line_number":75,"context_line":"for msg in pot_cat:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_b8dbc47a","line":72,"updated":"2014-12-19 15:14:43.000000000","message":"Same as above.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":69,"context_line":"def handle_plural_message(msg):"},{"line_number":70,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":71,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":72,"context_line":"    new_cat.__setitem__(msg.id, msg)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"# Process messages from template"},{"line_number":75,"context_line":"for msg in pot_cat:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_bbd00cf8","line":72,"in_reply_to":"3a961159_b8dbc47a","updated":"2015-01-06 22:10:21.000000000","message":"Done","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":75,"context_line":"for msg in pot_cat:"},{"line_number":76,"context_line":"    # TODO(doug-fish): there might be a better way to handle the"},{"line_number":77,"context_line":"    # Babel Message object"},{"line_number":78,"context_line":"    if isinstance(msg.id, tuple):"},{"line_number":79,"context_line":"        handle_plural_message(msg)"},{"line_number":80,"context_line":"    else:"},{"line_number":81,"context_line":"        handle_single_message(msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_0b2d64fe","line":78,"updated":"2014-12-19 15:14:43.000000000","message":"msg.pluralizable is probably what you are looking for.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":75,"context_line":"for msg in pot_cat:"},{"line_number":76,"context_line":"    # TODO(doug-fish): there might be a better way to handle the"},{"line_number":77,"context_line":"    # Babel Message object"},{"line_number":78,"context_line":"    if isinstance(msg.id, tuple):"},{"line_number":79,"context_line":"        handle_plural_message(msg)"},{"line_number":80,"context_line":"    else:"},{"line_number":81,"context_line":"        handle_single_message(msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_dbcdd85e","line":78,"in_reply_to":"3a961159_0b2d64fe","updated":"2015-01-06 22:10:21.000000000","message":"yep!","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"009c57625efa2ac28e89279f8a04aa2516a99bc1","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Write \"translated\" PO file"},{"line_number":84,"context_line":"with open(sys.argv[2], \"w\") as po_file:"},{"line_number":85,"context_line":"    pofile.write_po(po_file, new_cat, ignore_obsolete\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_ab1e100a","line":85,"updated":"2014-12-19 15:14:43.000000000","message":"It\u0027s good practice to use construction like this:\n\ndef main():\n    [your global code here]\n\nif __name__ \u003d\u003d \u0027__main__\u0027:\n    main()\n\nRather than creating lots of global code fragments.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"c93b0783c52486895ea26d9b1568d94771db2753","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"# Write \"translated\" PO file"},{"line_number":84,"context_line":"with open(sys.argv[2], \"w\") as po_file:"},{"line_number":85,"context_line":"    pofile.write_po(po_file, new_cat, ignore_obsolete\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3b041c7d","line":85,"in_reply_to":"3a961159_ab1e100a","updated":"2015-01-06 22:10:21.000000000","message":"Nice tip.  I\u0027ve updated.","commit_id":"575c6ac0acd97dc86231036a770d76d3b0b492bf"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"d41a0b496d6fef6d4cd302e04092d1dfd1c31944","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def handle_plural_message(msg, num_plurals, new_cat):"},{"line_number":54,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":55,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":56,"context_line":"    new_cat[msg.id] \u003d msg"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_5ef45af0","line":54,"updated":"2015-01-07 19:12:59.000000000","message":"Could be replaced by:\n\n translate(u\"{}:{}\".format(i, msg.id[0]))","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"d9bec2b9c68b59116b8e62d4a6cd4d0499694e99","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def handle_plural_message(msg, num_plurals, new_cat):"},{"line_number":54,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":55,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":56,"context_line":"    new_cat[msg.id] \u003d msg"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_493d7fba","line":54,"in_reply_to":"3a961159_5ef45af0","updated":"2015-01-07 23:32:37.000000000","message":"Done","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"d41a0b496d6fef6d4cd302e04092d1dfd1c31944","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def handle_plural_message(msg, num_plurals, new_cat):"},{"line_number":54,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":55,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":56,"context_line":"    new_cat[msg.id] \u003d msg"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_fe38a6a1","line":55,"updated":"2015-01-07 19:12:59.000000000","message":"Range starts from 0 by default, so range(num_plurals) is enough","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"d9bec2b9c68b59116b8e62d4a6cd4d0499694e99","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def handle_plural_message(msg, num_plurals, new_cat):"},{"line_number":54,"context_line":"    msg.string \u003d [translate(unicode(i) + u\":\" + msg.id[0])"},{"line_number":55,"context_line":"                  for i in range(0, num_plurals)]"},{"line_number":56,"context_line":"    new_cat[msg.id] \u003d msg"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_69487b5c","line":55,"in_reply_to":"3a961159_fe38a6a1","updated":"2015-01-07 23:32:37.000000000","message":"Done","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"d41a0b496d6fef6d4cd302e04092d1dfd1c31944","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    # Process messages from template"},{"line_number":77,"context_line":"    for msg in pot_cat:"},{"line_number":78,"context_line":"        if msg.pluralizable:"},{"line_number":79,"context_line":"            handle_plural_message(msg, num_plurals, new_cat)"},{"line_number":80,"context_line":"        else:"},{"line_number":81,"context_line":"            handle_single_message(msg, new_cat)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_1e8d7231","line":79,"updated":"2015-01-07 19:12:59.000000000","message":"I\u0027m not entirely sure about that, but do you really need separate functions for one line line of code? (plus one common line)","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"d9bec2b9c68b59116b8e62d4a6cd4d0499694e99","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    # Process messages from template"},{"line_number":77,"context_line":"    for msg in pot_cat:"},{"line_number":78,"context_line":"        if msg.pluralizable:"},{"line_number":79,"context_line":"            handle_plural_message(msg, num_plurals, new_cat)"},{"line_number":80,"context_line":"        else:"},{"line_number":81,"context_line":"            handle_single_message(msg, new_cat)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_09a6170f","line":79,"in_reply_to":"3a961159_1e8d7231","updated":"2015-01-07 23:32:37.000000000","message":"No.  The original versions of those functions were longer and it made sense.  It doesn\u0027t anymore.  Nice catch!","commit_id":"1dee462344cb9d0593992c817bcb14328dae5680"},{"author":{"_account_id":11902,"name":"Randy Bertram","email":"rbertram@us.ibm.com","username":"rbertram"},"change_message_id":"c6681d29c8d83cf7a0285fa9d604993277f8c95d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# coding: utf-8"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"# not use this file except in compliance with the License. You may obtain"},{"line_number":6,"context_line":"# a copy of the License at"},{"line_number":7,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_3c08dd27","line":4,"updated":"2015-01-13 19:52:53.000000000","message":"An IBM copyright is required here.","commit_id":"277e7b35d53b676a8a319b9f19c1a67437a955fe"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"07b503387c403e8779471b8019bd2e92965a402b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# coding: utf-8"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":5,"context_line":"# not use this file except in compliance with the License. You may obtain"},{"line_number":6,"context_line":"# a copy of the License at"},{"line_number":7,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a961159_79dce218","line":4,"in_reply_to":"3a961159_3c08dd27","updated":"2015-01-15 17:42:19.000000000","message":"Agreed.  Just to be clear to other reviewers:  this isn\u0027t a requirement of OpenStack or Horizon, it\u0027s a requirement of IBM.  If you work for IBM and get legal guidance from the same place Randy and I do, you need to add a header.","commit_id":"277e7b35d53b676a8a319b9f19c1a67437a955fe"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"3a961159_fc84cad4","updated":"2015-01-20 14:29:26.000000000","message":"Can we move this file into tools/ directory?","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"58e82495c394af339fd0caae6be16436660dd934","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"3a961159_9fff2eab","in_reply_to":"3a961159_fc84cad4","updated":"2015-01-20 18:14:17.000000000","message":"Done","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        multiplier \u003d 0.3"},{"line_number":43,"context_line":"    extra_length \u003d int(max(0, (orig_size * multiplier) - 10))"},{"line_number":44,"context_line":"    extra_chars \u003d \"~\" * extra_length"},{"line_number":45,"context_line":"    return u\"{}[~{}~您好яшçあ{}]\".format(prefix, segment, extra_chars)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_fc0daa90","line":45,"updated":"2015-01-20 14:29:26.000000000","message":"nit: I know we can use just {} without a index number, but I perfer to using an index number as it is clear when reading the code.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"8c466ca78341ecfe721ac64c302a5cb3f14e6e05","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        multiplier \u003d 0.3"},{"line_number":43,"context_line":"    extra_length \u003d int(max(0, (orig_size * multiplier) - 10))"},{"line_number":44,"context_line":"    extra_chars \u003d \"~\" * extra_length"},{"line_number":45,"context_line":"    return u\"{}[~{}~您好яшçあ{}]\".format(prefix, segment, extra_chars)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def main():"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a961159_69d9f483","line":45,"in_reply_to":"3a961159_fc0daa90","updated":"2015-01-20 18:12:40.000000000","message":"Done","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"}],"run_tests.sh":[{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"d0a23c5c448333a7f45cffac68ba22dca1ea5888","unresolved":false,"context_lines":[{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  do"},{"line_number":453,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/django.po horizon/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":455,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/djangojs.po horizon/locale/$lang/LC_MESSAGES/djangojs.po $lang"},{"line_number":456,"context_line":"  done"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3a961159_b6541acb","line":453,"updated":"2014-12-16 23:00:22.000000000","message":"Isn\u0027t the first argument the pot file?   Ditto next two lines.","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"023a5c2a3ffe9587b7ac08d0db1b426a2a8b9a37","unresolved":false,"context_lines":[{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  do"},{"line_number":453,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/django.po horizon/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":455,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/djangojs.po horizon/locale/$lang/LC_MESSAGES/djangojs.po $lang"},{"line_number":456,"context_line":"  done"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3a961159_999f3f03","line":453,"in_reply_to":"3a961159_b6541acb","updated":"2014-12-17 13:40:20.000000000","message":"It is.  In Horizon/Django the way we are using it the English po file is the pot file.  Is there a concern that I\u0027m missing here?","commit_id":"eefe08cd34220ed457419f01d79810932f89bf0b"},{"author":{"_account_id":6601,"name":"James Carey","email":"jecarey@yerac.com","username":"jecarey"},"change_message_id":"acc22385e6df6c5e1e06c4a8c6c48a1387f0c291","unresolved":false,"context_lines":[{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  do"},{"line_number":453,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/django.po horizon/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":455,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/djangojs.po horizon/locale/$lang/LC_MESSAGES/djangojs.po $lang"},{"line_number":456,"context_line":"  done"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a961159_1a77ba3c","line":453,"updated":"2014-12-17 15:58:44.000000000","message":"is the po file being the pot file common knowledge?   If so, then ignore me.   If not, it might be worth a comment for people like me who are easily confused.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"ca0680f0281c1456e4ff13765eeaae81cc78ad6f","unresolved":false,"context_lines":[{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  do"},{"line_number":453,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/django.po horizon/locale/$lang/LC_MESSAGES/django.po $lang"},{"line_number":455,"context_line":"      ${command_wrapper} $root/pseudo.py horizon/locale/en/LC_MESSAGES/djangojs.po horizon/locale/$lang/LC_MESSAGES/djangojs.po $lang"},{"line_number":456,"context_line":"  done"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a961159_362e4efb","line":453,"in_reply_to":"3a961159_1a77ba3c","updated":"2014-12-17 17:19:00.000000000","message":"I\u0027m not sure there is any such thing as \"common knowledge\" when we talk about how Horizon does translations.  I\u0027ll comment.","commit_id":"f3ebf68d13c5f898385f1386f8ca48ed8251f34f"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6bbc47abab3c0d3cb0b611cfcf544edfcf50cc89","unresolved":false,"context_lines":[{"line_number":448,"context_line":"}"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  # Use English po file as the source file/pot file just like real Horizon translations"},{"line_number":453,"context_line":"  do"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"}],"source_content_type":"text/x-sh","patch_set":13,"id":"3a961159_423ed88c","line":451,"updated":"2015-01-20 14:29:26.000000000","message":"Another idea is to add \"fake\" language. It can be done by adding \"fake\" lang to LANGUAGES in openstack_dashboard/local/local_settings.py. It is what my script does for the translation check site [1].\n\n[1] https://github.com/amotoki/horizon-i18n-tools/blob/master/update-lang-list.sh","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"8c466ca78341ecfe721ac64c302a5cb3f14e6e05","unresolved":false,"context_lines":[{"line_number":448,"context_line":"}"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  # Use English po file as the source file/pot file just like real Horizon translations"},{"line_number":453,"context_line":"  do"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"}],"source_content_type":"text/x-sh","patch_set":13,"id":"3a961159_7fd60255","line":451,"in_reply_to":"3a961159_423ed88c","updated":"2015-01-20 18:12:40.000000000","message":"Creating a fake language was actually my first design idea -- I was going to call it \"Martian\" and add the text \"ack ack\" to every string!  The problem is that when a fake language is created some things are going to still be displayed in English because they come from other components like Django.  Rather than allowing this confusing situation (English is displayed, is that okay?), I decided to just overwrite existing languages.  That way, segments that are translated outside of Horizon are still displayed as translated, and any English can be known to be untranslated.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"542c76ac971bba3a9d826e93e6eddd120df0dc2d","unresolved":false,"context_lines":[{"line_number":448,"context_line":"}"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"function run_pseudo {"},{"line_number":451,"context_line":"  for lang in $testargs"},{"line_number":452,"context_line":"  # Use English po file as the source file/pot file just like real Horizon translations"},{"line_number":453,"context_line":"  do"},{"line_number":454,"context_line":"      ${command_wrapper} $root/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang"}],"source_content_type":"text/x-sh","patch_set":13,"id":"1a930d6b_5f48845b","line":451,"in_reply_to":"3a961159_7fd60255","updated":"2015-01-21 13:59:01.000000000","message":"I see. I now totally agree with your approach. Thanks.","commit_id":"cec7b5a5a4996e2d128b45c1dcc598c6e4506922"}]}
