olbat / icu.cr

A Cystal binding & wrapper to the ICU library
https://olbat.github.io/icu.cr/
GNU General Public License v3.0
11 stars 2 forks source link
crystal globalization icu internationalization

Crystal ICU

Crystal binding/wrapper to the ICU library

Installation

Debian/Ubuntu

apt-get install -y libicu-dev

macOS

brew install icu4c
brew link --force icu4c

Usage

Add this to your application's shard.yml:

dependencies:
  icu:
    github: olbat/icu.cr

Then require the lib in your Crystal code:

require "icu"

Wrapped components (WIP)

Internals

Development

ICU version compatibility

This binding is compatible with the ICU library starting from version 4.8. It has been generated using ICU version 57.1 so every additions in the API from this version will not be present in this binding.

The Crystal wrapper's (the ICU class) class and methods are enabled dynamically at compile-time depending on the version of the ICU library that's installed.

Please make sure that the class/feature you want to use is supported by your version ICU by checking the API documentation.

Regenerate the binding

To be sure that the LibICU binding fits with the version of the lib that's installed, it's possible to regenerate the binding by:

  1. Installing libgen and it's dependencies (cf. libgen's documentation)
  2. Run libgen and the lib_transformer program by running make generate_lib

Project's structure

About the binding's generation

For implementation and technical details about the binding's generation, see #1 & #3.

Contributing

  1. Fork it ( https://github.com/olbat/icu.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors