home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Magazin: Amiga-CD 2000 April & May
/
AMIGA_2000_04.iso
/
patches
/
ftransapi
/
arexx
/
ftransamirc.amirx
next >
Wrap
Text File
|
1999-09-22
|
3KB
|
122 lines
/*
-----------------------------------------------
Amirc Translator By FTranslator Client
Script by Cristian Robert Gallas
Tested with Amirc 2.2
Usage:
Use in ARexx interface of Amirc
$VER: FTransAMIRC.amirx v1.1 (25.09.99)
-----------------------------------------------
HISTORY
-----------------------------------------------
v0.01b [11.08.98] - First public beta version;
v1.0 [01.05.99] - Added new options;
v1.1 [25.09.99] - Modified to FTrans 1.2 API;
-----------------------------------------------
[Steps installation]
> Go to Amirc Configuration
> Create a new button
> Name of button [Port->Eng] (example: Portugues to English)
> /rx FTransAmirc.amirx 3 (3 is a translation direction)
> Select text click [Port->Eng] and see! :)
0 - English to Francais
1 - English to Deutsch
2 - English to Italiano
3 - English to Portugues
4 - English to Espanol
5 - Francais to English
6 - Deutsch to English
7 - Italiano to English
8 - Espanol to English
9 - Portugues to English
*/
Options Results
tmpfile = 'Ram:FTransTmp.AMIRC'
tmpclip = 'Ram:FTransAmirc.Clip'
ARG traduz
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30) then
exit
if ~show(l, "rexxtricks.library") then
if ~addlib("rexxtricks.library", 0, -30) then
exit
/* TESTA SE O PROGRAMA JA NAO ESTA COM A PORTA DE TRADUCAO ABERTA */
if exists(tmpfile) then do
cecho('FTranslation port is open! Translation in progress, wait...')
exit
end
/* COLOCA COMO DEFAULT PORTUGUES TO ENGLISH */
if traduz = "" then do
/* LE INFORMACOES SOBRE A TELA CORRENTE */
"INFO screen"
pubs='"'||result||'"'
if pubs= '""' then pubs='"Workbench"'
cecho('DIRECTIONS:')
cecho('')
cecho(' 1 - English to Francais')
cecho(' 2 - English to Deutsch')
cecho(' 3 - English to Italiano')
cecho(' 4 - English to Portugues')
cecho(' 5 - English to Espanol')
cecho(' 6 - Francais to English')
cecho(' 7 - Deutsch to English')
cecho(' 8 - Italiano to English')
cecho(' 9 - Espanol to English')
cecho(' 10 - Portugues to English')
traduz = rtezrequest("Select the direction to translate", "1|2|3|4|5|6|7|8|9|10|Cancel",,'RT_PUBSCRNAME='pubs)
if(traduz = 0) then do
cecho('FTrans canceled...')
exit
end
traduz = traduz - 1
end
/* LE O CLIPBOARD COM UMA FUNCAO DO AREXXTRICKS */
sel = ReadClipboard(0)
call open(1, tmpclip, 'W')
call writeln(1, sel)
call close(1)
/* EXECUTA O FTRANSLATOR COM OS ARGUMENTOS DA TRADUCAO */
cecho('FTranslator^Amirc plugin v0.01')
cecho('Waiting, initiating Freedom translation...')
comando = 'C:FTranslator -f "'tmpclip'" -d 'traduz' SILENCE > 'tmpfile
Address Command comando
delete(tmpclip)
goodopen=open(1, tmpfile, 'R')
linein = ''
if goodopen then do
do until eof(1)
linein = readln(1)
cecho(linein)
end
end
close(1)
delete(tmpfile)
exit
/* FUNCAO DE DISPLAY */
cecho:
"ECHO P="d2c(27)"b«"FTrans"» C=6" arg(1)
return 0