Er2 Locale
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Er2 d4f5319e02 init 2 years ago
erl init 2 years ago
syntax init 2 years ago
tools init 2 years ago
license init 2 years ago
locale.lua init 2 years ago
readme.org init 2 years ago

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