Forum OpenACS Q&A: Internationalization of OpenACS 4.5

Collapse
Posted by Jun Yamog on
Hi,

I just would like to know what is the state/status of the
internationalization of OpenACS 4.5?  I have tried to search the forum
what I got is more in 3.x

From what I know OpenACS 4.5 does not support it out of the box.  What
does it take to have a site talk Nipongo (Japanese).  Apply the
unicode patch to aolserver, can somebody give me who did this and
where can I get it?  Make sure that postgres is compiled with unicode
support.  What else do I need?

Can someone give me links to the thread that has good discussion about
this?

Thanks for the help

Collapse
Posted by David Kuczek on
Hello Jun,

this might help you although we are using latin1...

https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=00044O

Collapse
Posted by Don Baccus on
How about trying it? :)

I'm working on a client project that needs to support internationalization.  We're not to the point of needing that to work yet but will be there in a matter of weeks.  So you can bet that this is going to work by summer, come hell or high water as we say here in the States ...

Collapse
Posted by Tilmann Singer on
AFAIK aolserver 3.3ad13 already contains the unicode patch, so nothing has to be done for aolserver when you can use this version.

Besides compiling postgres with unicode support also make sure that your oacs database is actually unicode encoded, e.g. with createdb -E unicode yourdbname. (psql -l lists all databases and their encoding).

The following is rather speculative because I never tried that myself: if you need specific sort orders in postgres then take care to set the locale while doing initdb (initdb is called right after installation, so this cannot be changed later without destroying all your databases). E.g. after installation do a "LC_ALL=de_DE initdb".

Allegedly this slows down postgres quite a bit, and I wonder if it works with OpenACS at all. There were some issues with tree_sortkey requiring sort order of LOCALE=C, but I guess since this is not character based anymore it is not a problem anymore (Don?).

For multilingual sites there is the acs-lang package, which provides message catalog functionality. It is far from finished (lots of UI missing), but since there is a lot of interest here this is propably going to be improved sooner or later.

Date formatting is often hard coded in the toolkit with the plpgsql to_char() function (in postgres). I am going to grep for the most commonly used formats and will suggest to write some centrally defined functions instead (really soon).

Collapse
Posted by Jun Yamog on
Thanks guys for the responces.  I may use my favorite toolkit for the site and hopefully get to contribute something to OpenACS.
Collapse
Posted by Don Baccus on
The performance issue with Postgres is only that expressions like:

string_row like 'foo%'

won't use the index on string_row if you've enabled locale support.  The problem is that indexing this relies on being able to translate the "like" into roughly:

string_row between 'foo' and ('foo' || -the-biggest-character-)

unfortunately there's no simple way to know what "the biggest character" is if locale support is enabled.

Regular operations like "string_row = 'foo'" can use an index on string_row.

So for "normal" code, this isn't a big deal.

The current PG tree_sortkey implementation uses varying bitstrings and is fully indexed regardless of locale support.  So I don't think enabling locale support will seriously impace the performance of an OpenACS 4.5/PG site.

Collapse
Posted by Don Baccus on
I should also add that acs-lang, though primitive, works well enough.  The client site I'm working on uses it for all pages, because it's a truly multilingual site.  Everything, including graphics with embedded text, will change depending on the user's language.

This stuff works fine...

Collapse
Posted by Ola Hansson on
acs-lang works well enough on ORACLE, you mean? Or is the Postgres version working well enough too?

I tried the PG version some time ago and ran into an error or two while clicking through the links on the index page of acs-lang. But then again, the functionality I found broken may have been some of the not-so-essential parts for getting a basic multilingual site going.

Sooner or later, depending on the nature of the message catalog UI (which I've read exists but not yet found in PG), I'm planning on translating at least the modules I personally use into Swedish.

Will it require much work on the level of the individual modules to run a site in a language other than english?

Collapse
Posted by Don Baccus on
I get errors in the Oracle version when clicking around, too.

But the basic functions like _mr (message register) and _ (translate) are working in Oracle.  Don't know about PG.

I've just barely begun playing with this.  The client's technical person, Bruno Mattarollo (who posts here), knows more about it than me at this point.

Collapse
Posted by Henry Minsky on
I have built several sites that work in Japanese using OpenACS  (v 3 and 4)
and Postgres 7.1 and 7.2.

The info in the above discussion is on the right track.

I have posted some messages before with copies of
the tcl init file needed to set the default
character set and MIME types.

I will try to collect that stuff up on a single web page
that can go someplace easy to find (like on openacs.org).

See
https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0002Uv

Example config file (acs 3)
http://www.ai.mit.edu/people/hqm/openacs/acs3-pg.tcl

Kana conversion routines (half width to full width)
https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0002T4

There may be some issues with .adp pages -- the issue was that
AOLserver's adp parser would assume the .adp source file
was encoded as UTF8. The workaround was to modify ACS's
adp parsing code to explicitly load the .adp file source
using a specific encoding (such as Shift JIS) based on the
defined MIME type for .adp files, and then pass the resulting
string to AOLserver's adp parser using the -string option.

The acs-lang package contains a file with a set of patches which
tweak the request processor. I am not sure if those patches
are now merged in with the ACS acs-tcl core procedures, or if it
is still necessary to apply them manually when installing the
acs-lang package.

Collapse
Posted by Jun Yamog on
Thanks Henry.

I am now confident that the we can implement the site in Japanese since you have already set the lead on it.  I hope we can put up something in the openacs.org file repository regarding this or better have OpenACS 4.5 patched.

Collapse
Posted by Henry Minsky on
Send me a note if you have any problems with Japanese encoding support, I can tell
you lots (and lots) about it!