Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check also plain language string in as_component_localized_get #185

Merged
merged 2 commits into from Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1119,10 +1119,16 @@ as_component_localized_get (AsComponent *cpt, GHashTable *lht)
gchar *msg;
AsComponentPrivate *priv = GET_PRIVATE (cpt);

msg = g_hash_table_lookup (lht, as_component_get_active_locale (cpt));
const gchar *comp_locale = as_component_get_active_locale (cpt);
const gchar *comp_lang = as_utils_locale_to_language (comp_locale);
msg = g_hash_table_lookup (lht, comp_locale);
if ((msg == NULL) && (!as_flags_contains (priv->value_flags, AS_VALUE_FLAG_NO_TRANSLATION_FALLBACK))) {
/* fall back to untranslated / default */
msg = g_hash_table_lookup (lht, "C");
/* fall back to language string */
msg = g_hash_table_lookup (lht, comp_lang);
if (msg == NULL) {
/* fall back to untranslated / default */
msg = g_hash_table_lookup (lht, "C");
}
}

return msg;