{"action":"created","issue":{"url":"https://api.github.com/repos/udemy/py-moneyed/issues/8","repository_url":"https://api.github.com/repos/udemy/py-moneyed","labels_url":"https://api.github.com/repos/udemy/py-moneyed/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/udemy/py-moneyed/issues/8/comments","events_url":"https://api.github.com/repos/udemy/py-moneyed/issues/8/events","html_url":"https://github.com/udemy/py-moneyed/pull/8","id":157672687,"number":8,"title":"fallback to DEFAULT symbol definition if currency not available in sy…","user":{"login":"hturksoy","id":4233688,"avatar_url":"https://avatars.githubusercontent.com/u/4233688?v=3","gravatar_id":"","url":"https://api.github.com/users/hturksoy","html_url":"https://github.com/hturksoy","followers_url":"https://api.github.com/users/hturksoy/followers","following_url":"https://api.github.com/users/hturksoy/following{/other_user}","gists_url":"https://api.github.com/users/hturksoy/gists{/gist_id}","starred_url":"https://api.github.com/users/hturksoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hturksoy/subscriptions","organizations_url":"https://api.github.com/users/hturksoy/orgs","repos_url":"https://api.github.com/users/hturksoy/repos","events_url":"https://api.github.com/users/hturksoy/events{/privacy}","received_events_url":"https://api.github.com/users/hturksoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-31T13:33:40Z","updated_at":"2016-05-31T13:34:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/udemy/py-moneyed/pulls/8","html_url":"https://github.com/udemy/py-moneyed/pull/8","diff_url":"https://github.com/udemy/py-moneyed/pull/8.diff","patch_url":"https://github.com/udemy/py-moneyed/pull/8.patch"},"body":"Current code doesn't fall back to `DEFAULT` if a locale is defined but a symbol for a currency not defined. This makes definition of `DEFAULT` symbols meaningless. Hence, any overriding implementation had to create symbol override for all the other currencies instead of falling back/relying on the `DEFAULT` symbols.\r\nThis fix adds another check for whether symbol for that currency defined for given locale. If not, uses the `DEFAULT` symbol for that currency. By this way, for overriders, it'll be enough to define the `DEFAULT` symbols to customise the formatting.\r\n\r\n@emre-e @burakgoynuk could you please have a check?"},"comment":{"url":"https://api.github.com/repos/udemy/py-moneyed/issues/comments/222689659","html_url":"https://github.com/udemy/py-moneyed/pull/8#issuecomment-222689659","issue_url":"https://api.github.com/repos/udemy/py-moneyed/issues/8","id":222689659,"user":{"login":"hturksoy","id":4233688,"avatar_url":"https://avatars.githubusercontent.com/u/4233688?v=3","gravatar_id":"","url":"https://api.github.com/users/hturksoy","html_url":"https://github.com/hturksoy","followers_url":"https://api.github.com/users/hturksoy/followers","following_url":"https://api.github.com/users/hturksoy/following{/other_user}","gists_url":"https://api.github.com/users/hturksoy/gists{/gist_id}","starred_url":"https://api.github.com/users/hturksoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hturksoy/subscriptions","organizations_url":"https://api.github.com/users/hturksoy/orgs","repos_url":"https://api.github.com/users/hturksoy/repos","events_url":"https://api.github.com/users/hturksoy/events{/privacy}","received_events_url":"https://api.github.com/users/hturksoy/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T13:34:42Z","updated_at":"2016-05-31T13:34:42Z","body":"With this fix, we will get rid of the symbol overrides below. It'll be enough to customise `DEFAULT`s only:\r\n\r\n```\r\nmoneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.USD,\r\n                                                    prefix='$')\r\nmoneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.GBP,\r\n                                                    prefix='£')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.SGD,\r\n#                                                     prefix='S$')\r\nmoneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.MXN,\r\n                                                    prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.BRL,\r\n#                                                     prefix='R$')\r\nmoneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.CAD,\r\n                                                    prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.AUD,\r\n#                                                     prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.THB,\r\n#                                                     prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.ILS,\r\n#                                                     prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition(moneyed.localization.DEFAULT, moneyed.TWD,\r\n#                                                     prefix='NT$')\r\n\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.GBP, prefix='£')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.EUR, suffix=' €')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.JPY, suffix=' ¥')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.SGD, prefix='S$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.MXN, prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.BRL, prefix='R$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.CAD, prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.AUD, prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.THB, prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.ILS, prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_US', moneyed.TWD, prefix='NT$')\r\n\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.USD, prefix='$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.EUR, suffix=' €')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.JPY, suffix=' ¥')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.SGD, prefix='S$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.MXN, prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.BRL, prefix='R$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.CAD, prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.AUD, prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.THB, prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.ILS, prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition('en_UK', moneyed.TWD, prefix='NT$')\r\n#\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.USD, prefix='$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.GBP, prefix='£')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.EUR, suffix=' €')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.JPY, suffix=' ¥')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.SGD, prefix='S$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.MXN, prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.BRL, prefix='R$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.CAD, prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.AUD, prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.THB, prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.ILS, prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition('sv_SE', moneyed.TWD, prefix='NT$')\r\n#\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.USD, prefix='$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.GBP, prefix='£')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.EUR, suffix=' €')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.JPY, suffix=' ¥')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.SGD, prefix='S$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.MXN, prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.BRL, prefix='R$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.CAD, prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.AUD, prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.THB, prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.ILS, prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition('pl_PL', moneyed.TWD, prefix='NT$')\r\n#\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.USD, prefix='$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.GBP, prefix='£')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.JPY, suffix=' ¥')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.SGD, prefix='S$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.MXN, prefix='MX$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.BRL, prefix='R$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.CAD, prefix='C$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.AUD, prefix='A$')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.THB, prefix='฿')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.ILS, prefix='₪')\r\n# moneyed.localization._FORMATTER.add_sign_definition('de_DE', moneyed.TWD, prefix='NT$')\r\n```"}}
{"actor":{"display_login":"hturksoy"}}