Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / stacks / AROSTCP / MUI.MiamiPanel / muimiamipanel_locale.c
blobe166e94e8c1d9f9d7fe71c7d179bc56aff95582e
1 /*
2 Copyright © 1995-2008, 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/MUI.miamipanel.catalog"
13 #define CATALOG_VERSION 0
15 #include <libraries/gadtools.h>
16 #include <mui/TheBar_mcc.h>
18 #include "muimiamipanel_intern.h"
20 /*** Functions **************************************************************/
21 /* Main *********************************************************************/
22 CONST_STRPTR _(ULONG id, struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
24 if (LocaleBase != NULL && MiamiPanelBaseIntern->mpb_cat != NULL)
26 return GetCatalogStr(MiamiPanelBaseIntern->mpb_cat, id, CatCompArray[id].cca_Str);
28 else
30 return CatCompArray[id].cca_Str;
34 void
35 localizeArray(UBYTE **strings,ULONG *ids, struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
37 for (;;)
39 if (*ids) *strings++ = _(*ids++, MiamiPanelBaseIntern);
40 else
42 *strings = NULL;
43 break;
48 /***********************************************************************/
50 void
51 localizeMenus(struct NewMenu *menu,ULONG *ids, struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
53 while (menu->nm_Type!=NM_END)
55 register ULONG id = *ids++;
57 if (id && menu->nm_Label!=NM_BARLABEL)
58 menu->nm_Label = _(id, MiamiPanelBaseIntern);
60 menu++;
64 /***********************************************************************/
66 void
67 localizeButtonsBar(struct MUIS_TheBar_Button *buttons,ULONG *ids, struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
69 while (buttons->img!=MUIV_TheBar_End)
71 register ULONG t = *ids++;
72 register ULONG h = *ids++;
74 if (t) buttons->text = _(t, MiamiPanelBaseIntern);
75 if (h) buttons->help = _(h, MiamiPanelBaseIntern);
77 buttons++;
81 /* Setup ********************************************************************/
82 VOID Locale_Initialize(struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
84 if (LocaleBase != NULL)
86 MiamiPanelBaseIntern->mpb_cat = OpenCatalog
88 NULL, CATALOG_NAME, OC_Version, CATALOG_VERSION, TAG_DONE
91 else
93 MiamiPanelBaseIntern->mpb_cat = NULL;
97 VOID Locale_Deinitialize(struct MiamiPanelBase_intern *MiamiPanelBaseIntern)
99 if(LocaleBase != NULL && MiamiPanelBaseIntern->mpb_cat != NULL)
101 CloseCatalog(MiamiPanelBaseIntern->mpb_cat);
102 MiamiPanelBaseIntern->mpb_cat = NULL;