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
[Feature overview on YouTube](https://www.youtube.com/watch?v=_T9Kg05VvLI)
29
+
30
+

31
+
32
+
Check wiki for more: [Screenshots](https://github.com/prograils/lit/wiki/Screenshots)
28
33
29
34
### Installation
30
35
@@ -199,31 +204,32 @@ Also applies to upgrading from `0.4.pre.alpha` versions.
199
204
200
205
1. Add `Lit::FrontendHelper` to your `ApplicationController`
201
206
202
-
```ruby
203
-
helper Lit::FrontendHelper
204
-
```
207
+
```ruby
208
+
helper Lit::FrontendHelper
209
+
```
205
210
206
211
2. In you layout file include lit assets
207
212
208
-
```erb
209
-
<% if admin_user_signed_in? %>
210
-
<%= lit_frontend_assets %>
211
-
<% end %>
212
-
```
213
+
```erb
214
+
<% if admin_user_signed_in? %>
215
+
<%= lit_frontend_assets %>
216
+
<% end %>
217
+
```
213
218
214
219
3. You're good to go - now log in to lit (if required) and open your frontend in separate tab (to have session persisted). On the bottom-right of your page you should see "Enable / disable lit highlight" - after enabling it you'll be able to click and translate phrases directly in your frontend
215
220
216
221
4. Once enabled, all translations called via `t` helper function be rendered inside `<span />` tag, what may break your layout (ie if you're using translated values as button values or as placeholders, etc). To avoid that add `skip_lit: true` to `t()` call or use `I18n.t`.
217
222
218
223
5. This feature requires jQuery! (at least for now)
219
224
225
+
220
226
### Storing request info
221
227
222
-
1. Include `Lit::Concerns::RequestInfoStore` concern in your `ApplicationController`
228
+
1. Include `Lit::RequestInfoStore` concern in your `ApplicationController`
223
229
224
-
```ruby
225
-
include Lit::Concerns::RequestInfoStore
226
-
```
230
+
```ruby
231
+
includeLit::RequestInfoStore
232
+
```
227
233
228
234
2. In lit initializer (`lit.rb`) set `store_request_info` config to true
1. Add `Lit::FrontendHelper` in your `ApplicationController`
240
246
241
-
```ruby
242
-
include Lit::FrontendHelper
243
-
```
247
+
```ruby
248
+
helperLit::FrontendHelper
249
+
```
244
250
245
-
2. Include `Lit::Concerns::RequestKeysStore` concern in your `ApplicationController`
251
+
2. Include `Lit::RequestKeysStore` concern in your `ApplicationController`
246
252
247
-
```ruby
248
-
include Lit::Concerns::RequestKeysStore
249
-
```
253
+
```ruby
254
+
includeLit::RequestKeysStore
255
+
```
250
256
251
-
3.On the bottom of you layout file call `lit_translations_info` helper function
257
+
3.Enable storing of request keys in lit initializer `config/initializers/lit.rb`
252
258
253
-
```erb
254
-
<%= lit_translations_info %>
255
-
```
259
+
```ruby
260
+
Lit.store_request_keys =true
261
+
```
262
+
263
+
4. On the bottom of you layout file call `lit_translations_info` helper function
264
+
265
+
```erb
266
+
<%= lit_translations_info %>
267
+
```
256
268
257
-
4. From now on you'll be able to see all translation keys that were used to render current page. This feature works great with on-site live translations!
269
+
5. From now on you'll be able to see all translation keys that were used to render current page. This feature works great with on-site live translations!
258
270
259
-
5. Lit authorized user must be signed in for this feature to work! This feature requires jQuery!
271
+
6. Lit authorized user must be signed in for this feature to work! This feature requires jQuery!
0 commit comments