[archive] Own produced function for language suppor

[Migrated content. Thread originally posted on 26 March 2004]

I am currently working on a issue related to extracting all text strings in the programs to a Vision file, so that the system can depending on a language code and a Text ID look up in this table and get the appropriate text string and return it to the program.

Syntax today
01 WS-VARIABLE Pic X(50).
Move "This is a test string"
To WS-VARIABLE

Syntax in the future (i hope)
01 WS-VARIABLE Pic X(50).
01 WS-LANG-CODE Pic X(3) Value "ENG".

* 1234 is the text id in the vision file of text
* string ""This is a test string"

Move (Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1234)
To WS-VARIABLE


This is how i hope it could work. The reason why i would like it like this i because I have over 3000 programs to do this in, and if i could program it like shown above, I could just write a conversion program for the source code and replace all strings with a number, and if i change the language code (dynamically), the "GETTEXTSTRPROG" should return the textstring on the selected language (if the translation has been done of the text id). The reason why i dont want to call the program like this:

Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1234 Giving WS-VARIABLE

-> gets more apparent in the next example

01 WS-VARIABLE Pic X(50).
01 WS-LANG-CODE Pic X(3) Value "ENG".

* 1234 is the text id in the vision file of text
* string ""This is a test string"
String
(Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1234)
(Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1235)
(Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1236)
(Call "GETTEXTSTRPROG" Using WS-LANG-CODE , 1237)
Delimited By X"00"
Into WS-VARIABLE
End-string


Can someone please help me, and say if this is at all possible from AcuCobol?