[master][PATCH] Retranslate also layout indicator when retranslating BaseWindow (#1007087)
Vratislav Podzimek
vpodzime at redhat.com
Thu Sep 12 14:02:13 UTC 2013
Also add 'lang' param description to the documentation.
Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
widgets/src/BaseWindow.c | 4 ++++
widgets/src/LayoutIndicator.c | 16 ++++++++++++++++
widgets/src/LayoutIndicator.h | 1 +
widgets/src/StandaloneWindow.c | 1 +
4 files changed, 22 insertions(+)
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 6267dbe..67aac36 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -573,6 +573,7 @@ void anaconda_base_window_clear_info(AnacondaBaseWindow *win) {
/**
* anaconda_base_window_retranslate:
* @win: a #AnacondaBaseWindow
+ * @lang: target language
*
* Reload translations for this widget as needed. Generally, this is not
* needed. However when changing the language during installation, we need
@@ -609,6 +610,9 @@ void anaconda_base_window_retranslate(AnacondaBaseWindow *win, const char *lang)
}
format_beta_label(win, _(win->priv->orig_beta));
+
+ /* retranslate the layout indicator */
+ anaconda_layout_indicator_retranslate(ANACONDA_LAYOUT_INDICATOR(win->priv->layout_indicator));
}
static GtkBuildableIface *parent_buildable_iface;
diff --git a/widgets/src/LayoutIndicator.c b/widgets/src/LayoutIndicator.c
index e50987c..c76768d 100644
--- a/widgets/src/LayoutIndicator.c
+++ b/widgets/src/LayoutIndicator.c
@@ -444,3 +444,19 @@ void anaconda_layout_indicator_set_label_width(AnacondaLayoutIndicator *indicato
anaconda_layout_indicator_set_property(G_OBJECT(indicator), PROP_LABEL_WIDTH,
&width, NULL);
}
+
+/**
+ * anaconda_layout_indicator_retranslate:
+ * @indicator: a #AnacondaLayoutIndicator
+ *
+ * Reload translations for this widget as needed. Generally, this is not
+ * needed. However when changing the language during installation, we need to
+ * be able to make sure the screen gets retranslated. This function must be
+ * called after the LANG environment variable, locale and gettext magic are set.
+ *
+ * Since: 1.0
+ */
+void anaconda_layout_indicator_retranslate(AnacondaLayoutIndicator *indicator) {
+ gtk_widget_set_tooltip_text(GTK_WIDGET(indicator),
+ g_strdup_printf(TOOLTIP_FORMAT_STR, indicator->priv->layout));
+}
diff --git a/widgets/src/LayoutIndicator.h b/widgets/src/LayoutIndicator.h
index 82694e6..d598e8b 100644
--- a/widgets/src/LayoutIndicator.h
+++ b/widgets/src/LayoutIndicator.h
@@ -72,6 +72,7 @@ gchar *anaconda_layout_indicator_get_current_layout (AnacondaLayoutIndicato
guint anaconda_layout_indicator_get_label_width (AnacondaLayoutIndicator *indicator);
void anaconda_layout_indicator_set_label_width (AnacondaLayoutIndicator *indicator,
guint new_width);
+void anaconda_layout_indicator_retranslate (AnacondaLayoutIndicator *indicator);
G_END_DECLS
diff --git a/widgets/src/StandaloneWindow.c b/widgets/src/StandaloneWindow.c
index 28b25e2..5bf8c1c 100644
--- a/widgets/src/StandaloneWindow.c
+++ b/widgets/src/StandaloneWindow.c
@@ -218,6 +218,7 @@ void anaconda_standalone_window_set_may_continue(AnacondaStandaloneWindow *win,
/**
* anaconda_standalone_window_retranslate:
* @win: a #AnacondaStaldaloneWindow
+ * @lang: target language
*
* Reload translations for this widget as needed. Generally, this is not
* needed. However when changing the language during installation, we need
--
1.7.11.7
More information about the anaconda-patches
mailing list