delint
[AROS.git] / workbench / prefs / reqtools / locale.c
blobb6d6b46ced2ad3489f74a8e41c14772eaa89f9ea
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #include <exec/types.h>
10 #include <proto/locale.h>
12 #define CATCOMP_ARRAY
13 #include "strings.h"
15 #define CATALOG_NAME "System/Prefs/ReqTools.catalog"
16 #define CATALOG_VERSION 39
18 /*** Variables **************************************************************/
19 struct Catalog *catalog;
22 /*** Functions **************************************************************/
23 /* Main *********************************************************************/
24 CONST_STRPTR _(LONG id)
26 int i;
27 CONST_STRPTR _str = NULL;
29 for (i = 0; CatCompArray[i].cca_Str != (APTR)NULL; i++)
31 if (CatCompArray[i].cca_ID == id)
33 _str = CatCompArray[i].cca_Str;
34 break;
38 // Localise if possible/necessary
39 if ((_str != NULL) && (LocaleBase != NULL) && (catalog != NULL))
41 _str = GetCatalogStr(catalog, (ULONG)id, _str);
44 return _str;
47 /* Setup ********************************************************************/
48 VOID Locale_Initialize(VOID)
50 if (LocaleBase != NULL)
52 catalog = OpenCatalog
54 NULL, CATALOG_NAME, OC_Version, CATALOG_VERSION, TAG_DONE
57 else
59 catalog = NULL;
63 VOID Locale_Deinitialize(VOID)
65 if (LocaleBase != NULL && catalog != NULL)
66 CloseCatalog(catalog);