maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] [PATCH 1/3] Explain the workaround for Django makem


From: Jeroen van Rijn
Subject: Re: [Maposmatic-dev] [PATCH 1/3] Explain the workaround for Django makemessages bug
Date: Mon, 2 Apr 2012 23:03:50 +0200

On Mon, Apr 2, 2012 at 22:35, Thomas Petazzoni <address@hidden> wrote:
@@ -43,3 +43,10 @@ WARNING: There is a known bug in Django makemessages 1.2.x (and maybe
         signs in .po files must be replaced by single % signs. This
         is typically needed for the Wikipedia URL pointing to the
         Hacker culture.
+
+         In order to workaround this bug, we recommend running:
+
+         find locale/ -name 'django.po' | xargs sed -i 's/%%/%/g'
+
+         after the execution of the makemessages command.


I'm wondering if we might not be able to use a convenience wrapper around django-admin.py? It's a pretty short script as it is.

#!/usr/bin/env python
from django.core import management

if __name__ == "__main__":
    management.execute_from_command_line()

    if management.get_version == '1.2':
       import sys
       if 'makemessages' in sys.argv:
       ...... walk tree using find / sed, or the python equivalent

That is if we know which django versions exhibit this behaviour, a small script like this derived from django-admin.py could do away with this warning in README. Given that people in general don't tend to Read The Fine Manual, it might be something worth considering?

Regards,
Jeroen

--
BA[Start]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]