bugfix: store translations in the C locale so we can still provide a package name in C even if there are no translations

This commit is contained in:
Richard Hughes 2008-09-17 12:42:07 +01:00
parent 2661b12271
commit abcd1d57ad
2 changed files with 15 additions and 0 deletions

View File

@ -157,6 +157,11 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
/* get the default entry */
name_unlocalised = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Name", NULL);
if (!egg_strzero (name_unlocalised)) {
g_print ("C");
pk_extra_set_locale (extra, "C");
pk_extra_set_data_locale (extra, package_name, name_unlocalised);
}
/* for each locale */
for (i=0; i<locale_array->len; i++) {

View File

@ -229,6 +229,16 @@ pk_extra_populate_locale_cache (PkExtra *extra)
sqlite3_free (error_msg);
return FALSE;
}
/* get summary packages - no translation */
statement = g_strdup_printf ("SELECT package, summary FROM localised WHERE locale = '%s'", "C");
rc = sqlite3_exec (extra->priv->db, statement, pk_extra_populate_locale_cache_callback, extra, &error_msg);
g_free (statement);
if (rc != SQLITE_OK) {
egg_warning ("SQL error: %s\n", error_msg);
sqlite3_free (error_msg);
return FALSE;
}
return TRUE;
}