summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-06-10 15:41:41 +0100
committerRichard Hughes <richard@hughsie.com>2014-06-10 15:41:41 +0100
commit1f6f146c3415c835cab1d2ad13b7341ce8d38092 (patch)
tree30de371759a21cbadb2d08ea1b6c44f3c5b5587e
parent2945dab63e0978ca19dbf35054e3fb2a81824654 (diff)
downloadappstream-glib-1f6f146c3415c835cab1d2ad13b7341ce8d38092.tar.gz
Correctly use convert-translatable when the source kind is already set
-rw-r--r--libappstream-glib/as-app.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c
index d1c77d9..0510b98 100644
--- a/libappstream-glib/as-app.c
+++ b/libappstream-glib/as-app.c
@@ -2764,10 +2764,8 @@ as_app_parse_file (AsApp *app,
if (priv->source_kind == AS_APP_SOURCE_KIND_UNKNOWN) {
if (g_str_has_suffix (filename, ".desktop")) {
as_app_set_source_kind (app, AS_APP_SOURCE_KIND_DESKTOP);
- } else if (g_str_has_suffix (filename, ".appdata.xml")) {
- as_app_set_source_kind (app, AS_APP_SOURCE_KIND_APPDATA);
- } else if (g_str_has_suffix (filename, ".appdata.xml.in")) {
- flags |= AS_APP_PARSE_FLAG_CONVERT_TRANSLATABLE;
+ } else if (g_str_has_suffix (filename, ".appdata.xml") ||
+ g_str_has_suffix (filename, ".appdata.xml.in")) {
as_app_set_source_kind (app, AS_APP_SOURCE_KIND_APPDATA);
} else {
g_set_error (error,
@@ -2779,6 +2777,10 @@ as_app_parse_file (AsApp *app,
}
}
+ /* convert <_p> into <p> for easy validation */
+ if (g_str_has_suffix (filename, ".appdata.xml.in"))
+ flags |= AS_APP_PARSE_FLAG_CONVERT_TRANSLATABLE;
+
/* parse */
switch (priv->source_kind) {
case AS_APP_SOURCE_KIND_DESKTOP: