Skip to content

MasterVitronic/berry-intl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Berry bindings for GNU gettext (mirror from gitlab)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published