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 #1733 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

i18n does not collect strings from genshi templates

Reported by: alexandre Owned by: anonymous
Priority: normal Milestone: 1.1
Component: TurboGears Version: 1.0.4.3
Severity: normal Keywords: i18n, genshi
Cc:

Description

i18n does not collecting strings for genshi templates

Change History

comment:1 Changed 6 years ago by Chris Arndt

  • Milestone changed from 1.0.x bugfix to 1.1

See also #1795.

comment:2 Changed 6 years ago by faide

  • Milestone changed from 1.5 to 1.1

comment:3 Changed 6 years ago by faide

We need to

  1. Look for Genshi files (*.html) when collecting.
  2. Implement an equivalent of the command.i18n.InternationalizationTool?.scan_kid_files method.

comment:4 Changed 6 years ago by dbrattli

I think it would make sense to (re)use Babel ( http://babel.edgewall.org/) to collect strings for TurboGears projects. I've used Babel with TurboGears for quite some time now and it works perfectly. I don't use tg-admin i18n, but the distutils/setuptools integration of Babel ( http://babel.edgewall.org/wiki/Documentation/0.9/setup.html). So I think it would be better to make Babel collect Kid files than to make TurboGears collect Genshi files. Or Just leave the tg-admin i18n interface for old kid projects and make new Genshi based projects use Babel for collecting strings. I don't think anybody uses both kid and genshi in their projects?

comment:5 Changed 6 years ago by faide

What about the web interface to our i18n collector? Would you envision to replace the existing interface with some working babel code?

That would be great. Would you mind helping on this?

comment:6 Changed 6 years ago by dbrattli

Web interface? Wow, I forgot about that one, it's been a while. Looks like it has it's own string collecting functions. Thus there are 3 different ways of collectings strings:

1) admi18n 2) tg-admin 3) babel.

Much of this could be replaced with babel code. I just checked with babel, and I was able to collect strings from kid templates as well, but there are some differences between genshi and kid e.g lang vs xml:lang, but it should not be hard to write a custom kid extractor for babel if needed. I guess TG-1.5 would be the best target for such a project!?

comment:7 Changed 6 years ago by faide

Yeah sure 1.5 would be more reasonable. Would you be interested in helping in this endeavour?

comment:8 Changed 6 years ago by faide

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

I implemented a Genshi extractor to make everything work as it is right now in tg1.1

My idea is to refactor some more the i18n gettext functions. When it's done we can replace the collector by Babel completely in the command line and in the webinterface which will be the same anyway.

Right now we can close this ticket. I opened a new ticket (#2042) for the remaining task.

comment:9 Changed 6 years ago by Chris Arndt

Faide's new Genshi string extraction implementation is in r5704 and r5706.

Note: See TracTickets for help on using tickets.