Skip to content

Latest commit

 

History

History
77 lines (52 loc) · 1.43 KB

README.md

File metadata and controls

77 lines (52 loc) · 1.43 KB

berry-intl: Berry bindings for GNU gettext

berry-intl is a Berry binding library for GNU gettext.

It runs on GNU/Linux and requires Berry (>=0.1.10)

Authored by: Díaz Devera Víctor Diex Gamar (Máster Vitronic)

Berry logo

License

GPL license . See LICENSE.

Documentation

See the Reference Manual.

Getting and installing

$ git clone https://gitlab.com/vitronic/berry-intl.git
$ cd berry-intl
berry-intl$ make
berry-intl$ make install # or 'sudo make install' (Ubuntu)

Example

#- Script: test.be

import intl; _  = intl.gettext


intl.setlocale("LC_ALL","");
intl.bindtextdomain("test", "./locales");
intl.textdomain("test");

print(_("Hello World"))
print(_("Good night"))
print(_("Amount"))
print(_("YES"))

The script can be executed at the shell prompt with the standard Berry interpreter:

$ LC_ALL=es_ES berry test.be
Hola Mondo
Buenas noches
Monto
SI
$ LC_ALL=fr_FR berry test.be
Bonjour le monde
Bonne nuit
Montant
OUI
$ LC_ALL=zh_CN berry test.be
你好,世界
晚上好
数额
是

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.