#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
if (object == NULL)
{
if (id)
- g_printerr ("No object with ID '%s' found\n", id);
+ g_printerr (_("No object with ID '%s' found\n"), id);
else
- g_printerr ("No previewable object found\n");
+ g_printerr (_("No previewable object found\n"));
exit (1);
}
if (!GTK_IS_WIDGET (object))
{
- g_printerr ("Objects of type %s can't be previewed\n", G_OBJECT_TYPE_NAME (object));
+ g_printerr (_("Objects of type %s can't be previewed\n"), G_OBJECT_TYPE_NAME (object));
exit (1);
}
if (gdk_display_get_default () == NULL)
{
- g_printerr ("Could not initialize windowing system\n");
+ g_printerr (_("Could not initialize windowing system\n"));
exit (1);
}
if (filenames == NULL)
{
- g_printerr ("No .ui file specified\n");
+ g_printerr (_("No .ui file specified\n"));
exit (1);
}
if (g_strv_length (filenames) > 1)
{
- g_printerr ("Can only preview a single .ui file\n");
+ g_printerr (_("Can only preview a single .ui file\n"));
exit (1);
}
#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
if (object == NULL)
{
if (id)
- g_printerr ("No object with ID '%s' found\n", id);
+ g_printerr (_("No object with ID '%s' found\n"), id);
else
- g_printerr ("No object found\n");
+ g_printerr (_("No object found\n"));
exit (1);
}
if (!GTK_IS_WIDGET (object))
{
- g_printerr ("Objects of type %s can't be screenshot\n", G_OBJECT_TYPE_NAME (object));
+ g_printerr (_("Objects of type %s can't be screenshot\n"), G_OBJECT_TYPE_NAME (object));
exit (1);
}
if (texture == NULL)
{
- g_printerr ("Failed to take a screenshot\n");
+ g_printerr (_("Failed to take a screenshot\n"));
exit (1);
}
if (g_file_test (save_to, G_FILE_TEST_EXISTS) && !force)
{
- g_printerr ("File %s exists.\n"
- "Use --force to overwrite.\n", save_to);
+ g_printerr (_("File %s exists.\n"
+ "Use --force to overwrite.\n"), save_to);
exit (1);
}
g_bytes_get_size (bytes),
&error))
{
- g_print ("Output written to %s.\n", save_to);
+ g_print (_("Output written to %s.\n"), save_to);
}
else
{
- g_printerr ("Failed to save %s: %s\n", save_to, error->message);
+ g_printerr (_("Failed to save %s: %s\n"), save_to, error->message);
exit (1);
}
if (gdk_display_get_default () == NULL)
{
- g_printerr ("Could not initialize windowing system\n");
+ g_printerr (_("Could not initialize windowing system\n"));
exit (1);
}
if (filenames == NULL)
{
- g_printerr ("No .ui file specified\n");
+ g_printerr (_("No .ui file specified\n"));
exit (1);
}
if (g_strv_length (filenames) > 2)
{
- g_printerr ("Can only screenshot a single .ui file and a single output file\n");
+ g_printerr (_("Can only screenshot a single .ui file and a single output file\n"));
exit (1);
}
#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
const char *property_name,
PropKind kind)
{
- const char *kind_str[] = { "", "Packing ", "Cell ", "Layout " };
+ char *name;
+ char *msg;
- g_printerr (_("%s:%d: %sproperty %s::%s not found\n"),
- data->input_filename, element->line_number, kind_str[kind], class_name, property_name);
+ name = g_strconcat (class_name, "::", property_name, NULL);
+ switch (kind)
+ {
+ case PROP_KIND_OBJECT:
+ msg = g_strdup_printf (_("Property %s not found"), name);
+ break;
+ case PROP_KIND_PACKING:
+ msg = g_strdup_printf (_("Packing property %s not found"), name);
+ break;
+ case PROP_KIND_CELL_PACKING:
+ msg = g_strdup_printf (_("Cell property %s not found"), name);
+ break;
+ case PROP_KIND_LAYOUT:
+ msg = g_strdup_printf (_("Layout property %s not found"), name);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ g_printerr ("%s:%d: %s\n", data->input_filename, element->line_number, msg);
+ g_free (name);
+ g_free (msg);
}
static gboolean
else if (end_child == NULL)
end_child = child;
else
- g_warning ("%s only accepts three children", get_class_name (element));
+ g_warning (_("%s only accepts three children"), get_class_name (element));
}
if (start_child)
if (data.root == NULL)
{
- g_printerr (_("Can’t parse “%s”\n"), filename);
+ g_printerr (_("Can’t parse “%s”: %s\n"), filename, "");
return FALSE;
}
if (!g_file_set_contents (data.input_filename, content, length, &error))
{
- g_printerr (_("Failed to write %s: “%s”\n"), data.input_filename, error->message);
+ g_printerr (_("Failed to write “%s”: “%s”\n"), data.input_filename, error->message);
return FALSE;
}
}
#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>
parent_type = g_type_from_name (parent_name);
if (parent_type == G_TYPE_INVALID)
{
- g_printerr ("Failed to lookup template parent type %s\n", parent_name);
+ g_printerr (_("Failed to lookup template parent type %s\n"), parent_name);
exit (1);
}
if (is_deprecated (name))
{
if (s->len == 0)
- g_string_append (s, "Deprecated types:\n");
+ g_string_append (s, _("Deprecated types:\n"));
g_string_append_printf (s, "%s", name);
g_string_append (s, "\n");
}
object = g_object_new (template_type, NULL);
if (!object)
{
- g_printerr ("Failed to create an instance of the template type %s\n", type_name);
+ g_printerr (_("Failed to create an instance of the template type %s\n"), type_name);
return FALSE;
}
exit (1);
}
+ if (!filenames)
+ {
+ g_printerr (_("No .ui file specified\n"));
+ exit (1);
+ }
+
g_option_context_free (context);
for (i = 0; filenames[i]; i++)
#include <string.h>
#include <errno.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <gtk/gtk.h>