i18n

Version, currently master branch1 version
  • master branchlatestOct 29, 2016

github.com/whity/crystal-i18n

No description declared in shard.yml.

7 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  i18n:
    github: whity/crystal-i18n
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
André Brás <andregoncalo.bras@gmail.com>

Dependencies

Runtime Dependencies

  • config*github: whity/crystal-config, branch: master

README

# i18n

## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
  i18n:
    github: whity/crystal-i18n
```

## Usage


```crystal
require "i18n/backend/yaml"

# create a i18n object
i18n = I18n.from_yaml_files("[folder where the locale files are located]")

# simple translation
i18n.translate("hello")

# pluralization
i18n.translate("new_message", count: 2)

# number format
i18n.number(123.to_s)

# currency format
i18n.currency(12345.to_s)

# time format
i18n.time(Time.now)

# date format
i18n.date(Time.now, format: "long")
```

## Contributing

1. Fork it ( https://github.com/[your-github-name]/i18n/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

- whity(https://github.com/whity) André Brás - creator, maintainer