﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33440	Cannot escape % character when using gettext().	Stian Jensen	nobody	"Reproduce:
Write something like `gettext('This item is 50% off!')`

run ./manage.py makemessages -a

find the string in the .po file and translate it like this:

#: templates/test.html:2
#, python-format
msgid ""This item is 50% off!""
msgstr ""Denne har 50% rabatt!""

run ./manage.py compilemessages

get this error message:

Execution of msgfmt failed: /Users/stiaje/Projects/django-backend/app/hyre/locale/nb/LC_MESSAGES/django.po:601: format specifications in 'msgid' and 'msgstr' for argument 1 are not the same

It works if the letter after the percentage is o in all languages, but fails otherwise.

I tried escaping the percentage symbol as %%, but that resulted in %% being outputted on runtime.

I tried using \u00e0 instead, but that gave:

Execution of msgfmt failed: /Users/stiaje/Projects/django-backend/app/hyre/locale/nb/LC_MESSAGES/django.po:980:36: invalid control sequence

I see that a very similar issue has been reported before, but it is closed, with a comment saying to open a new issue for followups:
https://code.djangoproject.com/ticket/11240

I can make compilemessages work by manually removing python-format from the strings with %, but makemessages will just add that back the next time I run it."	Uncategorized	closed	Internationalization	3.2	Normal	invalid		Claude Paroz Ramiro Morales	Unreviewed	0	0	0	0	0	0
