{"push_id":634047858,"size":2,"distinct_size":2,"ref":"refs/heads/doug/rebase","head":"9b7d58020e49e3779d4a24c229fa2907d5264f19","before":"eedadb537fb4e0b37960d94c750ac43009ed71c4","commits":[{"sha":"ad51ee340bd7e1160abc8250d57ced2e92be3eb1","author":{"email":"0798ebecfb7bc4dfb9d0445c2fa030eb64e1fa1c@douglasbeck.com","name":"Doug Beck"},"message":"Refactored tests to use a sample project, captures #24257","distinct":true,"url":"https://api.github.com/repos/beck/django/commits/ad51ee340bd7e1160abc8250d57ced2e92be3eb1"},{"sha":"9b7d58020e49e3779d4a24c229fa2907d5264f19","author":{"email":"0798ebecfb7bc4dfb9d0445c2fa030eb64e1fa1c@douglasbeck.com","name":"Doug Beck"},"message":"Fixed tokenization and translation of strings with percents, closes 24257\n\nThere seems to be a fundamental misunderstanding of how xgettext works.\n\n* xgettext does not label all strings with percent signs as \"python-format\"\n* any string that is python-formatted must use `%%` for standalone\n  percent signs, otherwise python will blow up.\n\nA standalone percent sign:\n```bash\necho 'gettext(\"%\");' | xgettext --language=python --output=- -\n```\nCreates a regular (non python-formatted) catalog entry:\n```po\nmsgid \"%\"\nmsgstr \"\"\n```\n\nUsing substitution:\n```bash\necho 'gettext(\"%s\");' | xgettext --language=python --output=- -\n```\ncreates python-formatted:\n```po\n\\#, python-format\nmsgid \"%s\"\nmsgstr \"\"\n```\n\nUsing both:\n```bash\necho 'gettext(\"% %s\");' | xgettext --language=python --output=- -\n```\ncreates a broken python-formatted:\n```po\n\\#, python-format\nmsgid \"% %s\"\nmsgstr \"\"\n```\n\nWhen a template is parsed, a string like \"\"{{name}} said 10%\" will be\ntokenized into \"%(name)\" and \" said 10%\". When the tokens are joined, the\ncurrent logic does not evalualte join compatibility. This being the case,\nit is important to ensure all strings with a percent sign get python-formatted.\n\nIf the first `%` is not corrected to a `%%` then python will throw a\n\"TypeError: not all arguments converted during string formatting\" or\n\"ValueError: unsupported format character\".","distinct":true,"url":"https://api.github.com/repos/beck/django/commits/9b7d58020e49e3779d4a24c229fa2907d5264f19"}]}