Next: , Previous: , Up: Individual Programming Languages   [Contents][Index]


15.5.15 Lua

RPMs

lua

Ubuntu packages

lua, lua-gettext
You need to install the lua-gettext package from https://gitlab.com/sukhichev/lua-gettext/blob/master/README.us.md. Debian and Ubuntu packages of it are available. Download the appropriate one, and install it through ‘sudo dpkg -i lua-gettext_0.0_amd64.deb’.

File extension

lua

String syntax
  • "abc"
  • 'abc'
  • [[abc]]
  • [=[abc]=]
  • [==[abc]==]
  • ...
gettext shorthand

_("abc")

gettext/ngettext functions

gettext.gettext, gettext.dgettext, gettext.dcgettext, gettext.ngettext, gettext.dngettext, gettext.dcngettext

textdomain

textdomain function

bindtextdomain

bindtextdomain function

setlocale

automatic

Prerequisite

require 'gettext' or running lua interpreter with -l gettext option

Use or emulate GNU gettext

use

Extractor

xgettext

Formatting with positions

Portability

On platforms without gettext, the functions are not available.

po-mode marking