dragoman 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dragoman/translation_visitor.rb +1 -1
- data/lib/dragoman/version.rb +1 -1
- data/spec/fake_app.rb +1 -0
- data/spec/fixtures/config/routes.rb +3 -0
- data/spec/fixtures/locales/routes.yml +1 -0
- data/spec/routing/routes_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98d21fd0c11e6b04a5c566370a212cfb13069c21
|
4
|
+
data.tar.gz: 1a8fc051d3c4e267c2eda8258596db72ee9ca07e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f325ed8abd2e5e93688feb77156d5dff9233bc4b3af8aa0fc03cd72eeeefa3c83eb21953ff5b46e8fb7e2ca1d12c20aa7f8bd10c5142d8a5d1d1f6b4fd889f48
|
7
|
+
data.tar.gz: 874f57c046af88f991ceece65f4375ce24d20a59cf4a5d023c99317db7f022b87e1f6cb71e4bf97c37ed2ec21530150458cdcf6f13e3be0beed868c3f8aab688
|
@@ -7,7 +7,7 @@ module Dragoman
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def visit_LITERAL node
|
10
|
-
translation = I18n.t node, scope: :routes, default: node.to_s, locale: @locale
|
10
|
+
translation = I18n.t node, scope: :routes, default: node.to_s, locale: @locale, fallback: true # NOTE: when fallback is true, fallbacks will NOT be used
|
11
11
|
translation.present? ? translation : node
|
12
12
|
end
|
13
13
|
|
data/lib/dragoman/version.rb
CHANGED
data/spec/fake_app.rb
CHANGED
@@ -13,6 +13,7 @@ module Dummy
|
|
13
13
|
config.paths["public"] = ["spec/fixtures/public"]
|
14
14
|
config.paths["config/locales"] = ["spec/fixtures/locales/routes.yml"]
|
15
15
|
config.eager_load = false
|
16
|
+
config.i18n.fallbacks = true
|
16
17
|
|
17
18
|
if Dummy.rails4?
|
18
19
|
config.paths["config/routes.rb"] = ["spec/fixtures/config/routes.rb"]
|
data/spec/routing/routes_spec.rb
CHANGED
@@ -73,6 +73,11 @@ describe 'routes' do
|
|
73
73
|
expect(music_nl_path).to eq '/music'
|
74
74
|
end
|
75
75
|
|
76
|
+
it 'uses the default path if no translation is present' do
|
77
|
+
expect(sounds_en_path).to eq '/glitches'
|
78
|
+
expect(sounds_nl_path).to eq '/sounds'
|
79
|
+
end
|
80
|
+
|
76
81
|
describe 'adds untranslated path helpers' do
|
77
82
|
it 'uses the I18n locale' do
|
78
83
|
I18n.locale = :nl
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragoman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pieter Visser
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-rails
|