i18n-tasks 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +2 -4
- data/README.md +1 -1
- data/lib/i18n/tasks/data_traversal.rb +1 -1
- data/lib/i18n/tasks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35d4f7d34c81cc84e6123e4c63cb27bee56f7877
|
|
4
|
+
data.tar.gz: a2faf5f22e2caba3fab9e08707e1dd3a98c14fc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82f76ca5ab2e84949f760dfe043a449e19d7761e9d29391ed5269e665d79caf0e61d3908ce23a1e9336b34998af0d22a3a03fb6a6612c7fcad5407f61d0a3be5
|
|
7
|
+
data.tar.gz: d70a3d3db66c89d9d042039ebdf78322fb0cdf22bed4df99d56e7a0b6192cf7f6d82b2cb222cc76b4310b3d47b25ed03218aaac137d63562dff62059a4e05ff0
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
|
@@ -73,7 +73,7 @@ For more examples see [the tests](/spec/i18n_tasks_spec.rb).
|
|
|
73
73
|
Simply add to Gemfile:
|
|
74
74
|
|
|
75
75
|
```ruby
|
|
76
|
-
gem 'i18n-tasks', '~> 0.2.
|
|
76
|
+
gem 'i18n-tasks', '~> 0.2.7'
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
If you do not use Rails, you will also need to require the tasks in your Rakefile:
|
|
@@ -4,7 +4,7 @@ module I18n::Tasks::DataTraversal
|
|
|
4
4
|
def t(hash = data[base_locale], key)
|
|
5
5
|
if hash.is_a?(String)
|
|
6
6
|
# has is a locale
|
|
7
|
-
raise ArgumentError.new("invalid locale: #{hash}") if hash =~ /[^A-z-]/
|
|
7
|
+
raise ArgumentError.new("invalid locale: #{hash}") if hash =~ /[^A-z\d-]/
|
|
8
8
|
hash = data[hash]
|
|
9
9
|
end
|
|
10
10
|
key.split('.').inject(hash) { |r, seg| r[seg] if r }
|
data/lib/i18n/tasks/version.rb
CHANGED