OS/2, eCS & ArcaOS - Technical > Programming
[Classic Rexx] Translation database
(1/1)
Jan-Erik Lärka:
I've created a script to assemble words and phrases into a database (sqlite3) that can be viewes with DB Browser for SQLite (A huge Thank you TeLLie! for porting it!).
One just need to type
--- Code: ---set mode=INIT
--- End code ---
and then
--- Code: ---T2NLV
--- End code ---
It use wget to download a dictionary from wikdict (default english to the language your system run as) so it not aimed at those that use en_US or en_UK or similar.
It then build a database and feed the data to it.
The script can also handle translations by Goran Ivankovic such as .DCT and .INI but also .MSG files.
I've included (though renamed .DCT files provided in Gorans translation tool for reference).
--- Code: ---set mode=IMPORT
--- End code ---
and then
--- Code: ---T2NLV en-sv.DCT
--- End code ---
(change "sv" for your language if available)
Do not try to feed it the file "Words.txt" unless you're ready to let it spend (a lot of) time fetching translations from google.
I would appreciate your help to improve the script and database!
How about a translation tool to go with it to manage all the translation it should be able to swallow.
For those interested may want to poke on it and look att the table "CLASSIFICATION" as well.
Type
--- Code: ---Set fromlang=fr
--- End code ---
to set the source language by hand
or
--- Code: ---Set tolang=nl
--- End code ---
to set destination language by hand.
Test and create a function on the side in another script that output numerals, so such words in the database can be classified.
That code has to be added, but the db contain them already.
rxNumerals: PROCEDURE EXPOSE this.
IF ARG(1) = 0 THEN
RETURN 'zero'
IF ARG(1) < 20 THEN
RETURN WORD( 'one two three four ...
Jan-Erik Lärka:
You need two files if you want to add text from .msg and .ini files, one with the source language and another built the same way but with text for the destination language.
The script handle missing translations, but may require a watchful eye afterward.
Please do provide an url (and possibly code) or two, for other translation services than google one could use (as backup) as well.
See the script for one code example as of now.
It would also be very convenient if one could add support for more file formats... perhaps system specific files?!
OS/2 system files often need to be disassembled before one can extract the useful stuff.
Do explore and present command line resource (de)compilers along with other tools and scripts to extract text.
The translation team have the knowledge and it would be most useful if they'd share it and we could include such info into a tool so not everyone need to be a rocket scientist, on top of everything else, but can focus on writing good translations.
Jan-Erik Lärka:
Time is up!
Here's the update that add Numerals.
This now also show the word for to_language for prefix, suffix, language and numerals.
The view PHRASE_VW has been adjusted to allow that.
What files should one take on next?
Hmmm, lip packages while we're at it?
Navigation
[0] Message Index
Go to full version