Forum OpenACS Development: Forms and localization

Collapse
Posted by Emmanuelle Raffenne on
Hi all,

Localizing a form, we ran into the following inconsistency?:

- To localize a label text in the elements list, the "#" has to be used

- To localize the help_text, the "_" function has te be used. If "#" are used, they'll show up as "#" since the help_text is quoted.

Both are texts (as opposed to form fields) so you would expect to use the same method to localize them. The difference is that help text is rendered using a template tag whereas label not.

Is there a way to fix that?

Collapse
2: Re: Forms and localization (response to 1)
Posted by Dave Bauer on
The _ proc should work for the label as well.

I use it exclusively.

Interpolating # in variables leads to issues if someone starts any content with # I try to always use the _ proc in a tcl script.

Using # in the ADP file explicitly is fine,

Collapse
3: Re: Forms and localization (response to 2)
Posted by Emmanuelle Raffenne on
Oh ok. The trick is to enclose it by quotes "[_ ...]". I missed that detail in the help text.

Thanks Dave

Collapse
4: Re: Forms and localization (response to 1)
Posted by Dave Bauer on
Yes I get caught with that almost every time. its a list, so without it you get two list elements [_ and package.message]