2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
6 #include <exec/types.h>
7 #include <proto/locale.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
);
30 return CatCompArray
[id
].cca_Str
;
35 localizeArray(UBYTE
**strings
,ULONG
*ids
, struct MiamiPanelBase_intern
*MiamiPanelBaseIntern
)
39 if (*ids
) *strings
++ = _(*ids
++, MiamiPanelBaseIntern
);
48 /***********************************************************************/
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
);
64 /***********************************************************************/
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
);
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
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
;