Forum OpenACS Development: i18n of util::age_pretty (acs-tcl)

I'm doing a mockup to improve the openacs forums (adding some navigation links to go next/prev thread, giving a new look, adding ratings, and stuff like that). I have used the util::age_pretty function to show a more friendly time info for recently posted messages, for instance, something like: "posted about 2 hours ago" or "posted yesterday".

I'd like to have that information also in spanish, I mean, internationalized, but that function (in tcl/utilities-procs.tcl of acs-tcl package) although has some i18n strings, there are also a few one in english, for instance: "minutes", "ago"...

I've tried to catch these strings through the Internationalize Package action on translation server, but I couldn't find them.

Even if I had could do it, that strings should be "translated" using tcl variables in order to shift "the value of time" and the "ago" word (in spanish they go: hace... dos horas) , so maybe it's no so easy like changing the translation server.

How should I do that translation? I mean, maybe that change is suppose to be done by a more experimented programmer, or someone more close to openacs core. Anyway, I have posted that issue in order to fix it.

Collapse
Posted by Victor Guerra on
Hi Miguel,

Yes.. those words need to be translated ( need to create message keys for those messages ).
You can read the documentation about Internationalization in the toolkit at chapter 16 of the documentation.

But there is a catch here. You have to be careful with this because in english you have expresion "2 minutes ago".. for example.. and in spanish : "hace.. 2 minutos" so, if you just change the words with message keys you will end up with a translation like this: "2 minutos hace". So maybe the way to go should be to create a message key with the variable result included; for example:
message key for english: "%result% ago"
message key for spanish: "hace .. %result%"

Collapse
Posted by Raúl Morales Hidalgo on
Hi Victor,

What Miguel asks is not how to do it :), he just asks if he can do the internationalization and just commit it or if it should be approved by OCT before committing as acs-tcl is part of acs-core.

Collapse
Posted by Victor Guerra on
sorry.. I misunderstood him.
But if you can send me a patch for it.. I can test it and commit it.