mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
Inherit gettext-domain from <schemalist>
When the <schema> doesn't have a 'gettext-domain' attribute, but the <schemalist> does, use that one. Bug #635640.
This commit is contained in:
parent
69129e8065
commit
57143e311d
@ -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[])
|
||||
{
|
||||
|
@ -0,0 +1,8 @@
|
||||
<?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>
|
Loading…
Reference in New Issue
Block a user