i18n_lazy_scope 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: 8dc1ed2523804d760805abfb82ed7479ffaea98a
4
- data.tar.gz: 3e1c861232b2cf3e7cc130eac814bf7c2e013071
3
+ metadata.gz: f5e67ec5de312b21a673e53902fff73d8c84e530
4
+ data.tar.gz: 1aff50f53d882e35d29f4ee010a103888a96d864
5
5
  SHA512:
6
- metadata.gz: 4ba9f541345de796626518e20843e8865a8a9e2ee303e3cd22d88bc2663a45acf82d3571dcaa182f6419182ae3c17daff7cffdc55c532b3fd753cb9d52787b72
7
- data.tar.gz: 0817f901549cc0913798adc9919b9bbe4bc80d4ed44043d1ca13aef1e861ff714d3d274b54657b0068a42b5adbfbd5e6737b36435329a2e651296fb359a41a82
6
+ metadata.gz: c4690adadb569a8b6934dc8ee65a447f286d1fe58fe5a4e5762b4c74e59eed64094a0c6d8690f22cdc1739a7a0b847870e86f75885abc545bc1612dd2812422a
7
+ data.tar.gz: 129fee9d22594e02023389a934e7e34417da4e260ce2f558a2a9841617054688ca1345570ccaca611cd6ed54d6445673ab437dd1d3de3283a333e123980cbfb0
data/README.md CHANGED
@@ -98,7 +98,7 @@ Or install it yourself as:
98
98
  Call the `t_scoped` method instead of `t`, or `translate`, and make sure you have the corresponding keys in your locale file. Say you are in `app/views/users/show.html.erb`.
99
99
 
100
100
  ```erb
101
- <%= t_scoped 'weclome' %>
101
+ <%= t_scoped 'greeting' %>
102
102
  ```
103
103
 
104
104
  ```yaml
@@ -109,12 +109,18 @@ en:
109
109
  greeting: "Hello!"
110
110
  ```
111
111
 
112
+ The library inserts a top level name in the scope for you. You will be able to customise this in future releases, but for now, the scopes default to:
113
+
114
+ 1. Conrollers: `locale.controllers.controller_name.action_name.key`
115
+ 2. Mailers: `locale.mailers.mailer_name.action_name.key`
116
+ 3. Views: `locale.views.template_or_partial_path.key`
117
+
112
118
  ### Interpolation
113
119
 
114
120
  It works exactly as it would if you call `t` or `translate`.
115
121
 
116
122
  ```erb
117
- <%= t_scoped 'weclome', name: @user.name %>
123
+ <%= t_scoped 'greeting', name: @user.name %>
118
124
  ```
119
125
 
120
126
  ```yaml
@@ -127,7 +133,9 @@ en:
127
133
 
128
134
  ### Scoping
129
135
 
130
- If you have to customise the scope on individual basis, then you should use `t` and `translate` that ship with the [I18n][3] gem. Scoping on individual basis defeates the point of this gem. This gem isn't meant to replace the I18n; it's a tiny wrapper that depends on it. But in future releases you will be able to customise top level namespaces, such as `views`, `controllers`, `mailers`, etc.
136
+ If you have to customise the scope on individual basis, then you should use `t` and `translate` that ship with Rails or the [I18n][3] gem. Scoping on individual basis defeates the point of this gem. This gem isn't meant to replace the I18n; it's a tiny wrapper that depends on it.
137
+
138
+ In future releases you will be able to customise top level namespaces, such as `views`, `controllers`, `mailers`, etc.
131
139
 
132
140
  ## API
133
141
 
@@ -1,3 +1,3 @@
1
1
  module I18nLazyScope
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_lazy_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohamad El-Husseini