/* TranslationRow.c generated by valac 0.56.19, the Vala compiler
 * generated from TranslationRow.vala, do not modify */

/*
* Copyright © 2025 Alain M. (https://github.com/alainm23/planify)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Alain M. <alainmh23@gmail.com>
*/

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "planify.h"
#include <unicode/uloc.h>
#include <unicode/utypes.h>
#include <glib/gstdio.h>
#include <locale.h>

#define BUILD_LOCALEDIR "/usr/share/locale"
#define BUILD_GETTEXT_PACKAGE "io.github.alainm23.planify"
#define BUILD_TOTAL_STRINGS 852
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define WIDGETS_TYPE_TRANSLATION_ROW (widgets_translation_row_get_type ())
#define WIDGETS_TRANSLATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRow))
#define WIDGETS_TRANSLATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRowClass))
#define WIDGETS_IS_TRANSLATION_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_TRANSLATION_ROW))
#define WIDGETS_IS_TRANSLATION_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_TRANSLATION_ROW))
#define WIDGETS_TRANSLATION_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRowClass))

typedef struct _WidgetsTranslationRow WidgetsTranslationRow;
typedef struct _WidgetsTranslationRowClass WidgetsTranslationRowClass;
typedef struct _WidgetsTranslationRowPrivate WidgetsTranslationRowPrivate;
enum  {
	WIDGETS_TRANSLATION_ROW_0_PROPERTY,
	WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY,
	WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY,
	WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY,
	WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY,
	WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY,
	WIDGETS_TRANSLATION_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _WidgetsTranslationRowLoadTranslationDataData WidgetsTranslationRowLoadTranslationDataData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _WidgetsTranslationRowGetCurrentTranslationMetricData WidgetsTranslationRowGetCurrentTranslationMetricData;

struct _WidgetsTranslationRow {
	AdwPreferencesRow parent_instance;
	WidgetsTranslationRowPrivate * priv;
};

struct _WidgetsTranslationRowClass {
	AdwPreferencesRowClass parent_class;
};

struct _WidgetsTranslationRowPrivate {
	GtkImage* _icon;
	GtkLabel* _title_label;
	GtkLabel* _subtitle_label;
	GtkLevelBar* _level_bar;
	gchar* _language_name;
	gdouble _target_percent;
	gboolean _is_ready_to_animate;
	gboolean _animation_played;
};

struct _WidgetsTranslationRowLoadTranslationDataData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	WidgetsTranslationRow* self;
	gchar** languages;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gint languages_length1;
	gint _languages_size_;
	gboolean is_english;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** lang_collection;
	gint lang_collection_length1;
	gint _lang_collection_size_;
	gint lang_it;
	gchar* _tmp4_;
	gchar* lang;
	gboolean _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar** _tmp11_;
	gchar** _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* user_lang;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	ObjectsTranslationMetric* metric;
	ObjectsTranslationMetric* _tmp18_;
	gboolean _tmp19_;
	ObjectsTranslationMetric* _tmp20_;
	ObjectsTranslationMetric* _tmp21_;
	gdouble _tmp22_;
	gdouble _tmp23_;
	gchar* language_name;
	ObjectsTranslationMetric* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	ObjectsTranslationMetric* _tmp27_;
	const gchar* _tmp28_;
	const gchar* _tmp29_;
	gchar* _tmp30_;
	const gchar* _tmp31_;
	ObjectsTranslationMetric* _tmp32_;
	gdouble _tmp33_;
	gdouble _tmp34_;
	gchar* _vala1_language_name;
	ObjectsTranslationMetric* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	gchar* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	GError* _inner_error0_;
};

struct _WidgetsTranslationRowGetCurrentTranslationMetricData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	WidgetsTranslationRow* self;
	ObjectsTranslationMetric* result;
	gchar** languages;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gint languages_length1;
	gint _languages_size_;
	gchar* mo_path;
	gchar* current_lang;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar** lang_collection;
	gint lang_collection_length1;
	gint _lang_collection_size_;
	gint lang_it;
	gchar* _tmp4_;
	gchar* lang;
	gchar* path;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gint translated_strings;
	GDataInputStream* data_stream;
	GFile* file;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GFileInputStream* stream;
	GFile* _tmp15_;
	GFileInputStream* _tmp16_;
	GFileInputStream* _tmp17_;
	GDataInputStream* _tmp18_;
	GDataInputStream* _tmp19_;
	guint32 magic;
	GDataInputStream* _tmp20_;
	GDataInputStream* _tmp21_;
	const gchar* _tmp22_;
	GDataInputStream* _tmp23_;
	GDataInputStream* _tmp24_;
	GError* e;
	GError* _tmp25_;
	const gchar* _tmp26_;
	guint32 revision_number;
	GDataInputStream* _tmp27_;
	gboolean _tmp28_;
	guint32 _tmp29_;
	GDataInputStream* _tmp30_;
	GError* _vala1_e;
	GError* _tmp31_;
	const gchar* _tmp32_;
	GDataInputStream* _tmp33_;
	GDataInputStream* _tmp34_;
	GError* _vala2_e;
	GError* _tmp35_;
	const gchar* _tmp36_;
	GError* _inner_error1_;
	GDataInputStream* _tmp37_;
	GDataInputStream* _tmp38_;
	GError* _vala3_e;
	GError* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	ObjectsTranslationMetric* metric;
	ObjectsTranslationMetric* _tmp42_;
	ObjectsTranslationMetric* _tmp43_;
	const gchar* _tmp44_;
	ObjectsTranslationMetric* _tmp45_;
	ObjectsTranslationMetric* _tmp46_;
	ObjectsTranslationMetric* _tmp47_;
	ObjectsTranslationMetric* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
	ObjectsTranslationMetric* _tmp51_;
	gint _tmp52_;
	gint _tmp53_;
	ObjectsTranslationMetric* _tmp54_;
	const gchar* _tmp55_;
	GError* _inner_error0_;
};

static gint WidgetsTranslationRow_private_offset;
static gpointer widgets_translation_row_parent_class = NULL;

VALA_EXTERN GType widgets_translation_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsTranslationRow, g_object_unref)
VALA_EXTERN void widgets_translation_row_hide_level_bar (WidgetsTranslationRow* self);
VALA_EXTERN void widgets_translation_row_show_level_bar (WidgetsTranslationRow* self);
VALA_EXTERN void widgets_translation_row_prepare_animation (WidgetsTranslationRow* self,
                                                const gchar* language_name,
                                                gdouble target_percent);
static void widgets_translation_row_set_is_ready_to_animate (WidgetsTranslationRow* self,
                                                      gboolean value);
VALA_EXTERN void widgets_translation_row_trigger_animation (WidgetsTranslationRow* self);
VALA_EXTERN gboolean widgets_translation_row_get_is_ready_to_animate (WidgetsTranslationRow* self);
static void __lambda429_ (WidgetsTranslationRow* self,
                   gdouble val);
static void ___lambda429__adw_animation_target_func (gdouble value,
                                              gpointer self);
static void widgets_translation_row_load_translation_data_data_free (gpointer _data);
VALA_EXTERN void widgets_translation_row_load_translation_data (WidgetsTranslationRow* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
VALA_EXTERN void widgets_translation_row_load_translation_data_finish (WidgetsTranslationRow* self,
                                                           GAsyncResult* _res_);
static gboolean widgets_translation_row_load_translation_data_co (WidgetsTranslationRowLoadTranslationDataData* _data_);
static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
VALA_EXTERN void widgets_translation_row_set_title (WidgetsTranslationRow* self,
                                        const gchar* value);
VALA_EXTERN void widgets_translation_row_set_subtitle (WidgetsTranslationRow* self,
                                           const gchar* value);
static void widgets_translation_row_get_current_translation_metric (WidgetsTranslationRow* self,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static ObjectsTranslationMetric* widgets_translation_row_get_current_translation_metric_finish (WidgetsTranslationRow* self,
                                                                                         GAsyncResult* _res_,
                                                                                         GError** error);
static void widgets_translation_row_load_translation_data_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_);
static void widgets_translation_row_get_current_translation_metric_data_free (gpointer _data);
static gboolean widgets_translation_row_get_current_translation_metric_co (WidgetsTranslationRowGetCurrentTranslationMetricData* _data_);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void widgets_translation_row_get_current_translation_metric_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_);
VALA_EXTERN WidgetsTranslationRow* widgets_translation_row_new (void);
VALA_EXTERN WidgetsTranslationRow* widgets_translation_row_construct (GType object_type);
VALA_EXTERN gchar* widgets_translation_row_get_icon_name (WidgetsTranslationRow* self);
VALA_EXTERN void widgets_translation_row_set_icon_name (WidgetsTranslationRow* self,
                                            const gchar* value);
VALA_EXTERN gchar* widgets_translation_row_get_title (WidgetsTranslationRow* self);
VALA_EXTERN gchar* widgets_translation_row_get_subtitle (WidgetsTranslationRow* self);
VALA_EXTERN gdouble widgets_translation_row_get_progress (WidgetsTranslationRow* self);
VALA_EXTERN void widgets_translation_row_set_progress (WidgetsTranslationRow* self,
                                           gdouble value);
static GObject * widgets_translation_row_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void widgets_translation_row_finalize (GObject * obj);
static GType widgets_translation_row_get_type_once (void);
static void _vala_widgets_translation_row_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_widgets_translation_row_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
widgets_translation_row_get_instance_private (WidgetsTranslationRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsTranslationRow_private_offset);
}

void
widgets_translation_row_hide_level_bar (WidgetsTranslationRow* self)
{
	GtkLevelBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_level_bar;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, FALSE);
}

void
widgets_translation_row_show_level_bar (WidgetsTranslationRow* self)
{
	GtkLevelBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_level_bar;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
}

void
widgets_translation_row_prepare_animation (WidgetsTranslationRow* self,
                                           const gchar* language_name,
                                           gdouble target_percent)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (language_name != NULL);
	_tmp0_ = g_strdup (language_name);
	_g_free0 (self->priv->_language_name);
	self->priv->_language_name = _tmp0_;
	self->priv->_target_percent = target_percent;
	widgets_translation_row_set_is_ready_to_animate (self, TRUE);
}

static void
__lambda429_ (WidgetsTranslationRow* self,
              gdouble val)
{
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GtkLevelBar* _tmp4_;
	_tmp0_ = self->priv->_subtitle_label;
	_tmp1_ = self->priv->_language_name;
	_tmp2_ = g_strdup_printf (_ ("<b>%s</b> is %.0f%% complete. You can help finish it!"), _tmp1_, round (val));
	_tmp3_ = _tmp2_;
	gtk_label_set_label (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = self->priv->_level_bar;
	gtk_level_bar_set_value (_tmp4_, val / 100.0);
}

static void
___lambda429__adw_animation_target_func (gdouble value,
                                         gpointer self)
{
	__lambda429_ ((WidgetsTranslationRow*) self, value);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
widgets_translation_row_trigger_animation (WidgetsTranslationRow* self)
{
	gboolean _tmp0_ = FALSE;
	AdwCallbackAnimationTarget* animation_target = NULL;
	AdwCallbackAnimationTarget* _tmp2_;
	AdwTimedAnimation* animation = NULL;
	AdwCallbackAnimationTarget* _tmp3_;
	AdwAnimationTarget* _tmp4_;
	AdwTimedAnimation* _tmp5_ = NULL;
	AdwTimedAnimation* _tmp6_;
	g_return_if_fail (self != NULL);
	if (self->priv->_animation_played) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp1_;
		_tmp1_ = self->priv->_is_ready_to_animate;
		_tmp0_ = !_tmp1_;
	}
	if (_tmp0_) {
		return;
	}
	self->priv->_animation_played = TRUE;
	_tmp2_ = (AdwCallbackAnimationTarget*) adw_callback_animation_target_new (___lambda429__adw_animation_target_func, g_object_ref (self), g_object_unref);
	animation_target = _tmp2_;
	_tmp3_ = animation_target;
	_tmp4_ = _g_object_ref0 ((AdwAnimationTarget*) _tmp3_);
	_tmp5_ = (AdwTimedAnimation*) adw_timed_animation_new ((GtkWidget*) self, (gdouble) 0, self->priv->_target_percent, (guint) 1000, _tmp4_);
	adw_timed_animation_set_easing (_tmp5_, ADW_EASE_IN_OUT_QUAD);
	animation = _tmp5_;
	_tmp6_ = animation;
	adw_animation_play ((AdwAnimation*) _tmp6_);
	_g_object_unref0 (animation);
	_g_object_unref0 (animation_target);
}

static void
widgets_translation_row_load_translation_data_data_free (gpointer _data)
{
	WidgetsTranslationRowLoadTranslationDataData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (WidgetsTranslationRowLoadTranslationDataData, _data_);
}

void
widgets_translation_row_load_translation_data (WidgetsTranslationRow* self,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	WidgetsTranslationRowLoadTranslationDataData* _data_;
	WidgetsTranslationRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (WidgetsTranslationRowLoadTranslationDataData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, widgets_translation_row_load_translation_data_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	widgets_translation_row_load_translation_data_co (_data_);
}

void
widgets_translation_row_load_translation_data_finish (WidgetsTranslationRow* self,
                                                      GAsyncResult* _res_)
{
	WidgetsTranslationRowLoadTranslationDataData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gchar**
_vala_array_dup1 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
widgets_translation_row_load_translation_data_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_)
{
	WidgetsTranslationRowLoadTranslationDataData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	widgets_translation_row_load_translation_data_co (_data_);
}

static gchar*
icu_get_display_language (const gchar* locale,
                          const gchar* display_locale)
{
	UErrorCode status = 0;
	UChar* tmp = NULL;
	UChar* _tmp0_;
	gint tmp_length1;
	gint _tmp_size_;
	gint len = 0;
	UChar* _tmp1_;
	gint _tmp1__length1;
	UChar* _tmp2_;
	gint _tmp2__length1;
	gint _tmp3_;
	gboolean _tmp4_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (locale != NULL, NULL);
	g_return_val_if_fail (display_locale != NULL, NULL);
	status = U_ZERO_ERROR;
	_tmp0_ = g_new0 (UChar, 256);
	tmp = _tmp0_;
	tmp_length1 = 256;
	_tmp_size_ = tmp_length1;
	_tmp1_ = tmp;
	_tmp1__length1 = tmp_length1;
	_tmp2_ = tmp;
	_tmp2__length1 = tmp_length1;
	_tmp3_ = uloc_getDisplayLanguage (locale, display_locale, _tmp1_, _tmp2__length1, &status);
	len = _tmp3_;
	if (U_FAILURE (status)) {
		_tmp4_ = TRUE;
	} else {
		_tmp4_ = len <= 0;
	}
	if (_tmp4_) {
		gchar* _tmp5_;
		_tmp5_ = g_strdup ("Unknown");
		result = _tmp5_;
		tmp = (g_free (tmp), NULL);
		return result;
	}
	{
		gchar* _tmp6_ = NULL;
		UChar* _tmp7_;
		gint _tmp7__length1;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp7_ = tmp;
		_tmp7__length1 = tmp_length1;
		_tmp8_ = g_convert ((const gchar*) ((guint8*) _tmp7_), (gssize) (len * 2), "UTF-8", "UTF-16", NULL, NULL, &_inner_error0_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_CONVERT_ERROR) {
				goto __catch0_g_convert_error;
			}
			tmp = (g_free (tmp), NULL);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp9_ = _tmp6_;
		_tmp6_ = NULL;
		result = _tmp9_;
		_g_free0 (_tmp6_);
		tmp = (g_free (tmp), NULL);
		return result;
	}
	goto __finally0;
	__catch0_g_convert_error:
	{
		gchar* _tmp10_;
		g_clear_error (&_inner_error0_);
		_tmp10_ = g_strdup ("Unknown");
		result = _tmp10_;
		tmp = (g_free (tmp), NULL);
		return result;
	}
	__finally0:
	tmp = (g_free (tmp), NULL);
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gboolean
widgets_translation_row_load_translation_data_co (WidgetsTranslationRowLoadTranslationDataData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_tmp1_ = _data_->_tmp0_ = g_get_language_names ();
		_data_->_tmp2_ = (_data_->_tmp1_ != NULL) ? _vala_array_dup1 (_data_->_tmp1_, _vala_array_length (_data_->_tmp0_)) : _data_->_tmp1_;
		_data_->_tmp2__length1 = _vala_array_length (_data_->_tmp0_);
		_data_->languages = _data_->_tmp2_;
		_data_->languages_length1 = _data_->_tmp2__length1;
		_data_->_languages_size_ = _data_->languages_length1;
		_data_->is_english = FALSE;
		_data_->_tmp3_ = _data_->languages;
		_data_->_tmp3__length1 = _data_->languages_length1;
		{
			_data_->lang_collection_length1 = 0;
			_data_->_lang_collection_size_ = 0;
			_data_->lang_collection = _data_->_tmp3_;
			_data_->lang_collection_length1 = _data_->_tmp3__length1;
			for (_data_->lang_it = 0; _data_->lang_it < _data_->lang_collection_length1; _data_->lang_it = _data_->lang_it + 1) {
				_data_->_tmp4_ = g_strdup (_data_->lang_collection[_data_->lang_it]);
				_data_->lang = _data_->_tmp4_;
				{
					_data_->_tmp6_ = _data_->lang;
					if (g_strcmp0 (_data_->_tmp6_, "C") == 0) {
						_data_->_tmp5_ = TRUE;
					} else {
						_data_->_tmp7_ = _data_->lang;
						_data_->_tmp5_ = g_strcmp0 (_data_->_tmp7_, "POSIX") == 0;
					}
					if (_data_->_tmp5_) {
						_g_free0 (_data_->lang);
						continue;
					}
					_data_->_tmp9_ = _data_->lang;
					if (string_contains (_data_->_tmp9_, "_")) {
						_data_->_tmp10_ = _data_->lang;
						_data_->_tmp12_ = _data_->_tmp11_ = g_strsplit (_data_->_tmp10_, "_", 0);
						_data_->_tmp13_ = _data_->_tmp12_;
						_data_->_tmp13__length1 = _vala_array_length (_data_->_tmp11_);
						_data_->_tmp14_ = _data_->_tmp13_[0];
						_data_->_tmp8_ = _data_->_tmp14_;
						_data_->_tmp13_ = (_vala_array_free (_data_->_tmp13_, _data_->_tmp13__length1, (GDestroyNotify) g_free), NULL);
					} else {
						_data_->_tmp15_ = _data_->lang;
						_data_->_tmp8_ = _data_->_tmp15_;
					}
					_data_->_tmp16_ = g_strdup (_data_->_tmp8_);
					_data_->user_lang = _data_->_tmp16_;
					_data_->_tmp17_ = _data_->user_lang;
					if (g_strcmp0 (_data_->_tmp17_, "en") == 0) {
						_data_->is_english = TRUE;
						_g_free0 (_data_->user_lang);
						_g_free0 (_data_->lang);
						break;
					}
					_g_free0 (_data_->user_lang);
					_g_free0 (_data_->lang);
				}
			}
		}
		if (_data_->is_english) {
			widgets_translation_row_set_title (_data_->self, _ ("Translations"));
			widgets_translation_row_set_subtitle (_data_->self, _ ("Help make Planify available worldwide"));
			widgets_translation_row_hide_level_bar (_data_->self);
			_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_state_ = 1;
		widgets_translation_row_get_current_translation_metric (_data_->self, widgets_translation_row_load_translation_data_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp18_ = widgets_translation_row_get_current_translation_metric_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->metric = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = _data_->metric;
		if (_data_->_tmp20_ != NULL) {
			_data_->_tmp21_ = _data_->metric;
			_data_->_tmp22_ = objects_translation_metric_get_translated_percent (_data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_tmp19_ = _data_->_tmp23_ > 0.0;
		} else {
			_data_->_tmp19_ = FALSE;
		}
		if (_data_->_tmp19_) {
			widgets_translation_row_set_title (_data_->self, _ ("Help improve translations"));
			_data_->_tmp24_ = _data_->metric;
			_data_->_tmp25_ = objects_translation_metric_get_code (_data_->_tmp24_);
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_tmp27_ = _data_->metric;
			_data_->_tmp28_ = objects_translation_metric_get_code (_data_->_tmp27_);
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_tmp30_ = icu_get_display_language (_data_->_tmp26_, _data_->_tmp29_);
			_data_->language_name = _data_->_tmp30_;
			_data_->_tmp31_ = _data_->language_name;
			_data_->_tmp32_ = _data_->metric;
			_data_->_tmp33_ = objects_translation_metric_get_translated_percent (_data_->_tmp32_);
			_data_->_tmp34_ = _data_->_tmp33_;
			widgets_translation_row_prepare_animation (_data_->self, _data_->_tmp31_, _data_->_tmp34_);
			_g_free0 (_data_->language_name);
			_g_object_unref0 (_data_->metric);
			_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp35_ = _data_->metric;
		_data_->_tmp36_ = objects_translation_metric_get_code (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = icu_get_display_language (_data_->_tmp37_, "en");
		_data_->_vala1_language_name = _data_->_tmp38_;
		widgets_translation_row_set_title (_data_->self, _ ("Start a new translation"));
		_data_->_tmp39_ = _data_->_vala1_language_name;
		_data_->_tmp40_ = g_strdup_printf (_ ("<b>%s</b> is not available yet. Be the first to translate it!"), _data_->_tmp39_);
		_data_->_tmp41_ = _data_->_tmp40_;
		widgets_translation_row_set_subtitle (_data_->self, _data_->_tmp41_);
		_g_free0 (_data_->_tmp41_);
		widgets_translation_row_hide_level_bar (_data_->self);
		_g_free0 (_data_->_vala1_language_name);
		_g_object_unref0 (_data_->metric);
		_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		widgets_translation_row_set_title (_data_->self, _ ("Translations"));
		widgets_translation_row_set_subtitle (_data_->self, _ ("Help make Planify available worldwide"));
		widgets_translation_row_hide_level_bar (_data_->self);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
widgets_translation_row_get_current_translation_metric_data_free (gpointer _data)
{
	WidgetsTranslationRowGetCurrentTranslationMetricData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (WidgetsTranslationRowGetCurrentTranslationMetricData, _data_);
}

static void
widgets_translation_row_get_current_translation_metric (WidgetsTranslationRow* self,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	WidgetsTranslationRowGetCurrentTranslationMetricData* _data_;
	WidgetsTranslationRow* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (WidgetsTranslationRowGetCurrentTranslationMetricData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, widgets_translation_row_get_current_translation_metric_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	widgets_translation_row_get_current_translation_metric_co (_data_);
}

static ObjectsTranslationMetric*
widgets_translation_row_get_current_translation_metric_finish (WidgetsTranslationRow* self,
                                                               GAsyncResult* _res_,
                                                               GError** error)
{
	ObjectsTranslationMetric* result;
	WidgetsTranslationRowGetCurrentTranslationMetricData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

/**
     *   Calculates the translation coverage percentage for the current locale by parsing the MO file.
     *
     *   This function searches for the first available MO file (translation catalog) in the system's locale directory, based on the user's language preferences.
     *   It reads the MO file to count the number of translated strings and calculates the translation coverage percentage.
     *
     *   Returns a `TranslationMetric` object or `null` if no translations are available. Throws an `Error` if the MO file is unreadable, corrupted, or invalid.
     *
     *   MO File Format:
     *
     *   | Field                  | Size (bytes) | Description                                           |
     *   |------------------------|--------------|-------------------------------------------------------|
     *   | Magic Number           | 4            | Identifies endianness (`0x950412de` or `0xde120495`). |
     *   | File Format Revision   | 4            | Version of the MO file format (0 or 1).               |
     *   | Number of Strings      | 4            | Number of translated string entries.                  |
     *   | ...                    | ...          | ...                                                   |
     *
     *   More information: https://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
     */
static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
widgets_translation_row_get_current_translation_metric_ready (GObject* source_object,
                                                              GAsyncResult* _res_,
                                                              gpointer _user_data_)
{
	WidgetsTranslationRowGetCurrentTranslationMetricData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	widgets_translation_row_get_current_translation_metric_co (_data_);
}

static gboolean
widgets_translation_row_get_current_translation_metric_co (WidgetsTranslationRowGetCurrentTranslationMetricData* _data_)
{
	static const guint32 MAGIC_NUMBER_LE = (guint32) 0x950412deLL;
	static const guint32 MAGIC_NUMBER_BE = (guint32) 0xde120495LL;
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->_tmp0_ = g_get_language_names ();
	_data_->_tmp2_ = (_data_->_tmp1_ != NULL) ? _vala_array_dup2 (_data_->_tmp1_, _vala_array_length (_data_->_tmp0_)) : _data_->_tmp1_;
	_data_->_tmp2__length1 = _vala_array_length (_data_->_tmp0_);
	_data_->languages = _data_->_tmp2_;
	_data_->languages_length1 = _data_->_tmp2__length1;
	_data_->_languages_size_ = _data_->languages_length1;
	_data_->mo_path = NULL;
	_data_->current_lang = NULL;
	_data_->_tmp3_ = _data_->languages;
	_data_->_tmp3__length1 = _data_->languages_length1;
	{
		_data_->lang_collection_length1 = 0;
		_data_->_lang_collection_size_ = 0;
		_data_->lang_collection = _data_->_tmp3_;
		_data_->lang_collection_length1 = _data_->_tmp3__length1;
		for (_data_->lang_it = 0; _data_->lang_it < _data_->lang_collection_length1; _data_->lang_it = _data_->lang_it + 1) {
			_data_->_tmp4_ = g_strdup (_data_->lang_collection[_data_->lang_it]);
			_data_->lang = _data_->_tmp4_;
			{
				_data_->_tmp5_ = _data_->lang;
				_data_->_tmp6_ = g_build_filename (BUILD_LOCALEDIR, _data_->_tmp5_, "LC_MESSAGES", BUILD_GETTEXT_PACKAGE ".mo", NULL);
				_data_->path = _data_->_tmp6_;
				_data_->_tmp7_ = _data_->path;
				if (g_file_test (_data_->_tmp7_, G_FILE_TEST_EXISTS)) {
					_data_->_tmp8_ = _data_->path;
					_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
					_g_free0 (_data_->mo_path);
					_data_->mo_path = _data_->_tmp9_;
					_data_->_tmp10_ = _data_->lang;
					_data_->_tmp11_ = g_strdup (_data_->_tmp10_);
					_g_free0 (_data_->current_lang);
					_data_->current_lang = _data_->_tmp11_;
					_g_free0 (_data_->path);
					_g_free0 (_data_->lang);
					break;
				}
				_g_free0 (_data_->path);
				_g_free0 (_data_->lang);
			}
		}
	}
	_data_->_tmp12_ = _data_->mo_path;
	if (_data_->_tmp12_ == NULL) {
		g_info ("TranslationRow.vala:196: Current locale has no translations available");
		_data_->result = NULL;
		_g_free0 (_data_->current_lang);
		_g_free0 (_data_->mo_path);
		_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->translated_strings = 0;
	_data_->data_stream = NULL;
	{
		_data_->_tmp13_ = _data_->mo_path;
		_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
		_data_->file = _data_->_tmp14_;
		_data_->_tmp15_ = _data_->file;
		_data_->_state_ = 1;
		g_file_read_async (_data_->_tmp15_, G_PRIORITY_DEFAULT, NULL, widgets_translation_row_get_current_translation_metric_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp16_ = g_file_read_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error0_);
		_data_->stream = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		_data_->_tmp17_ = _data_->stream;
		_data_->_tmp18_ = g_data_input_stream_new ((GInputStream*) _data_->_tmp17_);
		_g_object_unref0 (_data_->data_stream);
		_data_->data_stream = _data_->_tmp18_;
		_data_->_tmp19_ = _data_->data_stream;
		g_data_input_stream_set_byte_order (_data_->_tmp19_, G_DATA_STREAM_BYTE_ORDER_LITTLE_ENDIAN);
		_data_->_tmp20_ = _data_->data_stream;
		_data_->magic = g_data_input_stream_read_uint32 (_data_->_tmp20_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		if (_data_->magic == MAGIC_NUMBER_BE) {
			_data_->_tmp21_ = _data_->data_stream;
			g_data_input_stream_set_byte_order (_data_->_tmp21_, G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
		} else {
			if (_data_->magic != MAGIC_NUMBER_LE) {
				_data_->_tmp22_ = _data_->mo_path;
				g_warning ("TranslationRow.vala:212: Unrecognized magic number in MO file: %s", _data_->_tmp22_);
				_data_->result = NULL;
				_g_object_unref0 (_data_->stream);
				_g_object_unref0 (_data_->file);
				{
					_data_->_tmp23_ = _data_->data_stream;
					if (_data_->_tmp23_ != NULL) {
						{
							_data_->_tmp24_ = _data_->data_stream;
							_data_->_state_ = 2;
							g_input_stream_close_async ((GInputStream*) _data_->_tmp24_, G_PRIORITY_DEFAULT, NULL, widgets_translation_row_get_current_translation_metric_ready, _data_);
							return FALSE;
							_state_2:
							g_input_stream_close_finish ((GInputStream*) _data_->_tmp24_, _data_->_res_, &_data_->_inner_error0_);
							if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
								goto __catch1_g_error;
							}
						}
						goto __finally1;
						__catch1_g_error:
						{
							_data_->e = _data_->_inner_error0_;
							_data_->_inner_error0_ = NULL;
							_data_->_tmp25_ = _data_->e;
							_data_->_tmp26_ = _data_->_tmp25_->message;
							g_warning ("TranslationRow.vala:231: Error closing stream: %s", _data_->_tmp26_);
							_g_error_free0 (_data_->e);
						}
						__finally1:
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							goto __catch0_g_error;
						}
					}
				}
				_g_object_unref0 (_data_->data_stream);
				_g_free0 (_data_->current_lang);
				_g_free0 (_data_->mo_path);
				_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
				g_task_return_pointer (_data_->_async_result, _data_, NULL);
				if (_data_->_state_ != 0) {
					while (!g_task_get_completed (_data_->_async_result)) {
						g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
					}
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
		_data_->_tmp27_ = _data_->data_stream;
		_data_->revision_number = g_data_input_stream_read_uint32 (_data_->_tmp27_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		if (_data_->revision_number != ((guint32) 0)) {
			_data_->_tmp28_ = _data_->revision_number != ((guint32) 1);
		} else {
			_data_->_tmp28_ = FALSE;
		}
		if (_data_->_tmp28_) {
			g_warning ("TranslationRow.vala:219: MO File has an invalid revision number. Revis" \
"ion Number appeares to be %u", (guint) _data_->revision_number);
		}
		_data_->_tmp30_ = _data_->data_stream;
		_data_->_tmp29_ = g_data_input_stream_read_uint32 (_data_->_tmp30_, NULL, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->stream);
			_g_object_unref0 (_data_->file);
			goto __catch0_g_error;
		}
		_data_->translated_strings = ((gint) _data_->_tmp29_) - 1;
		_g_object_unref0 (_data_->stream);
		_g_object_unref0 (_data_->file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_vala1_e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp31_ = _data_->_vala1_e;
		_data_->_tmp32_ = _data_->_tmp31_->message;
		g_warning ("TranslationRow.vala:224: Error reading .mo file: %s", _data_->_tmp32_);
		_data_->result = NULL;
		_g_error_free0 (_data_->_vala1_e);
		{
			_data_->_tmp33_ = _data_->data_stream;
			if (_data_->_tmp33_ != NULL) {
				{
					_data_->_tmp34_ = _data_->data_stream;
					_data_->_state_ = 3;
					g_input_stream_close_async ((GInputStream*) _data_->_tmp34_, G_PRIORITY_DEFAULT, NULL, widgets_translation_row_get_current_translation_metric_ready, _data_);
					return FALSE;
					_state_3:
					g_input_stream_close_finish ((GInputStream*) _data_->_tmp34_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch2_g_error;
					}
				}
				goto __finally2;
				__catch2_g_error:
				{
					_data_->_vala2_e = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp35_ = _data_->_vala2_e;
					_data_->_tmp36_ = _data_->_tmp35_->message;
					g_warning ("TranslationRow.vala:231: Error closing stream: %s", _data_->_tmp36_);
					_g_error_free0 (_data_->_vala2_e);
				}
				__finally2:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_object_unref0 (_data_->data_stream);
					_g_free0 (_data_->current_lang);
					_g_free0 (_data_->mo_path);
					_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
				}
			}
		}
		_g_object_unref0 (_data_->data_stream);
		_g_free0 (_data_->current_lang);
		_g_free0 (_data_->mo_path);
		_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	{
		_data_->_tmp37_ = _data_->data_stream;
		if (_data_->_tmp37_ != NULL) {
			{
				_data_->_tmp38_ = _data_->data_stream;
				_data_->_state_ = 4;
				g_input_stream_close_async ((GInputStream*) _data_->_tmp38_, G_PRIORITY_DEFAULT, NULL, widgets_translation_row_get_current_translation_metric_ready, _data_);
				return FALSE;
				_state_4:
				g_input_stream_close_finish ((GInputStream*) _data_->_tmp38_, _data_->_res_, &_data_->_inner_error1_);
				if (G_UNLIKELY (_data_->_inner_error1_ != NULL)) {
					goto __catch3_g_error;
				}
			}
			goto __finally3;
			__catch3_g_error:
			{
				_data_->_vala3_e = _data_->_inner_error1_;
				_data_->_inner_error1_ = NULL;
				_data_->_tmp39_ = _data_->_vala3_e;
				_data_->_tmp40_ = _data_->_tmp39_->message;
				g_warning ("TranslationRow.vala:231: Error closing stream: %s", _data_->_tmp40_);
				_g_error_free0 (_data_->_vala3_e);
			}
			__finally3:
			if (G_UNLIKELY (_data_->_inner_error1_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error1_);
				_g_object_unref0 (_data_->data_stream);
				_g_free0 (_data_->current_lang);
				_g_free0 (_data_->mo_path);
				_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->data_stream);
		_g_free0 (_data_->current_lang);
		_g_free0 (_data_->mo_path);
		_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->translated_strings <= 0) {
		_data_->_tmp41_ = _data_->mo_path;
		g_warning ("TranslationRow.vala:237: Invalid number of translated strings in MO fi" \
"le: %s", _data_->_tmp41_);
		_data_->result = NULL;
		_g_object_unref0 (_data_->data_stream);
		_g_free0 (_data_->current_lang);
		_g_free0 (_data_->mo_path);
		_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp42_ = objects_translation_metric_new ();
	_data_->metric = _data_->_tmp42_;
	_data_->_tmp43_ = _data_->metric;
	_data_->_tmp44_ = _data_->current_lang;
	objects_translation_metric_set_code (_data_->_tmp43_, _data_->_tmp44_);
	_data_->_tmp45_ = _data_->metric;
	objects_translation_metric_set_total_strings (_data_->_tmp45_, BUILD_TOTAL_STRINGS);
	_data_->_tmp46_ = _data_->metric;
	objects_translation_metric_set_translated_strings (_data_->_tmp46_, _data_->translated_strings);
	_data_->_tmp47_ = _data_->metric;
	_data_->_tmp48_ = _data_->metric;
	_data_->_tmp49_ = objects_translation_metric_get_translated_strings (_data_->_tmp48_);
	_data_->_tmp50_ = _data_->_tmp49_;
	_data_->_tmp51_ = _data_->metric;
	_data_->_tmp52_ = objects_translation_metric_get_total_strings (_data_->_tmp51_);
	_data_->_tmp53_ = _data_->_tmp52_;
	objects_translation_metric_set_translated_percent (_data_->_tmp47_, (((gdouble) _data_->_tmp50_) / _data_->_tmp53_) * 100.0);
	_data_->_tmp54_ = _data_->metric;
	_data_->_tmp55_ = setlocale (LC_MESSAGES, "");
	objects_translation_metric_set_language (_data_->_tmp54_, _data_->_tmp55_);
	_data_->result = _data_->metric;
	_g_object_unref0 (_data_->data_stream);
	_g_free0 (_data_->current_lang);
	_g_free0 (_data_->mo_path);
	_data_->languages = (_vala_array_free (_data_->languages, _data_->languages_length1, (GDestroyNotify) g_free), NULL);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

WidgetsTranslationRow*
widgets_translation_row_construct (GType object_type)
{
	WidgetsTranslationRow * self = NULL;
	self = (WidgetsTranslationRow*) g_object_new (object_type, NULL);
	return self;
}

WidgetsTranslationRow*
widgets_translation_row_new (void)
{
	return widgets_translation_row_construct (WIDGETS_TYPE_TRANSLATION_ROW);
}

gchar*
widgets_translation_row_get_icon_name (WidgetsTranslationRow* self)
{
	gchar* result;
	GtkImage* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	g_object_get (_tmp0_, "icon-name", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
widgets_translation_row_set_icon_name (WidgetsTranslationRow* self,
                                       const gchar* value)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_icon;
	g_object_set (_tmp0_, "icon-name", value, NULL);
	g_object_notify_by_pspec ((GObject *) self, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY]);
}

gchar*
widgets_translation_row_get_title (WidgetsTranslationRow* self)
{
	gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title_label;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

void
widgets_translation_row_set_title (WidgetsTranslationRow* self,
                                   const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_title_label;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY]);
}

gchar*
widgets_translation_row_get_subtitle (WidgetsTranslationRow* self)
{
	gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_subtitle_label;
	_tmp1_ = gtk_label_get_label (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	return result;
}

void
widgets_translation_row_set_subtitle (WidgetsTranslationRow* self,
                                      const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_subtitle_label;
	gtk_label_set_label (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY]);
}

gdouble
widgets_translation_row_get_progress (WidgetsTranslationRow* self)
{
	gdouble result;
	GtkLevelBar* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->_level_bar;
	_tmp1_ = gtk_level_bar_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
widgets_translation_row_set_progress (WidgetsTranslationRow* self,
                                      gdouble value)
{
	GtkLevelBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_level_bar;
	gtk_level_bar_set_value (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY]);
}

gboolean
widgets_translation_row_get_is_ready_to_animate (WidgetsTranslationRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_ready_to_animate;
	return result;
}

static void
widgets_translation_row_set_is_ready_to_animate (WidgetsTranslationRow* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_translation_row_get_is_ready_to_animate (self);
	if (old_value != value) {
		self->priv->_is_ready_to_animate = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY]);
	}
}

static GObject *
widgets_translation_row_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsTranslationRow * self;
	GtkBox* main_box = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkImage* _tmp1_ = NULL;
	GtkBox* text_box = NULL;
	GtkBox* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkLevelBar* _tmp7_ = NULL;
	GtkBox* _tmp8_;
	GtkLabel* _tmp9_;
	GtkBox* _tmp10_;
	GtkLabel* _tmp11_;
	GtkBox* _tmp12_;
	GtkLevelBar* _tmp13_;
	GtkBox* _tmp14_;
	GtkImage* _tmp15_;
	GtkBox* _tmp16_;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	parent_class = G_OBJECT_CLASS (widgets_translation_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRow);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 8);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 8);
	g_object_ref_sink (_tmp0_);
	main_box = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new ();
	gtk_image_set_pixel_size (_tmp1_, 16);
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_icon);
	self->priv->_icon = _tmp1_;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp2_);
	text_box = _tmp2_;
	_tmp3_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, TRUE);
	gtk_label_set_xalign (_tmp3_, (gfloat) 0);
	gtk_label_set_wrap (_tmp3_, TRUE);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->_title_label);
	self->priv->_title_label = _tmp3_;
	_tmp4_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_xalign (_tmp4_, (gfloat) 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_label_set_use_markup (_tmp4_, TRUE);
	gtk_label_set_wrap (_tmp4_, TRUE);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->_subtitle_label);
	self->priv->_subtitle_label = _tmp4_;
	_tmp5_ = self->priv->_subtitle_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "dimmed");
	_tmp6_ = self->priv->_subtitle_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp6_, "caption");
	_tmp7_ = (GtkLevelBar*) gtk_level_bar_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp7_, 6);
	gtk_level_bar_set_min_value (_tmp7_, 0.0);
	gtk_level_bar_set_max_value (_tmp7_, 1.0);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->_level_bar);
	self->priv->_level_bar = _tmp7_;
	_tmp8_ = text_box;
	_tmp9_ = self->priv->_title_label;
	gtk_box_append (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = text_box;
	_tmp11_ = self->priv->_subtitle_label;
	gtk_box_append (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = text_box;
	_tmp13_ = self->priv->_level_bar;
	gtk_box_append (_tmp12_, (GtkWidget*) _tmp13_);
	_tmp14_ = main_box;
	_tmp15_ = self->priv->_icon;
	gtk_box_append (_tmp14_, (GtkWidget*) _tmp15_);
	_tmp16_ = main_box;
	_tmp17_ = text_box;
	gtk_box_append (_tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = main_box;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp18_);
	_g_object_unref0 (text_box);
	_g_object_unref0 (main_box);
	return obj;
}

static void
widgets_translation_row_class_init (WidgetsTranslationRowClass * klass,
                                    gpointer klass_data)
{
	widgets_translation_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsTranslationRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_translation_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_translation_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_translation_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_translation_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY] = g_param_spec_string ("icon-name", "icon-name", "icon-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY] = g_param_spec_string ("subtitle", "subtitle", "subtitle", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY] = g_param_spec_double ("progress", "progress", "progress", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY, widgets_translation_row_properties[WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY] = g_param_spec_boolean ("is-ready-to-animate", "is-ready-to-animate", "is-ready-to-animate", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
widgets_translation_row_instance_init (WidgetsTranslationRow * self,
                                       gpointer klass)
{
	gchar* _tmp0_;
	self->priv = widgets_translation_row_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_language_name = _tmp0_;
	self->priv->_target_percent = 0.0;
	self->priv->_is_ready_to_animate = FALSE;
	self->priv->_animation_played = FALSE;
}

static void
widgets_translation_row_finalize (GObject * obj)
{
	WidgetsTranslationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRow);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->_title_label);
	_g_object_unref0 (self->priv->_subtitle_label);
	_g_object_unref0 (self->priv->_level_bar);
	_g_free0 (self->priv->_language_name);
	G_OBJECT_CLASS (widgets_translation_row_parent_class)->finalize (obj);
}

static GType
widgets_translation_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsTranslationRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_translation_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsTranslationRow), 0, (GInstanceInitFunc) widgets_translation_row_instance_init, NULL };
	GType widgets_translation_row_type_id;
	widgets_translation_row_type_id = g_type_register_static (adw_preferences_row_get_type (), "WidgetsTranslationRow", &g_define_type_info, 0);
	WidgetsTranslationRow_private_offset = g_type_add_instance_private (widgets_translation_row_type_id, sizeof (WidgetsTranslationRowPrivate));
	return widgets_translation_row_type_id;
}

GType
widgets_translation_row_get_type (void)
{
	static volatile gsize widgets_translation_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_translation_row_type_id__once)) {
		GType widgets_translation_row_type_id;
		widgets_translation_row_type_id = widgets_translation_row_get_type_once ();
		g_once_init_leave (&widgets_translation_row_type_id__once, widgets_translation_row_type_id);
	}
	return widgets_translation_row_type_id__once;
}

static void
_vala_widgets_translation_row_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	WidgetsTranslationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRow);
	switch (property_id) {
		case WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY:
		g_value_take_string (value, widgets_translation_row_get_icon_name (self));
		break;
		case WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY:
		g_value_take_string (value, widgets_translation_row_get_title (self));
		break;
		case WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY:
		g_value_take_string (value, widgets_translation_row_get_subtitle (self));
		break;
		case WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY:
		g_value_set_double (value, widgets_translation_row_get_progress (self));
		break;
		case WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY:
		g_value_set_boolean (value, widgets_translation_row_get_is_ready_to_animate (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_translation_row_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	WidgetsTranslationRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_TRANSLATION_ROW, WidgetsTranslationRow);
	switch (property_id) {
		case WIDGETS_TRANSLATION_ROW_ICON_NAME_PROPERTY:
		widgets_translation_row_set_icon_name (self, g_value_get_string (value));
		break;
		case WIDGETS_TRANSLATION_ROW_TITLE_PROPERTY:
		widgets_translation_row_set_title (self, g_value_get_string (value));
		break;
		case WIDGETS_TRANSLATION_ROW_SUBTITLE_PROPERTY:
		widgets_translation_row_set_subtitle (self, g_value_get_string (value));
		break;
		case WIDGETS_TRANSLATION_ROW_PROGRESS_PROPERTY:
		widgets_translation_row_set_progress (self, g_value_get_double (value));
		break;
		case WIDGETS_TRANSLATION_ROW_IS_READY_TO_ANIMATE_PROPERTY:
		widgets_translation_row_set_is_ready_to_animate (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

