;Locale library support Statement localtest{} SHARED local SHARED Catalog$ local=False If IsLocale If ReadFile(0,"ENV:SYS/locale.prefs") FileInput 0 loca$=Edit$(Lof(0)) CloseFile 0 WindowInput 0 n.l=Null(loca$) Land$=Peek$(n.l+50) Sprache$=Peek$(n.l+82) Fil$="Locale:Catalogs/"+Sprache$+"/"+Catalog$ If Exists(Fil$) local=True Else local=False EndIf EndIf EndIf End Statement Function$ local{n,a$} SHARED local SHARED ss$ SHARED dd$ If local b$=Mid$(GetLocaleStr(n,a$)+Chr$(0),2) b$=Replace$(b$,"%s",ss$) b$=Replace$(b$,"%d",dd$) Else b$=a$ EndIf Function Return b$ End Function ;*** Test ***************************************** Catalog$="MicroPaint.catalog" localtest{} If local UseCatalog Catalog$ EndIf NPrint local{1,"Hello} ;This piece of code allows you to use the locale.library in your own ;programs. Perform the following steps: ;(1) Assign the name of your catalog file to Catalog$ ;(2) Call localtest{} ;(3) Use the catalog if local is <> 0 ;(4) use the function local{} to get a catalog entry ;To open another catalog, repeat the process.