@@ -2,8 +2,15 @@ package hx.widgets;
22
33import wx .widgets .Locale in WxLocale ;
44import wx .widgets .WxString ;
5+ import cpp .Pointer ;
56
6- class Locale {
7+ class Locale extends Object {
8+
9+ public function new (language : Int ) {
10+ if (_ref == null ) {
11+ _ref = WxLocale .createInstance (language ).reinterpret ();
12+ }
13+ }
714
815 public static function getLanguageName (lang : Int ): String {
916 var r : WxString = WxLocale .getLanguageName (lang );
@@ -29,5 +36,30 @@ class Locale {
2936 public static function isAvailable (lang : Int ): Bool {
3037 return WxLocale .isAvailable (lang );
3138 }
32-
39+
40+ public static function addCatalogLookupPathPrefix (prefix : String ): Void {
41+ var s = WxString .createInstance (prefix );
42+ WxLocale .addCatalogLookupPathPrefix (s .ref );
43+ s .destroy ();
44+ }
45+
46+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////
47+ // Member functions
48+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////
49+
50+ public function addCatalog (domain : String ): Bool {
51+ var s = WxString .createInstance (domain );
52+ var b = localeRef .ptr .addCatalog (s .ref );
53+ s .destroy ();
54+ return b ;
55+ }
56+
57+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////
58+ // Helpers
59+ // ////////////////////////////////////////////////////////////////////////////////////////////////////////
60+ private var localeRef (get , null ): Pointer <WxLocale >;
61+ private function get_localeRef (): Pointer <WxLocale > {
62+ return _ref .reinterpret ();
63+ }
64+
3365}
0 commit comments