37 lines
1021 B
Org Mode
37 lines
1021 B
Org Mode
|
* Er2 Locale
|
||
|
|
||
|
Originally it was a part of ErTK (under development),
|
||
|
but I decide to open source to other repository.
|
||
|
|
||
|
Currently there is only Lua implementation,
|
||
|
but you can port to other language.
|
||
|
|
||
|
* Syntax
|
||
|
|
||
|
Localization files is using it's own format (see ~syntax/example.els~).
|
||
|
Also you can see at the ~erl~ directory.
|
||
|
|
||
|
** Editor support
|
||
|
|
||
|
Syntax highlighting available only in ~micro~ editor
|
||
|
(~syntax~ directory)
|
||
|
|
||
|
* Tools
|
||
|
|
||
|
Except runtime we have 2 tools:
|
||
|
|
||
|
- ~compile.lua~ - Compiles els to one (prog. language specific!) file
|
||
|
|
||
|
- ~po2els.lua~ - If you want to migrate from gettext
|
||
|
or if translation program/service cannot export to els yet
|
||
|
|
||
|
* Example
|
||
|
|
||
|
#+begin_src lua
|
||
|
require('locale') 'erl' -- init and load erl folder
|
||
|
_.locale = 'ru' -- set locale will be used, maybe create $LANG detect
|
||
|
_("My string") -- basic usage
|
||
|
_ "My string" -- without (), lua feature
|
||
|
_("My string", {plural = 1}) -- print plural form, maybe create other function for this
|
||
|
#+end_src
|