Commit 30a7c56e authored by Frank Arnold's avatar Frank Arnold Committed by Frank Arnold

Moved markup out of gettext messages.

2006-01-13  Frank Arnold  <farnold@cvs.gnome.org>

	* gedit/gedit-io-error-message-area.c:
	* gedit/gedit-tab.c:
	* gedit/gedit-utils.c: Moved markup out of gettext messages.
parent 2606b42e
2006-01-13 Frank Arnold <farnold@cvs.gnome.org>
* gedit/gedit-io-error-message-area.c:
* gedit/gedit-tab.c:
* gedit/gedit-utils.c: Moved markup out of gettext messages.
=== gedit 2.13.2 ===
2006-01-02 Paolo Borelli <pborelli@katamail.com>
2006-01-11 Paolo Borelli <pborelli@katamail.com>
* configure.ac:
* README:
......
......@@ -120,6 +120,7 @@ gedit_unrecoverable_loading_error_message_area_new (const gchar *uri,
gchar *message_details = NULL;
gchar *full_formatted_uri;
gchar *scheme_string;
gchar *scheme_markup;
gchar *uri_for_display;
gchar *temp_uri_for_display;
GtkWidget *message_area;
......@@ -159,9 +160,12 @@ gedit_unrecoverable_loading_error_message_area_new (const gchar *uri,
if ((scheme_string != NULL) && g_utf8_validate (scheme_string, -1, NULL))
{
/* Translators: %s is a URI scheme (like for example http, ftp, etc.) */
message_details = g_strdup_printf (_("gedit cannot handle <i>%s:</i> locations."),
scheme_string);
scheme_markup = g_strdup_printf ("<i>%s:</i>", scheme_string);
/* Translators: %s is a URI scheme (like for example http:, ftp:, etc.) */
message_details = g_strdup_printf (_("gedit cannot handle %s locations."),
scheme_markup);
g_free (scheme_markup);
}
else
{
......@@ -226,15 +230,17 @@ gedit_unrecoverable_loading_error_message_area_new (const gchar *uri,
if (hn != NULL)
{
gchar *host_name = gedit_utils_make_valid_utf8 (hn);
gchar *host_markup = g_strdup_printf ("<i>%s</i>", host_name);
g_free (host_name);
/* Translators: %s is a host name */
message_details = g_strdup_printf (
_("Host <i>%s</i> could not be found. "
_("Host %s could not be found. "
"Please, check that your proxy settings "
"are correct and try again."),
host_name);
host_markup);
g_free (host_name);
g_free (host_markup);
}
else
{
......@@ -342,6 +348,7 @@ gedit_unrecoverable_reverting_error_message_area_new (const gchar *uri,
gchar *message_details = NULL;
gchar *full_formatted_uri;
gchar *scheme_string;
gchar *scheme_markup;
gchar *uri_for_display;
gchar *temp_uri_for_display;
GtkWidget *message_area;
......@@ -379,8 +386,12 @@ gedit_unrecoverable_reverting_error_message_area_new (const gchar *uri,
if ((scheme_string != NULL) && g_utf8_validate (scheme_string, -1, NULL))
{
message_details = g_strdup_printf (_("gedit cannot handle <i>%s:</i> locations."),
scheme_string);
scheme_markup = g_strdup_printf ("<i>%s:</i>", scheme_string);
/* Translators: %s is a URI scheme (like for example http:, ftp:, etc.) */
message_details = g_strdup_printf (_("gedit cannot handle %s locations."),
scheme_markup);
g_free (scheme_markup);
}
else
{
......@@ -436,15 +447,17 @@ gedit_unrecoverable_reverting_error_message_area_new (const gchar *uri,
if (hn != NULL)
{
gchar *host_name = gedit_utils_make_valid_utf8 (hn);
gchar *host_markup = g_strdup_printf ("<i>%s</i>", host_name);
g_free (host_name);
/* Translators: %s is a host name */
message_details = g_strdup_printf (
_("Host <i>%s</i> could not be found. "
_("Host %s could not be found. "
"Please, check that your proxy settings "
"are correct and try again."),
host_name);
host_markup);
g_free (host_name);
g_free (host_markup);
}
else
{
......@@ -553,10 +566,14 @@ create_option_menu (GtkWidget *message_area, GtkWidget *vbox)
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *menu;
gchar *label_markup;
hbox = gtk_hbox_new (FALSE, 6);
label = gtk_label_new_with_mnemonic (_("<small>Ch_aracter Coding:</small>"));
label_markup = g_strdup_printf ("<small>%s</small>",
_("Ch_aracter Coding:"));
label = gtk_label_new_with_mnemonic (label_markup);
g_free (label_markup);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
menu = gedit_encodings_option_menu_new (TRUE);
g_object_set_data (G_OBJECT (message_area),
......@@ -1073,6 +1090,7 @@ gedit_unrecoverable_saving_error_message_area_new (const gchar *uri,
gchar *message_details = NULL;
gchar *full_formatted_uri;
gchar *scheme_string;
gchar *scheme_markup;
gchar *uri_for_display;
gchar *temp_uri_for_display;
GtkWidget *message_area;
......@@ -1101,11 +1119,14 @@ gedit_unrecoverable_saving_error_message_area_new (const gchar *uri,
if ((scheme_string != NULL) && g_utf8_validate (scheme_string, -1, NULL))
{
/* Translators: %s is a URI scheme (like for example http, ftp, etc.) */
message_details = g_strdup_printf (_("gedit cannot handle <i>%s:</i> locations in write mode. "
scheme_markup = g_strdup_printf ("<i>%s:</i>", scheme_string);
/* Translators: %s is a URI scheme (like for example http:, ftp:, etc.) */
message_details = g_strdup_printf (_("gedit cannot handle %s locations in write mode. "
"Please, check that you typed the "
"location correctly and try again."),
scheme_string);
scheme_markup);
g_free (scheme_markup);
}
else
{
......@@ -1173,15 +1194,17 @@ gedit_unrecoverable_saving_error_message_area_new (const gchar *uri,
if (hn != NULL)
{
gchar *host_name = gedit_utils_make_valid_utf8 (hn);
gchar *host_markup = g_strdup_printf ("<i>%s</i>", host_name);
g_free (host_name);
/* Translators: %s is a host name */
message_details = g_strdup_printf (
_("Host <i>%s</i> could not be found. "
_("Host %s could not be found. "
"Please, check that your proxy settings "
"are correct and try again."),
host_name);
host_markup);
g_free (host_name);
g_free (host_markup);
}
else
{
......
......@@ -439,6 +439,8 @@ show_loading_message_area (GeditTab *tab)
gchar *name;
gchar *dirname = NULL;
gchar *msg = NULL;
gchar *name_markup;
gchar *dirname_markup;
gint len;
if (tab->priv->message_area != NULL)
......@@ -486,20 +488,25 @@ show_loading_message_area (GeditTab *tab)
}
}
name_markup = g_strdup_printf ("<b>%s</b>", name);
if (tab->priv->state == GEDIT_TAB_STATE_REVERTING)
{
if (dirname != NULL)
{
dirname_markup = g_strdup_printf ("<b>%s</b>", dirname);
/* Translators: the first %s is a file name (e.g. test.txt) the second one
is a directory (e.g. ssh://master.gnome.org/home/users/paolo) */
msg = g_markup_printf_escaped (_("Reverting <b>%s</b> from <b>%s</b>"),
name,
dirname);
msg = g_markup_printf_escaped (_("Reverting %s from %s"),
name_markup,
dirname_markup);
g_free (dirname_markup);
}
else
{
msg = g_markup_printf_escaped (_("Reverting <b>%s</b>"),
name);
msg = g_markup_printf_escaped (_("Reverting %s"),
name_markup);
}
area = gedit_progress_message_area_new (GTK_STOCK_REVERT_TO_SAVED,
......@@ -510,16 +517,19 @@ show_loading_message_area (GeditTab *tab)
{
if (dirname != NULL)
{
dirname_markup = g_strdup_printf ("<b>%s</b>", dirname);
/* Translators: the first %s is a file name (e.g. test.txt) the second one
is a directory (e.g. ssh://master.gnome.org/home/users/paolo) */
msg = g_markup_printf_escaped (_("Loading <b>%s</b> from <b>%s</b>"),
name,
dirname);
msg = g_markup_printf_escaped (_("Loading %s from %s"),
name_markup,
dirname_markup);
g_free (dirname_markup);
}
else
{
msg = g_markup_printf_escaped (_("Loading <b>%s</b>"),
name);
msg = g_markup_printf_escaped (_("Loading %s"),
name_markup);
}
area = gedit_progress_message_area_new (GTK_STOCK_OPEN,
......@@ -538,6 +548,7 @@ show_loading_message_area (GeditTab *tab)
g_free (msg);
g_free (name);
g_free (name_markup);
g_free (dirname);
}
......@@ -549,6 +560,8 @@ show_saving_message_area (GeditTab *tab)
gchar *short_name;
gchar *from;
gchar *to = NULL;
gchar *from_markup;
gchar *to_markup;
gchar *msg = NULL;
gint len;
......@@ -590,17 +603,22 @@ show_saving_message_area (GeditTab *tab)
to = str;
}
from_markup = g_strdup_printf ("<b>%s</b>", from);
if (to != NULL)
{
to_markup = g_strdup_printf("<b>%s</b>", to);
/* Translators: the first %s is a file name (e.g. test.txt) the second one
is a directory (e.g. ssh://master.gnome.org/home/users/paolo) */
msg = g_markup_printf_escaped (_("Saving <b>%s</b> to <b>%s</b>"),
from,
to);
msg = g_markup_printf_escaped (_("Saving %s to %s"),
from_markup,
to_markup);
g_free (to_markup);
}
else
{
msg = g_markup_printf_escaped (_("Saving <b>%s</b>"), to);
msg = g_markup_printf_escaped (_("Saving %s"), from_markup);
}
area = gedit_progress_message_area_new (GTK_STOCK_SAVE,
......@@ -614,6 +632,7 @@ show_saving_message_area (GeditTab *tab)
g_free (msg);
g_free (to);
g_free (from);
g_free (from_markup);
}
static void
......@@ -1355,6 +1374,7 @@ _gedit_tab_get_tooltips (GeditTab *tab)
gchar *tip;
gchar *uri;
gchar *ruri;
gchar *ruri_markup;
gchar *mime_type;
const gchar *mime_description = NULL;
gchar *mime_full_description;
......@@ -1371,21 +1391,23 @@ _gedit_tab_get_tooltips (GeditTab *tab)
ruri = gedit_utils_replace_home_dir_with_tilde (uri);
g_free (uri);
ruri_markup = g_strdup_printf ("<i>%s</i>", ruri);
switch (tab->priv->state)
{
case GEDIT_TAB_STATE_LOADING_ERROR:
tip = g_markup_printf_escaped(_("Error opening file <i>%s</i>."),
ruri);
tip = g_markup_printf_escaped(_("Error opening file %s."),
ruri_markup);
break;
case GEDIT_TAB_STATE_REVERTING_ERROR:
tip = g_markup_printf_escaped(_("Error reverting file <i>%s</i>."),
ruri);
tip = g_markup_printf_escaped(_("Error reverting file %s."),
ruri_markup);
break;
case GEDIT_TAB_STATE_SAVING_ERROR:
tip = g_markup_printf_escaped(_("Error saving file <i>%s</i>."),
ruri);
tip = g_markup_printf_escaped(_("Error saving file %s."),
ruri_markup);
break;
default:
mime_type = gedit_document_get_mime_type (doc);
......@@ -1420,6 +1442,7 @@ _gedit_tab_get_tooltips (GeditTab *tab)
}
g_free (ruri);
g_free (ruri_markup);
return tip;
}
......
......@@ -879,10 +879,6 @@ gedit_utils_is_valid_uri (const gchar *uri)
}
#define GEDIT_MISSING_FILE N_("<span size=\"large\" weight=\"bold\">Unable to find file <i>%s</i>.</span>\n\nPlease, check your installation.")
#define GEDIT_MISSING_WIDGETS N_("<span size=\"large\" weight=\"bold\">Unable to find the required widgets inside file <i>%s</i>..</span>\n\nPlease, check your installation.")
/**
* gedit_utils_get_glade_widgets:
* @filename: the path to the glade file
......@@ -910,6 +906,8 @@ gedit_utils_get_glade_widgets (const gchar *filename,
va_list args;
const gchar *name;
gchar *msg;
gchar *filename_markup;
gchar *msg_plain;
gboolean ret = TRUE;
g_return_val_if_fail (filename != NULL, FALSE);
......@@ -921,11 +919,18 @@ gedit_utils_get_glade_widgets (const gchar *filename,
gui = glade_xml_new (filename, root_node, NULL);
if (!gui)
{
msg = g_strdup_printf (GEDIT_MISSING_FILE, filename);
filename_markup = g_strdup_printf ("<i>%s</i>", filename);
msg_plain = g_strdup_printf (_("Unable to find file %s."),
filename_markup);
msg = g_strconcat ("<span size=\"large\" weight=\"bold\">",
msg_plain, "</span>\n\n",
_("Please check your installation."), NULL);
label = gtk_label_new (msg);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (filename_markup);
g_free (msg_plain);
g_free (msg);
*error_widget = label;
......@@ -942,11 +947,19 @@ gedit_utils_get_glade_widgets (const gchar *filename,
*wid = glade_xml_get_widget (gui, name);
if (*wid == NULL)
{
msg = g_strdup_printf (GEDIT_MISSING_WIDGETS, filename);
filename_markup = g_strdup_printf ("<i>%s</i>", filename);
msg_plain = g_strdup_printf (
_("Unable to find the required widgets inside file %s."),
filename_markup);
msg = g_strconcat ("<span size=\"large\" weight=\"bold\">",
msg_plain, "</span>\n\n",
_("Please check your installation."), NULL);
label = gtk_label_new (msg);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
g_free (filename_markup);
g_free (msg_plain);
g_free (msg);
*error_widget = label;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment