1 ##rem $Id: RexCat.sd,v 2.1 2010/02/11 18:46:51 AmigaPhil $
3 /* - Locale support in ARexx (RexCat) - %b
4 REMOVE THE tls() AND gettlstext() FUNCTIONS FROM YOUR SCRIPT, IF ANY;
5 AND COPY/PASTE THE NEWER FUNCTIONS BELOW THIS LINE INSTEAD.
6 (Note: You need to replace these functions each time you update your
7 script and the Catalog Description is modified.)
8 --------------------------------------------------------------------- */
10 /* (RexCat) Function which translates the strings */
12 tls: PROCEDURE EXPOSE tlstext.
16 IF instring = '' THEN RETURN instring
17 IF LENGTH(instring) > 250 THEN instring = LEFT(instring,250)
18 XID = "XID_" || C2X(instring)
19 IF tlstext.XID == 'TLSTEXT.' || XID THEN RETURN instring
20 IF tlstext.XID = '' THEN RETURN instring
25 /* (RexCat) Function to load the translation file */
27 gettlstext: PROCEDURE EXPOSE tlstext.
29 IF ~SHOW('L',"locale.library") THEN
30 IF ~ADDLIB("locale.library",0,-30) THEN RETURN 0
32 cat = OPENCATALOG("%b.catalog","%l",%v)
34 CALL CLOSECATALOG(cat)
38 tlstext.%i=GETCATALOGSTR(cat,%d,"")