Allow domains to be overridden in <interface>'s if a translation-domain is

2008-01-06  Johan Dahlin  <johan@gnome.org>

	* gtk/gtkbuilderparser.c (parse_interface): 
	Allow domains to be overridden in <interface>'s if a translation-domain
	is set in the builder.
	(_gtk_builder_parser_parse_buffer): Do not modify the translation-domain
	of the builder, make the domain set in the <interface> apply only to strings
	in that interface.
	(#496831, Ryan Lortie)


svn path=/trunk/; revision=19316
This commit is contained in:
Johan Dahlin 2008-01-06 15:17:26 +00:00 committed by Johan Dahlin
parent bf4f21118a
commit 0e09e8b3ff
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,13 @@
2008-01-06 Johan Dahlin <johan@gnome.org>
* gtk/gtkbuilderparser.c (parse_interface):
Allow domains to be overridden in <interface>'s if a translation-domain
is set in the builder.
(_gtk_builder_parser_parse_buffer): Do not modify the translation-domain
of the builder, make the domain set in the <interface> apply only to strings
in that interface.
(#496831, Ryan Lortie)
* gtk/gtkbuilder.c: Avoid adding unnecessary trailing newlines
to g_warning calls.

View File

@ -534,8 +534,9 @@ parse_interface (ParserData *data,
for (i = 0; names[i] != NULL; i++)
{
if (strcmp (names[i], "domain") == 0 && !data->domain)
if (strcmp (names[i], "domain") == 0)
{
g_free (data->domain);
data->domain = g_strdup (values[i]);
break;
}
@ -962,7 +963,6 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
if (!g_markup_parse_context_parse (data->ctx, buffer, length, error))
goto out;
gtk_builder_set_translation_domain (data->builder, data->domain);
_gtk_builder_finish (builder);
/* Custom parser_finished */