项目作者: MasterVitronic

项目描述 :
Berry bindings for GNU gettext (mirror from gitlab)
高级语言: C
项目地址: git://github.com/MasterVitronic/berry-intl.git
创建时间: 2021-03-31T07:04:03Z
项目社区:https://github.com/MasterVitronic/berry-intl

开源协议:GNU General Public License v3.0

下载


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

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

Example

  1. #- Script: test.be
  2. import intl; _ = intl.gettext
  3. intl.setlocale("LC_ALL","");
  4. intl.bindtextdomain("test", "./locales");
  5. intl.textdomain("test");
  6. print(_("Hello World"))
  7. print(_("Good night"))
  8. print(_("Amount"))
  9. print(_("YES"))

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

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

Contributing

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