diff --git a/src/gswe-moment.c b/src/gswe-moment.c index 471ac49..3e610f6 100644 --- a/src/gswe-moment.c +++ b/src/gswe-moment.c @@ -397,6 +397,8 @@ gswe_moment_get_house_system(GsweMoment *moment) GsweMoment * gswe_moment_new(void) { + gswe_init(); + return (GsweMoment *)g_object_new(GSWE_TYPE_MOMENT, NULL); } diff --git a/src/swe-glib-private.h b/src/swe-glib-private.h index 7071ea4..6c8b2d8 100644 --- a/src/swe-glib-private.h +++ b/src/swe-glib-private.h @@ -30,6 +30,7 @@ #include "gswe-house-system-info-private.h" #include "gswe-house-data-private.h" +extern gboolean gswe_initialized; extern gchar *gswe_ephe_path; extern GsweTimestamp *gswe_full_moon_base_date; extern GHashTable *gswe_planet_info_table; diff --git a/src/swe-glib.c b/src/swe-glib.c index 768816d..8767f26 100644 --- a/src/swe-glib.c +++ b/src/swe-glib.c @@ -146,6 +146,10 @@ gswe_init(void) GsweAspectInfo *aspect_info; GsweAntiscionAxisInfo *antiscion_axis_info; + if (gswe_initialized) { + return; + } + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");