Forum OpenACS Q&A: lars-blogger internationalization

Collapse
Posted by Oscar Bonilla on
I'm translating the lars-blogger package. Is there a guide for using the acs-lang facilities? Is it only a matter of replacing all fixed strings with [_ lars-blogger.Key]? I'm working on CVS HEAD. BTW, the <trn> tag doesn't seem to work ;(

Regards,

-Oscar

Collapse
Posted by Gaven Eogan on
Hello Oscar

Just found this yesterday. Go to:

/acs-admin/apm/

Click on a package key.

In the Manage section on the package information page click on Internationalisation.

On next page click "Convert ADP, Tcl, and SQL files to using the message catalog."

On this page there is a big guide and some auto functions.

Gaven

Collapse
Posted by Bjorn Thor Jonsson on

There is also a doc in the tree, packages/acs-core-docs/www/i18n.html, but the instructions Gaven points to are probably all you need. And the auto functions are way cool.

Will you be submitting your work? I just internationalized photo-album and lars-blogger was the next package I wanted to process 😉

Collapse
Posted by Rocael Hernández Rizzardini on
Is just like Gaven said, and remember that you usually do not assign any key, just put something like <#_ the sentence#> and it will create automaticly the message key in the catalog (never touch by hand the files in the catalog directory in your package root). Try to translate the whole sentence instead of word by word, in that way we can say that a package is really international because is adapted to any kind for language construction.

If you are dealing with date this might be useful: https://openacs.org/forums/message-view?message_id=70680

Collapse
Posted by Oscar Bonilla on
First of all, thanks to all who responded (Rocaed, the date tip proved most useful). I've finished the translation of lars-blogger to spanish.

Now, how can I export the translated keys to an xml file. This is all I have left to submit the patches.

Regards,

-Oscar

Collapse
Posted by Rocael Hernández Rizzardini on
You should go to the internationalization link, in the APM under your package, and there is a link that says:
#  Export  messages from the database to catalog files

that should do the job, always you can check to have in your catalog directoy a file like lars-blogger.es_ES.ISO-8859-1.xml
I'm not sure if you need to send the catalog files directly to Peter also. They have the translation server.

Collapse
Posted by Oscar Bonilla on
I'm still getting a date in english, but it's comming directly from the database. It's set in a query in /packages/lars-blogger/www/blog-postgresql.xql. I remember reading something about translating dates that came straight from sql, but now I can't seem to find it! Does anyone know how to translate this?
Collapse
Posted by Lars Pind on
Oscar,

This is great! Thanks so much.

Just a word of caution: A number of things have changed on the oacs-4-6 branch, and we're making still more changes just these days (most likely they'll have to go into the 4-6 branch), so there will be some significant merging to be done when we merge oacs-4-6 back to HEAD.

Things are a bit shaky these days, waiting for the big merge. It would be good to get it over with.

/Lars

Collapse
Posted by Oscar Bonilla on
Lars,

I've almost finished the translation (I'm sure I've missed some strings or db queries, but they could be done later). Do you want me to post the patches in this thread and/or submit a bug report and/or mail them directly to you. That way you could commit them before the merge and they would be just another annoyance in the big conflict resolution quest. I tried merging openacs-4 in HEAD but I'm just too new to openacs to really understand which changes from 4.6 should stay in HEAD and which should go ;(

Regards,

-Oscar

Collapse
Posted by Lars Pind on
Oscar,

Please submit it to the the OpenACS bugtracker, and I'll apply it.

https://openacs.org/bugs/

/Lars

Collapse
Posted by Esti Alvarez on
Hi there!

It seems this i18n work was not added to the CVS. We checked out lars-blogger 2 weeks ago or so (version 2.0d3) and it was not internationalized. We have done the work and we thought it  could be interesting to add it for future releases. If so, can someone please tell me what should we do to contribute our work?

Collapse
Posted by Jade Rubick on
If you post it as a patch on the bug-tracker (on the link above), Lars or someone else will apply it.
Collapse
Posted by Esti Alvarez on
Ok, here is the patch:

https://openacs.org/bugtracker/openacs/patch?patch%5fnumber=606

I did a "cvs diff", added the catalog files for english and spanish and packeted everything in a tar file. Is this ok? If not, please tell me.

Note: I did not internationalize the "4 minutes ago"-like messages. They come from util::age_pretty procedure which is not internationalized. I don't really know how to do it to support the big list of languages in openacs. Any suggestions?

Collapse
Posted by Esti Alvarez on
I should have read Submitting a patch till the end before posting. I tried to replace patch file in the above patch, but it does not work, so I have created a new one. This is the right one: https://openacs.org/bugtracker/openacs/patch?patch%5fnumber=607