according to gcc it must be a constant
[AROS-Contrib.git] / vpdf / locale.c
blobea5bb9b788c461b36a212b75f52aa7d2b43dd04c
1 /*
2 * VPDF
3 *
4 * Copyright © 2008 Christian Rosentreter <tokai@binaryriot.org>
5 * Copyright © 2012 Michal Zukowski, Michal Wozniak
6 * All rights reserved.
8 * $Id$
9 */
11 #include <proto/locale.h>
13 /* must be included before locale.h
15 #define CATCOMP_ARRAY
16 #define NEW_CATCOMP_ARRAY_IDS
17 #include "VPDF_strings.h"
19 #include "locale.h"
21 extern struct Library *LocaleBase;
22 static APTR _locale_catalog;
24 void locale_init(void)
26 if (LocaleBase)
28 _locale_catalog = OpenCatalog(NULL, "VPDF.catalog", OC_BuiltInLanguage, (ULONG) "english", TAG_DONE);
32 void locale_cleanup(void)
34 if (LocaleBase)
36 CloseCatalog(_locale_catalog); /* NULL is save here */
41 CONST_STRPTR locale_getstr(ULONG array_id)
43 const struct CatCompArrayType *t = CatCompArray+array_id;
45 return LocaleBase ? GetCatalogStr(_locale_catalog, t->cca_ID, t->cca_Str) : t->cca_Str;