{"issue":{"milestone":null,"user":{"id":683911,"login":"jcbrand","url":"https://api.github.com/users/jcbrand","avatar_url":"https://secure.gravatar.com/avatar/5ea86e43b7ff2e6cca6c8d77f6d99f99?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5ea86e43b7ff2e6cca6c8d77f6d99f99"},"created_at":"2011-12-19T15:58:16Z","title":"i18n domain from macro overrides i18n domain from fill-slot","updated_at":"2011-12-19T15:58:16Z","labels":[],"state":"open","id":2601751,"html_url":"https://github.com/malthe/chameleon/issues/80","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"It seems that with the fixes for issue #37, a bug creeped in.\r\n\r\nFirstly, from the latest documentation:  http://chameleon.repoze.org/docs/latest/i18n.html\r\n\r\n> When using translation with METAL macros, the internationalization context is considered part of the specific documents that \r\n> page components are retrieved from rather than part of the combined page. \r\n\r\nSo, if I understand correctly what you mean...\r\n\r\nin context of the chameleon tests, *chameleon/tests/inputs/032-master-template.pt* would be the combined page, where the macro and the slots are defined.\r\n\r\nAnd *chameleon/tests/inputs/070-translation-domain-and-use-macro.pt* would be a document from which components (i.e slot-fillers) are retrieved.\r\n\r\nThe text says that the i18n context is considered part of the document from which components are sourced from. So the i18n domain of the *metal:fill-slot* node must be \"test\", and not the i18n domain of *032-master-template.pt*.\r\n\r\nThis is currently *not* the case however, but there is no test to show that this fails. The reason the tests pass, is because *032-master-template.pt* doesn't define an i18n domain.\r\n\r\nIf you change *032-master-template.pt* to have an i18n domain, for example:\r\n\r\n    <html metal:define-macro=\"main\" \r\n          i18n:domain=\"chameleon\"\r\n          tal:define=\"content nothing\">\r\n\r\nthen the tests break, which they shouldn't because we still expect the slot-filler's domain to be \"test\".\r\n\r\nLooking at the changes made for #37, the following line seems to be introducing the bug (lines 1317 to 1320):\r\n\r\n        orelse = template(\r\n            \"SLOT(__stream, econtext.copy(), rcontext, __i18n_domain)\",\r\n            SLOT=name)\r\n\r\nIf I remove ```, __i18n_domain```, then the problem disappears and the tests pass.\r\n\r\nI'm however not sure if that is the correct fix for the bug since I don't yet understand the context in which __i18n_domain gets defined.\r\n","number":80,"url":"https://api.github.com/repos/malthe/chameleon/issues/80","comments":0,"assignee":null},"action":"opened"}