[gnome-builder] libide/editor: synthesize a "plain" language
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/editor: synthesize a "plain" language
- Date: Wed, 5 Oct 2022 23:56:06 +0000 (UTC)
commit 92b890ad5cf0471d3ac1705ba5881d53d9ffcb7a
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 5 16:53:06 2022 -0700
libide/editor: synthesize a "plain" language
We don't ever load this language, but we can use it to make sure we have
settings in tweaks/etc. Additionally, the "plain" I'd can be used for
setting tweaks and have them applied by IdeBuffer when no language is set.
Fixes #224
src/libide/editor/libide-editor.gresource.xml | 3 +++
src/libide/editor/plain.lang | 27 ++++++++++++++++++++++
.../editorui/gbp-editorui-workspace-addin.c | 4 ++--
3 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/editor/libide-editor.gresource.xml b/src/libide/editor/libide-editor.gresource.xml
index d29b0f8f5..640cfb359 100644
--- a/src/libide/editor/libide-editor.gresource.xml
+++ b/src/libide/editor/libide-editor.gresource.xml
@@ -8,4 +8,7 @@
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
<file>style.css</file>
</gresource>
+ <gresource prefix="/org/gnome/builder/gtksourceview/language-specs">
+ <file>plain.lang</file>
+ </gresource>
</gresources>
diff --git a/src/libide/editor/plain.lang b/src/libide/editor/plain.lang
new file mode 100644
index 000000000..27fe6348c
--- /dev/null
+++ b/src/libide/editor/plain.lang
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This file is part of GtkSourceView
+
+ Authors: Marco Barisione, Emanuele Aina
+ Copyright (C) 2005-2007 Marco Barisione <barisione gmail com>
+ Copyright (C) 2005-2007 Emanuele Aina
+
+ GtkSourceView is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ GtkSourceView is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+-->
+<language id="plain" name="Plain Text" version="2.0" _section="Other">
+ <context id="plain">
+ </context>
+</language>
diff --git a/src/plugins/editorui/gbp-editorui-workspace-addin.c
b/src/plugins/editorui/gbp-editorui-workspace-addin.c
index cff5024be..7fc537542 100644
--- a/src/plugins/editorui/gbp-editorui-workspace-addin.c
+++ b/src/plugins/editorui/gbp-editorui-workspace-addin.c
@@ -119,8 +119,8 @@ language_to_label (GBinding *binding,
if (language != NULL)
g_value_set_string (to_value, gtk_source_language_get_name (language));
else
- /* translators: "Text" means plaintext or text/plain */
- g_value_set_static_string (to_value, _("Text"));
+ /* translators: "Plain Text" means text without formatting */
+ g_value_set_static_string (to_value, _("Plain Text"));
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]