[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Translation



** Reply to message from Correo Fenda  on Tue, 08 Nov
2005 21:21:23 +0100

Manuel:

Carl may have a more direct solution for this -- but I have an old private
frame called TRANSLATE that takes any strings (words or phrases) that it finds
anywhere within an input string, and translates (outputs) them as different
strings (words). In the *example* in the frame, it takes English month names
and translates them into Esperanto. The reason for that was that Months are
hardcoded in English in EDITOR.EXE (you'd probably need a localized version of
Editor to get Spanish).

So... let's see: You could *add* to the list of English month names all the
names of the weekdays (in CAPS), with a bar "|" after *every* word or phrase:
"...|NOVEMBER|DECEMBER|SUNDAY|MONDAY|...|SATURDAY|". Then change the Esperanto
to Spanish, and add the Spanish day names with the same "|" after each name,
but uppercase only the *first letter* of the day name. There must be an even
number of entries in both S/Gs 51 and 52, and entry number 1 in English should
correspond (in meaning) to entry #1 in Spanish, #2 = #2, #19 = #19, etc etc.

Add this modified TRANSLATE frame to U2 somewhere. Then find frame TODAY, and
immediately before the  at the very end, insert "JM 2.translateQ2 ".
Then LOADHELP. You should be all set.

Note that this is a generic frame, not a specific solution for this problem.
But the beauty of it is, for someone like you working in a foreign language,
you could use this solution in many different places where you have a limited
number of answers, and you want Spanish instead of English -- just make copies
of frame TRANSLATE and give them different framenames (and different
input/output word lists). *Or* just add more equivalent words|phrases to frame
TRANSLATE (if it doesn't find a word or phrase in the input, it just ignores
it).

Here's the code:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5translate}} Translate any old$ in S/G 50[In/Out] into new
$ RJH 9/12/02[cr|lf]{002};*;[cr|lf]{<}SV51,JANUARY|FEBRUARY|
MARCH|APRIL|MAY|JUNE|JULY|AUGUST|SEPTEMBER|OCTOBER|NOVEMBER|D
ECEMBER|{>};*; English source words[cr|lf];*;[cr|lf]{<}SV52,J
anuaro|Februaro|Marto|Aprilo|Majo|Junio|Julio|Augusto|Septemb
ro|Oktobro|Novembro|Decembro|{>};*; Esperanto equivalents[cr|
lf];*;[cr|lf]{<}SX53,{<}IS51{>}{>}{<}SV54,|{>}{<}SX55,1{>}{<}
LBA{>}{<}XS53,54,56,56,56{>}{<}IF{<}IS56{>}{240}"|"{>}{<}SX55
,{<}PV55{>}+1{>}{<}SX53,{<}IS56{>}{>}{<}GLA{>}{<}EI{>}{<}CUC,
55{>}{<}XS51,54,56,54,53{>}{<}SX51,{<}IS53{>}{>}{<}XS52,54,57
,54,53{>}{<}SX52,{<}IS53{>}{>}{<}IF@UPR({<}IS50{>}){240}{<}IS
56{>}{>}{<}SX53,{<}IS56{>}{238}@UPR({<}IS50{>}){>}{<}SV58,{>}
{<}CUB,53{>}{<}SX58,{<}IS58{>}+"{027}X"{>}{<}LBB{>}{<}XS50,58
,,58,59{>}{<}XS59,56,,53,60{>}{<}IF{<}IS56{>}=={<}IS53{>}{>}{
<}SX57,@UPR({<}IS57{>}){>}{<}EI{>}{<}SX50,{<}IS58{>}+{<}IS57{
>}+{<}IS60{>}{>}{<}EI{>}{<}LBC{>}{002}[cr|lf][cr|lf]
-nd
XPLeNCODE

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------