Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2039 (closed task: fixed)

Opened 10 years ago

Last modified 9 years ago

Need to provide translation context in the genshi extractor

Reported by: faide Owned by: faide
Priority: normal Milestone: 1.1.1
Component: TurboGears Version: 1.0.7
Severity: normal Keywords: needs patch
Cc:

Description

at the moment the context is not provided (see TODO in source)

Change History

comment:1 Changed 10 years ago by faide

  • Status changed from new to assigned

comment:2 Changed 10 years ago by Chris Arndt

Which module is this? Can you please provide a link to the TODO item in the source?

comment:3 Changed 10 years ago by faide

line 520 in turbogears/i18n/pygettext/pygettext.py

comment:4 Changed 10 years ago by Chris Arndt

  • Keywords needs tests added

Fixed in r5799.

Strings from Genshi templates with inline Python expressions are collected but only translated correctly when they are at the start or end of the translatable string. The cause for this needs to be examined, but is maybe a limitation of genshi.filters.i18n.Translator?

comment:5 Changed 10 years ago by faide

I see you jumped ahead and used the Translator provided from Genshi. This is nice! I intended to use this during my next iteration but now this is one more thing I won't have to do. Thx.

comment:6 Changed 10 years ago by Chris Arndt

  • Milestone changed from 1.1b4 to 1.1

comment:7 Changed 10 years ago by Chris Arndt

  • Keywords patch added; tests removed

r5799 was actually about collecting strings from Genshi templates. We still need to inject the gettext translation function into the template namespace, if we want to allow the use of explicit gettext function calls in Genshi templates.

comment:8 Changed 10 years ago by Chris Arndt

  • Milestone changed from 1.1 to 1.1.x bugfix

Moving to 1.1.x bugfix release in preparation for 1.1rc1 release.

comment:9 Changed 9 years ago by Chris Arndt

  • Milestone changed from 1.1.x bugfix to 1.1.1

comment:10 Changed 9 years ago by Chris Arndt

  • Status changed from assigned to closed
  • Resolution set to fixed

The _ gettext function is now added to the template namespace in turbogears.view.stdvars so it is available in Genshi templates too, since Genshi apparently does clears the builtins (r6978).

Note: See TracTickets for help on using tickets.