Opened 18 years ago
Closed 17 years ago
#3955 closed (fixed)
compile-messages.py could use LOCALE_PATHS from settings.py
Reported by: | Owned by: | Ilya Semenov | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Why compile-messages.py does not use the LOCALE_PATHS variable defined in settings.py
to define the basedir directory ? Now we are restricted to locale and conf/locale.
Attachments (4)
Change History (14)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 18 years ago
Component: | Translations → Internationalization |
---|
comment:3 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 17 years ago
Attachment: | compile-messages-use-settings-module.diff added |
---|
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 by , 17 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Triage Stage: | Ready for checkin → Unreviewed |
I reopened this ticket because of a bug in r6349.
I have runtime error with compile-messages.py:
Traceback (most recent call last): File "/home/wangchun/src/django/django/bin/compile-messages.py", line 64, in <module> main() File "/home/wangchun/src/django/django/bin/compile-messages.py", line 61, in main compile_messages(options.locale) File "/home/wangchun/src/django/django/bin/compile-messages.py", line 17, in compile_messages basedirs += settings.LOCALE_PATHS File "/home/wangchun/src/cityweekend/lib/django/django/conf/__init__.py", line 32, in __getattr__ return getattr(self._target, name) AttributeError: 'Settings' object has no attribute 'LOCALE_PATHS'
I have attached a patch for this.
comment:8 by , 17 years ago
Agreed. However, they tend to use hasattr()
approach instead of
try/except
in Django code, so the patch should look a bit different.
by , 17 years ago
Attachment: | bugfix-no-locale-paths-in-settings.diff added |
---|
A bugfix to a patch by Wang Chun, uses hasattr() instead of try/except
comment:9 by , 17 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:10 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Good point. This would be a reasonable fix to make: have compile-messages.py also compile PO files under the directories in LOCALE_PATHS.