i18nline 0.0.10.alpha → 0.0.11.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/locale.rb +25 -19
- data/lib/i18nline/version.rb +1 -1
- metadata +1 -3
- data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5790732964593f372d6c34db20d014cfb34c16dc
|
4
|
+
data.tar.gz: df31ffa45b8b042e4ff79ab7e960e486e2333331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3626d66099961ade71746ddb297f3d734f9276c51807d48b514657eafadd4fbacc8ecbdee475658b16a910855b902c39f7657f168c99644ff3b727edc3745f
|
7
|
+
data.tar.gz: 2f2b122954e45dd36f381a1fa0183943c3854905d2eff0970f2eb2c5e92ca1ab97f909130d6811ed61f33351c92a823c2f8c042c9f2a4ceb37a065ccedd6f711
|
@@ -7,32 +7,38 @@ module I18nline
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
# Some times part of the app is initialized but i18nline is not ready.
|
11
|
+
# This happens in 'rake assets:precompile', for instance.
|
12
|
+
begin
|
13
|
+
# This check is needed to make possible to install migrations with
|
14
|
+
# rake when there are other gems using I18n at setup before the
|
15
|
+
# table is created.
|
16
|
+
if ActiveRecord::Base.connection.table_exists? 'i18nline_translations'
|
17
|
+
module I18n
|
18
|
+
module Backend
|
19
|
+
class Chain
|
20
|
+
def available_locales
|
21
|
+
I18nline::enabled_locales
|
22
|
+
end
|
19
23
|
end
|
20
24
|
end
|
21
25
|
end
|
22
|
-
end
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
TRANSLATION_STORE = I18nline::MyBackend.new
|
28
|
+
I18n.backend = I18n::Backend::Chain.new(TRANSLATION_STORE, I18n::Backend::Simple.new)
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
module I18n
|
31
|
+
class JustRaiseExceptionHandler < ExceptionHandler
|
32
|
+
def call(exception, locale, key, options)
|
33
|
+
if exception.is_a?(MissingTranslation)
|
34
|
+
TRANSLATION_STORE.store_default_translations(locale, key, options)
|
35
|
+
end
|
36
|
+
super
|
32
37
|
end
|
33
|
-
super
|
34
38
|
end
|
35
39
|
end
|
40
|
+
I18n.exception_handler = I18n::JustRaiseExceptionHandler.new
|
36
41
|
end
|
37
|
-
|
42
|
+
rescue
|
43
|
+
puts "I18nline not initiatied at this point."
|
38
44
|
end
|
data/lib/i18nline/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18nline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rubén Díaz-Jorge Gil
|
@@ -206,7 +206,6 @@ files:
|
|
206
206
|
- test/dummy/tmp/cache/assets/development/sprockets/c5d518b12d9d712aa81c6c98a57ad3b5
|
207
207
|
- test/dummy/tmp/cache/assets/development/sprockets/90b42249c96ca020cc4d4e5d209e3662
|
208
208
|
- test/dummy/tmp/cache/assets/development/sprockets/1fed974ece9b46e9543a13bd2cfd39c6
|
209
|
-
- test/dummy/tmp/pids/server.pid
|
210
209
|
- test/dummy/bin/rake
|
211
210
|
- test/dummy/bin/bundle
|
212
211
|
- test/dummy/bin/rails
|
@@ -318,7 +317,6 @@ test_files:
|
|
318
317
|
- test/dummy/tmp/cache/assets/development/sprockets/c5d518b12d9d712aa81c6c98a57ad3b5
|
319
318
|
- test/dummy/tmp/cache/assets/development/sprockets/90b42249c96ca020cc4d4e5d209e3662
|
320
319
|
- test/dummy/tmp/cache/assets/development/sprockets/1fed974ece9b46e9543a13bd2cfd39c6
|
321
|
-
- test/dummy/tmp/pids/server.pid
|
322
320
|
- test/dummy/bin/rake
|
323
321
|
- test/dummy/bin/bundle
|
324
322
|
- test/dummy/bin/rails
|
@@ -1 +0,0 @@
|
|
1
|
-
12050
|