{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/14816","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/14816/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/14816/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/14816/events","html_url":"https://github.com/odoo/odoo/pull/14816","id":197205285,"number":14816,"title":"[REF] translate: rewrite XML translator to handle namespaces gracefully","user":{"login":"rco-odoo","id":7578141,"avatar_url":"https://avatars.githubusercontent.com/u/7578141?v=3","gravatar_id":"","url":"https://api.github.com/users/rco-odoo","html_url":"https://github.com/rco-odoo","followers_url":"https://api.github.com/users/rco-odoo/followers","following_url":"https://api.github.com/users/rco-odoo/following{/other_user}","gists_url":"https://api.github.com/users/rco-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rco-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rco-odoo/subscriptions","organizations_url":"https://api.github.com/users/rco-odoo/orgs","repos_url":"https://api.github.com/users/rco-odoo/repos","events_url":"https://api.github.com/users/rco-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/rco-odoo/received_events","type":"User","site_admin":false},"labels":[{"id":106173385,"url":"https://api.github.com/repos/odoo/odoo/labels/RD","name":"RD","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-22T15:56:40Z","updated_at":"2016-12-23T12:39:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/odoo/odoo/pulls/14816","html_url":"https://github.com/odoo/odoo/pull/14816","diff_url":"https://github.com/odoo/odoo/pull/14816.diff","patch_url":"https://github.com/odoo/odoo/pull/14816.patch"},"body":"The class `XMLTranslator` is replaced by a function `translate_xml_node` that takes an XML node and returns the translated XML node.  The function is recursive and much simpler to understand than the former implementation.\r\n"},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/268984182","html_url":"https://github.com/odoo/odoo/pull/14816#issuecomment-268984182","issue_url":"https://api.github.com/repos/odoo/odoo/issues/14816","id":268984182,"user":{"login":"odony","id":2039870,"avatar_url":"https://avatars.githubusercontent.com/u/2039870?v=3","gravatar_id":"","url":"https://api.github.com/users/odony","html_url":"https://github.com/odony","followers_url":"https://api.github.com/users/odony/followers","following_url":"https://api.github.com/users/odony/following{/other_user}","gists_url":"https://api.github.com/users/odony/gists{/gist_id}","starred_url":"https://api.github.com/users/odony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odony/subscriptions","organizations_url":"https://api.github.com/users/odony/orgs","repos_url":"https://api.github.com/users/odony/repos","events_url":"https://api.github.com/users/odony/events{/privacy}","received_events_url":"https://api.github.com/users/odony/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T12:39:26Z","updated_at":"2016-12-23T12:39:26Z","body":"I think I understand the rationale for the simplification and supporting namespaces properly.\r\n\r\nHowever I'm puzzled by some aspects of the new algorithm:\r\n\r\n- It seems we will be doing a lot of redundant processing. For example the call to `translatable()` on every step of the iteration induces n^2 operations. Then `translate_content()` starts with another tree traversal via `itertext()` that represents a worst-case n^2 again, depending on the implementation `itertext`. I'm probably missing something, but it seems we should be able to translate the whole tree with a single post-order tree traversal, working in-place. Going upwards from each leaf we stop when we have a translatable \"atom\", and so on. Wouldn't it work?\r\n- Shouldn't the static helper functions be moved outside the translation function, especially as it will be called recursively?\r\n- Why do we have escaped tags in the new `test_translate_xml_translations` test? (```\"Mettre &lt;b&gt;plus de texte&lt;/i&gt; ici\"```)\r\n\r\nThanks!\r\n"}}
{"actor":{"display_login":"odony"}}