Forum OpenACS Development: acs-lang: lang::util::localize executed too often

lang::util::localize is executed on my site(s) running oacs-5-1 on every variable, yielding interesting results:

a) If a variable value starts with "-", the page breaks, as this value is treated as a switch to lang::util::localize (totally screwing up project-manager, as Jade made heavy use of it like in "--no customer--").

b) If you use Spell Checking, the variables returned from aspell are treated as "message keys" and are considered missing.

c) Even the documentation on lang::util::localize is not correctly displayed as it reads in the first sentence "Takes a string with embedded message keys on the format MESSAGE KEY MISSING: 'message_key_name' and returns the same string".

I have the distinct feeling that something during the last upgrade process went wrong, but I can't point my finger to it and I seriously hope anyone can shed some light on it.

I'm not posting this as a bug, as I assume this is a local problem and not a general one with the toolkit (as people would have screamed up otherwise).

Collapse
Posted by Malte Sussdorff on
One more bit of information. The problem described in a) does occur when displaying information e.g. in a listbuilder template (see the "--no customer--" example, which is displayed as an element in the table generated by listbuilder). If an option in a select box is labeled e.g. "--All Categories--", it works just fine.
Collapse
Posted by Jeff Davis on
This happens because daveb addded a flag to the function when it did not used to have one.
Add optional -locale parameter to lang::util::localize. Defaults to [ad_conn locale]
I think we should back out the change since it has pervasive negative consquences. Here is the commit: 1.32.2.3
Collapse
Posted by Dave Bauer on
I'll fix that. I tried to give it an optional unamed parameter, but could not get that to work. It will temporarily break dotlrn upgrades, but I'll figure out an alternative.