Er2 Locale
Go to file
Er2 d4f5319e02 init 2021-11-22 21:05:55 +03:00
erl init 2021-11-22 21:05:55 +03:00
syntax init 2021-11-22 21:05:55 +03:00
tools init 2021-11-22 21:05:55 +03:00
license init 2021-11-22 21:05:55 +03:00
locale.lua init 2021-11-22 21:05:55 +03:00
readme.org init 2021-11-22 21:05:55 +03:00

readme.org

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

 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