[gtk/wip/chergert/spellcheck] 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] spellcheck: add series of fallbacks when loading default
- Date: Mon, 15 Mar 2021 22:06:40 +0000 (UTC)
commit 04a8f6845f7046ec1f4959c99b947deb7e714e26
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]