Opened 20 years ago

Closed 19 years ago

#3955 closed (fixed)

compile-messages.py could use LOCALE_PATHS from settings.py

Reported by: Olivier Ricou <ricou@…> 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)

compile-messages-use-settings-module.diff​ (3.0 KB ) - added by Ilya Semenov 19 years ago.
bugfix_for_r6349.diff​ (1.0 KB ) - added by Wang Chun <wangchun@…> 19 years ago.
bugfix for r6349
bugfix_for_r6349.2.diff​ (1.1 KB ) - added by Wang Chun <wangchun@…> 19 years ago.
bugfix for r6349
bugfix-no-locale-paths-in-settings.diff​ (1.1 KB ) - added by Ilya Semenov 19 years ago.
A bugfix to a patch by Wang Chun, uses hasattr() instead of try/except

Download all attachments as: .zip

Change History (14)

comment:1 by Malcolm Tredinnick, 20 years ago

Triage Stage: Unreviewed → Accepted

Good point. This would be a reasonable fix to make: have compile-messages.py also compile PO files under the directories in LOCALE_PATHS.

comment:2 by Malcolm Tredinnick, 20 years ago

Component: Translations → Internationalization

comment:3 by Ilya Semenov, 19 years ago

Owner: changed from nobody to Ilya Semenov
Status: new → assigned

comment:4 by Ilya Semenov, 19 years ago

Has patch: set
Triage Stage: Accepted → Ready for checkin

Here it goes.

by Ilya Semenov, 19 years ago

comment:5 by Malcolm Tredinnick, 19 years ago

Resolution: → fixed
Status: assigned → closed

(In [6349]) Fixed #3955 -- Added the ability to traverse LOCALE_PATHS when compiling PO files. Thanks, semenov.

by Wang Chun <wangchun@…>, 19 years ago

Attachment: bugfix_for_r6349.diff​ added

bugfix for r6349

comment:6 by anonymous, 19 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.

by Wang Chun <wangchun@…>, 19 years ago

Attachment: bugfix_for_r6349.2.diff​ added

bugfix for r6349

comment:7 by Wang Chun <wangchun@…>, 19 years ago

sorry, stupid mistake...

plz use bugfix_for_r6349.2.diff instead.

comment:8 by Ilya Semenov, 19 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 Ilya Semenov, 19 years ago

A bugfix to a patch by Wang Chun, uses hasattr() instead of try/except

comment:9 by Ilya Semenov, 19 years ago

Triage Stage: Unreviewed → Ready for checkin

comment:10 by Malcolm Tredinnick, 19 years ago

Resolution: → fixed
Status: reopened → closed

(In [6447]) Fixed #3955 -- Handled the case when there is no LOCALE_PATHS setting from [6349]. Thanks, Wang Chun and semenov.

Note: See TracTickets for help on using tickets.
Back to Top