Re: [PATCH] Fix gtk_builder_set_translation_domain() calling



On Wed, 2011-08-17 at 14:31 +0300, Ozan Çağlayan wrote:
> gtk_builder_set_translation_domain() should be called before
> gtk_builder_add_from_file(). This fixes UI messages always in English
> problem.
> ---
>  properties/nm-vpnc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
>  NOTE: This should also be applied to NetworkManager-vpnc NM_0_8 branch.

Applied to both, thanks!
Dan

> diff --git a/properties/nm-vpnc.c b/properties/nm-vpnc.c
> index 34f4fc0..86d37eb 100644
> --- a/properties/nm-vpnc.c
> +++ b/properties/nm-vpnc.c
> @@ -927,6 +927,8 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
>  	ui_file = g_strdup_printf ("%s/%s", UIDIR, "nm-vpnc-dialog.ui");
>  	priv->builder = gtk_builder_new ();
>  
> +	gtk_builder_set_translation_domain (priv->builder, GETTEXT_PACKAGE);
> +
>  	if (!gtk_builder_add_from_file (priv->builder, ui_file, error)) {
>  		g_warning ("Couldn't load builder file: %s",
>  		           error && *error ? (*error)->message : "(unknown)");
> @@ -939,8 +941,6 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
>  	}
>  	g_free (ui_file);
>  
> -	gtk_builder_set_translation_domain (priv->builder, GETTEXT_PACKAGE);
> -
>  	priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "vpnc-vbox"));
>  	if (!priv->widget) {
>  		g_set_error (error, VPNC_PLUGIN_UI_ERROR, 0, "could not load UI widget");




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]