Author Topic: [Classic Rexx] Translation database  (Read 2318 times)

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 341
  • Karma: +7/-0
    • View Profile
[Classic Rexx] Translation database
« on: May 25, 2025, 10:50:24 pm »
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: [Select]
set mode=INITand then
Code: [Select]
T2NLV
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: [Select]
set mode=IMPORTand then
Code: [Select]
T2NLV en-sv.DCT(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: [Select]
Set fromlang=frto set the source language by hand
or
Code: [Select]
Set tolang=nlto 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 ...
« Last Edit: May 29, 2025, 05:14:52 pm by Jan-Erik Lärka »

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 341
  • Karma: +7/-0
    • View Profile
Re: [Classic Rexx] Translation database
« Reply #1 on: May 26, 2025, 12:44:19 pm »
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

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 341
  • Karma: +7/-0
    • View Profile
Re: [Classic Rexx] Translation database
« Reply #2 on: May 26, 2025, 10:27:35 pm »
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?