Django

Code

Ticket #3955 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

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

Reported by: Olivier Ricou <ricou@altribe.net> Assigned to: semenov
Milestone: Component: Internationalization
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

compile-messages-use-settings-module.diff (3.0 kB) - added by semenov on 09/15/07 03:30:29.
bugfix_for_r6349.diff (1.0 kB) - added by Wang Chun <wangchun@exoweb.net> on 09/26/07 03:15:57.
bugfix for r6349
bugfix_for_r6349.2.diff (1.1 kB) - added by Wang Chun <wangchun@exoweb.net> on 09/26/07 03:23:13.
bugfix for r6349
bugfix-no-locale-paths-in-settings.diff (1.1 kB) - added by semenov on 09/26/07 06:40:43.
A bugfix to a patch by Wang Chun, uses hasattr() instead of try/except

Change History

04/07/07 22:24:48 changed by mtredinnick

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

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

04/09/07 08:18:52 changed by mtredinnick

  • component changed from Translations to Internationalization.

09/14/07 16:35:56 changed by semenov

  • owner changed from nobody to semenov.
  • status changed from new to assigned.

09/14/07 17:59:25 changed by semenov

  • has_patch set to 1.
  • stage changed from Accepted to Ready for checkin.

Here it goes.

09/15/07 03:30:29 changed by semenov

  • attachment compile-messages-use-settings-module.diff added.

09/15/07 22:17:48 changed by mtredinnick

  • status changed from assigned to closed.
  • resolution set to fixed.

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

09/26/07 03:15:57 changed by Wang Chun <wangchun@exoweb.net>

  • attachment bugfix_for_r6349.diff added.

bugfix for r6349

09/26/07 03:16:33 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.
  • stage changed from Ready for checkin to 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.

09/26/07 03:23:13 changed by Wang Chun <wangchun@exoweb.net>

  • attachment bugfix_for_r6349.2.diff added.

bugfix for r6349

09/26/07 03:24:06 changed by Wang Chun <wangchun@exoweb.net>

sorry, stupid mistake...

plz use bugfix_for_r6349.2.diff instead.

09/26/07 06:39:49 changed by semenov

Agreed. However, they tend to use hasattr() approach instead of try/except in Django code, so the patch should look a bit different.

09/26/07 06:40:43 changed by semenov

  • attachment bugfix-no-locale-paths-in-settings.diff added.

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

09/26/07 06:41:17 changed by semenov

  • stage changed from Unreviewed to Ready for checkin.

10/02/07 22:19:15 changed by mtredinnick

  • status changed from reopened to closed.
  • resolution set to fixed.

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


Add/Change #3955 (compile-messages.py could use LOCALE_PATHS from settings.py)




Change Properties
Action