[gnome-initial-setup] language: Add some likely relevant languages to the initial list
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] language: Add some likely relevant languages to the initial list
- Date: Tue, 21 May 2013 18:03:57 +0000 (UTC)
commit 04d8f074fe68645fa5ba31fa04c24abd957f38aa
Author: Rui Matos <tiagomatos gmail com>
Date: Tue May 21 18:15:49 2013 +0200
language: Add some likely relevant languages to the initial list
We can reuse this otherwise unused function to add the current
environment locale and other user accounts' languages to expand our
initial list of languages a bit and make it more likely to be
immediately useful without having to expand to the full list.
https://bugzilla.gnome.org/show_bug.cgi?id=700786
.../pages/language/cc-common-language.c | 43 +++++++++----------
1 files changed, 20 insertions(+), 23 deletions(-)
---
diff --git a/gnome-initial-setup/pages/language/cc-common-language.c
b/gnome-initial-setup/pages/language/cc-common-language.c
index a2acb33..129a67b 100644
--- a/gnome-initial-setup/pages/language/cc-common-language.c
+++ b/gnome-initial-setup/pages/language/cc-common-language.c
@@ -274,6 +274,25 @@ insert_language (GHashTable *ht,
g_free (label_untranslated);
}
+static void
+insert_user_languages (GHashTable *ht)
+{
+ char *name;
+ char *language;
+
+ /* Add the languages used by other users on the system */
+ add_other_users_language (ht);
+
+ /* Add current locale */
+ name = cc_common_language_get_current_language ();
+ if (g_hash_table_lookup (ht, name) == NULL) {
+ language = gnome_get_language_from_locale (name, NULL);
+ g_hash_table_insert (ht, name, language);
+ } else {
+ g_free (name);
+ }
+}
+
GHashTable *
cc_common_language_get_initial_languages (void)
{
@@ -291,29 +310,7 @@ cc_common_language_get_initial_languages (void)
insert_language (ht, "ru_RU");
insert_language (ht, "ar_EG");
- return ht;
-}
-
-GHashTable *
-cc_common_language_get_user_languages (void)
-{
- GHashTable *ht;
- char *name;
- char *language;
-
- ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
-
- /* Add the languages used by other users on the system */
- add_other_users_language (ht);
-
- /* Add current locale */
- name = cc_common_language_get_current_language ();
- if (g_hash_table_lookup (ht, name) == NULL) {
- language = gnome_get_language_from_locale (name, NULL);
- g_hash_table_insert (ht, name, language);
- } else {
- g_free (name);
- }
+ insert_user_languages (ht);
return ht;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]