i18n

Separate into separate files Locale file (e.g. TXTED)

TXTED.JA

"Save As":"名前を付けて保存"
"New":"新規作成"
"Open":"開く"
"Save":"保存"

Make KEY $ the default language or separate it

"SAVE":"Save"
"NEW":"New"
"SAVE_AS":"Save as"
"OPEN":"Open"

OpenLocalizeFile NAME$ OUT LOCALIZE,ERR

Read the NAME$ locale file

ERROR CloseLocalizeFile(LOCALIZE)

Close the localization file

GetLocalizeText(LANG, KEY$)

Get the text corresponding to KEY$ from the locale file, and if KEY$ does not exist, return KEY$ as it is

Examples

VAR TXTED_NEW$
VAR TXTED_OPEN$
VAR TXTED_SAVE$
VAR TXTED_SAVEAS$
DEF I_TXTED
'...
 VAR ERROR
 VAR LOCALIZE
 LoadLocalizeFile "TXTED" OUT LOCALIZE, ERROR
 TXTED_NEW$ = GetLocalizeText(LOCALIZE, "New")
 TXTED_OPEN$ = GetLocalizeText(LOCALIZE, "Open")
 TXTED_SAVE$ = GetLocalizeText(LOCALIZE, "Save")
 TXTED_SAVEAS$ = GetLocalizeText(LOCALIZE, "Save as")
 ERROR = CloseLocalizeFile(LOCALIZE)
'...
END

Since it leaks memory as it is, it should handle character string release at the end