summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-12-22 23:34:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-22 20:21:51 -0800
commit8639e1483576e58a7615310e3b8cb3705299981f (patch)
treef6b1bf55e809ce3744788376951d7ec654180f75 /gtk-gui.c
parentba223798d3f0116d242e0010063c81f87eecf9f5 (diff)
downloadsubsurface-8639e1483576e58a7615310e3b8cb3705299981f.tar.gz
Make it possible to translate strings containing subscript "2"
The "Tec settings" dialog contains some strings with the subscript "2" character, which have to be translated. While the "2" is part of the string xgettext doesn't seem to recognize such. To trick it we use a temporary buffer and c-format: sprintf(utf8_buf, _("Show pO%s graph"), UTF8_SUBSCRIPT_2); button = gtk_check_button_new_with_label(utf8_buf); Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 3edb3f667..773098e71 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -575,7 +575,7 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
GtkWidget *dialog, *notebook, *font, *frame, *box, *vbox, *button, *xmlfile_button;
GtkWidget *entry_po2, *entry_pn2, *entry_phe;
const char *current_default, *new_default;
- char threshold_text[10];
+ char threshold_text[10], utf8_buf[128];
struct preferences oldprefs = prefs;
dialog = gtk_dialog_new_with_buttons(_("Preferences"),
@@ -716,12 +716,14 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
box = gtk_hbox_new(FALSE, 6);
gtk_container_add(GTK_CONTAINER(vbox), box);
- button = gtk_check_button_new_with_label(_("Show pO" UTF8_SUBSCRIPT_2 " graph"));
+ sprintf(utf8_buf, _("Show pO%s graph"), UTF8_SUBSCRIPT_2);
+ button = gtk_check_button_new_with_label(utf8_buf);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), prefs.pp_graphs.po2);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(po2_toggle), &entry_po2);
- frame = gtk_frame_new(_("pO" UTF8_SUBSCRIPT_2 " threshold"));
+ sprintf(utf8_buf, _("pO%s threshold"), UTF8_SUBSCRIPT_2);
+ frame = gtk_frame_new(utf8_buf);
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 6);
entry_po2 = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(entry_po2), 4);
@@ -733,12 +735,14 @@ static void preferences_dialog(GtkWidget *w, gpointer data)
box = gtk_hbox_new(FALSE, 6);
gtk_container_add(GTK_CONTAINER(vbox), box);
- button = gtk_check_button_new_with_label(_("Show pN" UTF8_SUBSCRIPT_2 " graph"));
+ sprintf(utf8_buf, _("Show pN%s graph"), UTF8_SUBSCRIPT_2);
+ button = gtk_check_button_new_with_label(utf8_buf);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), prefs.pp_graphs.pn2);
gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 6);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(pn2_toggle), &entry_pn2);
- frame = gtk_frame_new(_("pN" UTF8_SUBSCRIPT_2 " threshold"));
+ sprintf(utf8_buf, _("pN%s threshold"), UTF8_SUBSCRIPT_2);
+ frame = gtk_frame_new(utf8_buf);
gtk_box_pack_start(GTK_BOX(box), frame, FALSE, FALSE, 6);
entry_pn2 = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(entry_pn2), 4);