﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	parents
667	Use lazy_pass_to_ugettext for forms	Elrond	aditi	"(This might be a dupes, but I could not find it.)

To translate forms, we currently go the following route:

* Mark strings as translatable (only mark, do nothing else)
* wtforms keeps them for us
* Our field rendering tools render the complete field nearly completely ba hand to be able to translate it there. Using standard translation tools there.

This works, mostly. It does not work to translate elements of a select box, for example a title like ""- Select Collection -"". Because we only mark it, but we're not using our translation tools in the rendering. We could go for rendering that part by hand also.

BUT: wtforms recommends something else:

* Use {{{lazy_pass_to_ugettext()}}} to mark and create a autotranslating object. This feels like a string, but really becomes a translated string, when it is forced to a real string.
* wtforms keeps this thing as a normal object around.
* When rendering it, wtforms will force it to a string as late as possible, so that translations can take effect.

So the first idea is to mark strings using {{{lazy_pass_to_ugettext()}}} and just disable the translation in our rendering tools (just remove the {{{_()}}}!) and see, how it works out.

Old in any `forms.py`:
{{{
from mediagoblin.tools.translate import fake_ugettext_passthrough as _
}}}
New:
{{{
from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
}}}"	enhancement	closed	minor		programming	fixed	bitesized sprint	Christopher Allan Webber	
