aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco <francesco.bbt@gmail.com>2021-06-17 22:59:08 +0200
committerGitHub <noreply@github.com>2021-06-17 22:59:08 +0200
commit5dc72367396e8689442a9b3638e64cddee69047f (patch)
treec8257682521cb8c53d932f37bd67dca6df0b928f
parent538e44f960762fe4619494c72b8737d6dc22c7ba (diff)
parent57adcb345c4a14de9cf69a3f4f971455732a95ab (diff)
downloadlite-xl-plugins-5dc72367396e8689442a9b3638e64cddee69047f.tar.gz
lite-xl-plugins-5dc72367396e8689442a9b3638e64cddee69047f.zip
Merge pull request #33 from jgmdev/language-po
Added language_po
-rw-r--r--README.md1
-rw-r--r--plugins/language_po.lua20
2 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index c12aecf..a31c13a 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,7 @@ Plugin | Description
[`language_perl`](plugins/language_perl.lua?raw=1) | Syntax for the [Perl](https://perl.org) programming language
[`language_php`](plugins/language_php.lua?raw=1) | Syntax for the [PHP](https://php.net) programming language
[`language_pico8`](plugins/language_pico8.lua?raw=1) | Syntax for [Pico-8](https://www.lexaloffle.com/pico-8.php) cartridge files
+[`language_po`](plugins/language_po.lua?raw=1) | Syntax for [PO](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) translation files
[`language_powershell`](plugins/language_powershell.lua?raw=1) | Syntax for [PowerShell](https://docs.microsoft.com/en-us/powershell) scripting language
[`language_psql`](plugins/language_psql.lua?raw=1) | Syntax for the postgresql database access language
[`language_rust`](plugins/language_rust.lua?raw=1) | Syntax for the [Rust](https://rust-lang.org/) programming language
diff --git a/plugins/language_po.lua b/plugins/language_po.lua
new file mode 100644
index 0000000..0f07d40
--- /dev/null
+++ b/plugins/language_po.lua
@@ -0,0 +1,20 @@
+-- mod-version:1 -- lite-xl 1.16
+local syntax = require "core.syntax"
+
+syntax.add {
+ files = { "%.po$", "%.pot$" },
+ comment = "#",
+ patterns = {
+ { pattern = { "#", "\n"}, type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = "[%[%]]", type = "operator" },
+ { pattern = "%d+", type = "number" },
+ { pattern = "[%a_][%w_]*", type = "symbol" },
+ },
+ symbols = {
+ ["msgctxt"] = "keyword",
+ ["msgid"] = "keyword",
+ ["msgid_plural"] = "keyword",
+ ["msgstr"] = "keyword",
+ },
+}