You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
### 1.0.0 (Next)
2
2
3
+
*[#41](https://github.com/dblock/ruby-enum/pull/41): Make i18n dependency optional - [@peterfication](https://github.com/peterfication).
3
4
*[#43](https://github.com/dblock/ruby-enum/pull/43): Add exhaustive case matcher - [@peterfication](https://github.com/peterfication).
4
5
*[#40](https://github.com/dblock/ruby-enum/pull/39): Enable new Rubocop cops and address/allowlist lints - [@petergoldstein](https://github.com/petergoldstein).
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Enum-like behavior for Ruby, heavily inspired by [this](http://www.rubyfleebie.c
25
25
-[Duplicate enumerator keys or duplicate values](#duplicate-enumerator-keys-or-duplicate-values)
26
26
-[Inheritance](#inheritance)
27
27
-[Exhaustive case matcher](#exhaustive-case-matcher)
28
+
-[I18n support](#i18n-support)
28
29
-[Benchmarks](#benchmarks)
29
30
-[Contributing](#contributing)
30
31
-[Copyright and License](#copyright-and-license)
@@ -300,6 +301,15 @@ Color.Case(color, {
300
301
})
301
302
```
302
303
304
+
### I18n support
305
+
306
+
This gem has an optional dependency to `i18n`. If it's available, the error messages will have a nice description and can be translated. If it's not available, the errors will only contain the message keys.
307
+
308
+
```ruby
309
+
# Add this to your Gemfile if you want to have a nice error description instead of just a message key.
310
+
gem "i18n"
311
+
```
312
+
303
313
## Benchmarks
304
314
305
315
Benchmark scripts are defined in the [`benchmarks`](benchmarks) folder and can be run with Rake:
0 commit comments