Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1182 closed enhancement (wontfix)

[patch] make-messages.py duplicates strings already translated in sub-directories

Reported by: akaihola Owned by: hugo
Component: Internationalization Version:
Severity: trivial Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Apps with app-specific translations must reside outside the project tree so make-messages.py won't traverse them when constructing the project gettext catalog.

The attached patch removes the need for this trick by not traversing ./apps by default. A "-p" option is included for the old behavior. The usage message is also improved.

Attachments (2)

make-messages-exclude-apps.diff (1.6 KB) - added by akaihola 9 years ago.
make-messages-exclude-existing.diff (820 bytes) - added by akaihola 9 years ago.
re-thought implementation looks for .po files and excludes directories based on that

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by akaihola

comment:1 Changed 9 years ago by hugo

  • Resolution set to wontfix
  • Status changed from new to closed

Hmm. I don't think that is really needed. Apps that reside within a project should be translated with the project - and apps that should have their own translation should be stored outside the project. I think that's simple enough. Most definitely I won't like the default of make-messages.py to be to skip a folder just because it is named "apps" - that's some implicit rule that isn't obvious to users.

comment:2 Changed 9 years ago by akaihola

  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from [patch] make-messages.py needs tricks to exclude apps to [patch] make-messages.py duplicates strings already translated in sub-directories

The reason I wanted this functionality is that I really like to separate translations of different parts in my project into their own files. It also makes things much easier if I want to copy an app to another project or to a shared location.

I re-thought the implementation and my patch to make-messages.py now automatically excludes any directories which contain the locale/<langcode>/LC_MESSAGES/<domain>.po file. I think it makes sense to not duplicate strings which are already found.

I'm sorry if I'm insisting too much...

Changed 9 years ago by akaihola

re-thought implementation looks for .po files and excludes directories based on that

comment:3 Changed 9 years ago by adrian

  • Component changed from Tools to Internationalization
  • Owner changed from adrian to hugo
  • Status changed from reopened to new

Hugo, what do you think of this?

comment:4 Changed 9 years ago by hugo

I still think that applications within the project directory should be translated with the project, while separately translated applications should be outside - looking at project directory layout to decide what parts of the directory to traverse sounds a bit hackish to me.

comment:5 Changed 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

I defer to Hugo's judgment on this one, so I'm closing as wontfix. See his comment above.

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