r18n-core 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01fc9db07f902211f29b89542f1b6aacb393c85efa4ef48e0750b24b9dbbc94e
4
- data.tar.gz: cf6c8d62cb4d1447bfd9b0f34fb78dde6e35ebe7ed71e3e7fb94132bb0593278
3
+ metadata.gz: 489041ceb7db5e8cf6b743a024fb28208a2b8aa8bb259b33fc1b5c83af27adcc
4
+ data.tar.gz: 2a8bba59036684b3c5ea7e3c5794adc87d10fe67e9970ed6f43fe519a5c9eef7
5
5
  SHA512:
6
- metadata.gz: de9b44856131d6d52daa7348033a6af6285bfe740f0a064ba24540071a2798a0d025976458112e6465d2386e2bfa61f5a11e40038dee4fcb77778a6103923ce0
7
- data.tar.gz: 7be0bf1ccf786dd09132779852cc86bcc4d5b620ce5de7d78640a04c87e33737a0a0cb98fc5e2b85faaa2e603d5592328446d8960ef32404332109561446614e
6
+ metadata.gz: 6e307a9fac93250e9616ddac0b375ae23817dcc09179beb851bdc6e81c41bd5b14f55b1dc0705ff0bcc0d513197c967adf79f0727d72ee225504d6fedac0cdf3
7
+ data.tar.gz: 0bb8acf70cb671e5e43b31795c9e930e508223d0f3504d383c92e2dd33c3356f71461fe536e2586adc725acf5c7c8f7680ef94ee5181eb8ed72787bd577dc239
@@ -171,5 +171,11 @@ module R18n
171
171
  def dig(*keys)
172
172
  keys.reduce(self) { |result, key| result[key] }
173
173
  end
174
+
175
+ # I think we don't need in the Ruby core method,
176
+ # but it can be handy as a key
177
+ def itself
178
+ self[__method__]
179
+ end
174
180
  end
175
181
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version of R18n Core
4
4
  module R18n
5
- VERSION = '3.1.1'.freeze unless defined? R18n::VERSION
5
+ VERSION = '3.1.2'.freeze unless defined? R18n::VERSION
6
6
  end
@@ -161,4 +161,11 @@ describe R18n::Translation do
161
161
  it { is_expected.not_to be_translated }
162
162
  end
163
163
  end
164
+
165
+ context '`itself` key' do
166
+ subject { R18n::I18n.new('en', DIR).page.itself.not_found }
167
+
168
+ it { is_expected.to be_translated }
169
+ it { is_expected.to eq 'Not found' }
170
+ end
164
171
  end
@@ -45,3 +45,8 @@ echo2: Value2 is {{value}}
45
45
  boolean:
46
46
  true: Boolean is true
47
47
  false: Boolean is false
48
+
49
+ page:
50
+ header: Title
51
+ itself:
52
+ not_found: Not found
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-20 00:00:00.000000000 Z
11
+ date: 2018-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |2
14
14
  R18n is a i18n tool to translate your Ruby application.