Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [1.0.0]

- Add global shortcuts `T()` and `L()` convenience methods
- Add built-in localization defaults for common languages

## [0.9.0]

- Move from Travis CI to GitHub Actions
Expand Down Expand Up @@ -50,6 +55,7 @@ All notable changes to this project will be documented in this file.

- First release :tada:

[1.0.0]: https://github.com/markets/mini_i18n/compare/v0.9.0...v1.0.0
[0.9.0]: https://github.com/markets/mini_i18n/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/markets/mini_i18n/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/markets/mini_i18n/compare/v0.6.0...v0.7.0
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2022 Marc Anguera Insa
Copyright (c) 2018-2025 Marc Anguera Insa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://github.com/markets/mini_i18n/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/markets/mini_i18n/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/9d82e7151f8a5594da0f/maintainability)](https://codeclimate.com/github/markets/mini_i18n/maintainability)

> Minimalistic I18n library for Ruby
> Minimalistic i18n library for Ruby

`MiniI18n` is a simple, flexible and fast Ruby Internationalization library. It supports localization, interpolations, pluralization, fallbacks, nested keys and more.

Expand Down Expand Up @@ -36,7 +36,7 @@ Or install it yourself as:

> gem install mini_i18n

## Usage
## Configuration

You should use the `configure` method to setup your environment:

Expand Down Expand Up @@ -72,7 +72,9 @@ MiniI18n.load_translations(__dir__ + '/translations/*')
MiniI18n.default_locale = :en
```

Examples usage:
## Usage

Examples:

```ruby
>> MiniI18n.t(:hello)
Expand All @@ -97,13 +99,13 @@ The `t()` method can be also used as `translate()`:
MiniI18n.translate(:hello)
```

Or even using the global shortcut `T()`:
Or you can even use the global shortcut `T()`:

```ruby
T(:hello)
```

It accepts the following options:
### Options

* `locale`

Expand Down Expand Up @@ -246,7 +248,7 @@ And then, you get:

### Localization

You can also use the `MiniI18n.l()` (or the long version `MiniI18n.localize()` or the global shorcut `L()`) method to localize your dates, time and numbers.
You can also use the `MiniI18n.l()` method (or the long version `MiniI18n.localize()` or the global shorcut `L()`) to localize your dates, time and numbers instances.

`MiniI18n` provides built-in localization defaults for common languages:
- `:en` - English
Expand Down Expand Up @@ -303,7 +305,7 @@ en:
=> "1.000 €"
```

**TIP** By using the `:as` option you can build custom full sentences with formatted numbers, like:
**TIP** 💡 By using the `:as` option you can build custom full sentences with formatted numbers, like:

```yaml
en:
Expand All @@ -330,4 +332,4 @@ To contribute, just fork the repo, hack on it and send a pull request. Don't for

## License

Copyright (c) Marc Anguera. MiniI18n is released under the [MIT](LICENSE) License.
Copyright (c) Marc Anguera. `MiniI18n` is released under the [MIT](LICENSE) License.
2 changes: 1 addition & 1 deletion lib/mini_i18n/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MiniI18n
VERSION = "0.9.0"
VERSION = "1.0.0"
end