[gtk/wip/chergert/spellcheck: 31/40] spellcheck: add series of fallbacks when loading default
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/spellcheck: 31/40] spellcheck: add series of fallbacks when loading default
- Date: Tue, 30 Mar 2021 20:08:06 +0000 (UTC)
commit c77de7d3282c9b9757eaf5f4a056d8ff172248a1
Author: Christian Hergert <chergert redhat com>
Date: Mon Mar 15 15:06:30 2021 -0700
spellcheck: add series of fallbacks when loading default
gtk/gtkspellcheck.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkspellcheck.c b/gtk/gtkspellcheck.c
index fc64454dd4..cfbf49d5d2 100644
--- a/gtk/gtkspellcheck.c
+++ b/gtk/gtkspellcheck.c
@@ -377,7 +377,17 @@ gtk_spell_checker_get_default (void)
if (instance == NULL)
{
- instance = gtk_spell_checker_new_for_language ("en_US");
+ const char * const *langs = g_get_language_names ();
+
+ if (langs != NULL)
+ instance = gtk_spell_checker_new_for_languages (langs);
+
+ if (instance == NULL)
+ instance = gtk_spell_checker_new_for_language ("en_US");
+
+ if (instance == NULL)
+ instance = gtk_spell_checker_new_for_language ("C");
+
g_object_add_weak_pointer (G_OBJECT (instance), (gpointer *)&instance);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]