Home
The Toolkit for Online Communities
15901 Community Members, 0 members online, 2421 visitors today
Log In Register

Forum OpenACS Q&A: problems with lang::util::localize

OpenACS Home : Forums : OpenACS Q&A : problems with lang::util::localize

Icon of Envelope Request notifications

+
Posted by Peter Alberer on
i have some problems with message keys not being translated to catalog-texts properly. here is an example:

set text {
<a href="/">Main Site</a> : <a href="/dotlrn/">MESSAGE KEY MISSING: 'tlf-basic.dotlrn'</a> :
<a href="/dotlrn/classes/">MESSAGE KEY MISSING: 'dotlrn.classes_pretty_plural'</a> : MESSAGE KEY MISSING: 'dotlrn.classes_pretty_plural'
}

set html "Text 1: [lang::util::localize $text]\n"

set text {
<a href="/">Main Site</a> : <a href="/dotlrn/">MESSAGE KEY MISSING: 'tlf-basic.dotlrn'</a> : Verwalten
}

append html "Text 2: [lang::util::localize $text]\n"

ns_return 200 "text/plain" $html

-------------------------------------------

this code produces:

Text 1:
<a href="/">Main Site</a> : <a href="/dotlrn/">MESSAGE KEY MISSING: 'tlf-basic.dotlrn'</a> :
<a href="/dotlrn/classes/">MESSAGE KEY MISSING: 'dotlrn.classes_pretty_plural'</a> : Kursvorlagen

Text 2:
<a href="/">Main Site</a> : <a href="/dotlrn/">Mein Portal</a> : Verwalten

-------------------------------------------

as you can see, some message keys are translated and others are not (in text 2 the key MESSAGE KEY MISSING: 'tlf-basic.dotlrn' is substituted, but in text 1 it is not). i had a look at
lang::util::localize which i think is responsible for that but could not find the problem. does anyone had similar problems and more experience with lang::util::localize?

thanks, peter