This commit is contained in:
Er2 2021-11-22 21:05:55 +03:00
commit d4f5319e02
10 changed files with 293 additions and 0 deletions

13
syntax/els.yaml Normal file
View file

@ -0,0 +1,13 @@
filetype: els
detect:
filename: "\\.els$"
header: "Er2 Locale"
rules:
- comment: ".+" # Comment by default
- constant.string: "\"([^\"]+)\"$" # Non-critical bug
- todo: "(TODO|XXX|FIXME|TRANSLATORS):.+$"
- statement: "^[[:space:]]*[=>]"
- identifier: "[^\\\\]\\$([A-Za-z0-9)]+)"
- special: "\\\\.?"

20
syntax/example.els Normal file
View file

@ -0,0 +1,20 @@
Er2 Locale source
Let's create a new string
"Just string"
Currently it haven't got translation
but we can fix it
= "No, it's localized string"
Spaces is optional
Also we can replace this translation
= "Power string!"
This is basic, how about plural forms?
> "Power strings!"
Spaces is also optional
Oh, I forgot! We can use interpolation
> "\$escaped $plural not escaped variable"
To use it, type _("string", {key = value})
Now you know this localization format!