https://github.com/geopjr/gettext.cr
Crystal bindings for the GNU & Musl gettext library.
https://github.com/geopjr/gettext.cr
crystal gettext
Last synced: 7 months ago
JSON representation
Crystal bindings for the GNU & Musl gettext library.
- Host: GitHub
- URL: https://github.com/geopjr/gettext.cr
- Owner: GeopJr
- License: bsd-2-clause
- Created: 2022-02-12T00:02:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-12T00:20:48.000Z (over 3 years ago)
- Last Synced: 2025-03-19T04:05:06.859Z (7 months ago)
- Topics: crystal, gettext
- Language: Crystal
- Homepage: https://geopjr.github.io/gettext.cr/
- Size: 25.4 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
gettext.cr
Crystal bindings for the GNU & Musl gettext library.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
gettext:
github: GeopJr/gettext.cr
```2. Run `shards install`
## Usage
[Docs](https://geopjr.github.io/gettext.cr/) include examples, but here's a generic one:
```crystal
require "gettext"Gettext.setlocale(Gettext::LC::ALL, "el_GR.UTF-8")
Gettext.dgettext("gedit", "Text Editor") # => "Επεξεργαστής κειμένου"
Gettext.ngettext("Crystal", "Crystals", rand(5)) # => "Crystals" or "Crystal"
```## Contributing
1. Read the [Code of Conduct](https://github.com/GeopJr/gettext.cr/blob/main/CODE_OF_CONDUCT.md)
2. Fork it ()
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes (`git commit -am 'Add some feature'`)
5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request