grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / prefs / network / locale.c
blob2c75ed456981693f92ff0cd6b100a39e6a252946
1 /*
2 Copyright © 2009-2010, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <proto/locale.h>
9 #define CATCOMP_ARRAY
10 #include "strings.h"
12 #define CATALOG_NAME "System/Prefs/Network.catalog"
13 #define CATALOG_VERSION 4
15 static const TEXT DEFYES[] = "Yes", DEFNO[] = "No";
17 /*** Variables **************************************************************/
18 struct Catalog *catalog;
19 struct Locale *locale;
22 /*** Functions **************************************************************/
23 /* Main *********************************************************************/
24 CONST_STRPTR _(ULONG id)
26 if (LocaleBase != NULL && catalog != NULL)
27 return GetCatalogStr(catalog, id, CatCompArray[id].cca_Str);
28 else
29 return CatCompArray[id].cca_Str;
32 CONST_STRPTR L_(ULONG id)
34 if (LocaleBase != NULL && locale != NULL)
35 return GetLocaleStr(locale, id);
36 else
37 return (id == YESSTR) ? DEFYES : DEFNO;
40 /* Setup ********************************************************************/
41 VOID Locale_Initialize(VOID)
43 if (LocaleBase != NULL)
45 catalog = OpenCatalog
47 NULL, CATALOG_NAME, OC_Version, CATALOG_VERSION, TAG_DONE
49 locale = OpenLocale(NULL);
51 else
53 catalog = NULL;
54 locale = NULL;
58 VOID Locale_Deinitialize(VOID)
60 if (LocaleBase != NULL && catalog != NULL) CloseCatalog(catalog);