We have been asked if it is possible to translate some reports to different languages on the fly (from an EN based database).
So my question is, can I translate data stored as ENGLISH into some other language on the fly through the use of a procedure/view/etc?
Anything is possible, its all just software :-)
But it is going to take a bit of work if you want "automatic" translation of english data.
What you will need to do to automatically translate english text into another language is to write an external procedure that takes as input the english text and the language to which you want it translated and it outputs the translated text. Something like:
The external procedure can be written in C/C++, any CLR language, Java, Perl, or PHP... so pick your favourite programming language. You will then need to have a method of doing the actual translation - perhaps sign up for one of those online automatic translation services? (and if you do use an online service, perhaps they have a web service that you could use in which case you can just use SQL Anywhere's client web services capability).
You will also need to be conscious of character set used by the external translation service and to make sure that the database text is converted to the proper charset before sending it to the service - this can easily be done using csconvert().
Alternatively, if what you need to do is be able to translate statically known english text into other languages - e.g. pre-known report titles column names, footnotes, etc. - then a much easier solution is to have a table that contains all of your text strings in each of the languages that you need to support. E.g.
You will then need to change your app to not use static strings for any english text, but to pull the text from this table.
The table method is what is used in a number of application - e.g. the Check-for-updates system, and the Nexus (aka dbsupport) system.
answered 12 Mar '10, 14:52