6 ** Copyright (C) 1994,95,96,97 Bernardo Innocenti
8 ** Routines to handle localization.
10 ** NOTE: The Locale.c file is generated automatically by `%fv'
11 ** using "%f0". Do NOT edit by hand!
14 #include <libraries/locale.h>
16 #include <proto/exec.h>
17 #include <proto/locale.h>
19 #include "XModulePriv.h"
22 #define CATALOGVERSION %v
23 #define CATALOGNAME "%b.catalog"
32 static struct Library *LocaleBase = NULL;
33 XDEF struct Catalog *Catalog = NULL;
37 GLOBALCALL void SetupLocale (void)
39 /* Try to open locale.library */
40 if (LocaleBase = OpenLibrary ("locale.library", 38L))
42 /* Try to get catalog for current language */
43 if (Catalog = OpenCatalog (NULL, CATALOGNAME,
44 OC_BuiltInLanguage, "english",
45 OC_Version, CATALOGVERSION,
48 /* Read in locale language strings */
49 UBYTE **as = AppStrings;
52 /* Get translation strings */
53 for (i = 1; i < MSG_COUNT; i++, as++)
54 *as = GetCatalogStr (Catalog, i, *as);
58 /* Fix for a limitation of FlexCat: MSG_NULL should translate
59 * to a NULL pointer, not a pointer to an empty string :)
66 GLOBALCALL void CleanupLocale (void)
70 /* No need to check for NULL */
71 CloseCatalog (Catalog); Catalog = NULL;
72 CloseLibrary (LocaleBase); LocaleBase = NULL;