Commit 57143e31 authored by Christian Persch's avatar Christian Persch

Inherit gettext-domain from <schemalist>

When the <schema> doesn't have a 'gettext-domain' attribute, but
the <schemalist> does, use that one.

Bug #635640.
parent 69129e80
......@@ -1228,7 +1228,9 @@ start_element (GMarkupParseContext *context,
OPTIONAL | STRING, "gettext-domain", &gettext_domain,
OPTIONAL | STRING, "extends", &extends,
OPTIONAL | STRING, "list-of", &list_of))
parse_state_start_schema (state, id, path, gettext_domain,
parse_state_start_schema (state, id, path,
gettext_domain ? gettext_domain
: state->schemalist_domain,
extends, list_of, error);
return;
}
......
......@@ -374,6 +374,7 @@ schema_tests = \
schema-tests/extending.gschema.xml \
schema-tests/from-docs.gschema.xml \
schema-tests/incomplete-list.gschema.xml \
schema-tests/inherit-gettext-domain.gschema.xml \
schema-tests/invalid-path.gschema.xml \
schema-tests/key-in-list-indirect.gschema.xml \
schema-tests/key-in-list.gschema.xml \
......
......@@ -117,9 +117,11 @@ static const SchemaTest tests[] = {
{ "flags-bad-default", NULL, "*<default> * not in the specified flags type*" },
{ "flags-more-than-one-bit", NULL, "*flags values must have at most 1 bit set*" },
{ "flags-with-enum-attr", NULL, "*<enum id='flags'> not (yet) defined*" },
{ "flags-with-enum-tag", NULL, "*<flags id='flags'> not (yet) defined*" }
{ "flags-with-enum-tag", NULL, "*<flags id='flags'> not (yet) defined*" },
{ "inherit-gettext-domain", NULL, NULL }
};
int
main (int argc, char *argv[])
{
......
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="foo">
<schema id="bar">
<key name="baz" type="s">
<default l10n="messages" context="foobar">'value'</default>
</key>
</schema>
</schemalist>
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