dragoman 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9176bc2a1292393a0ad653775c5f827fd0f33b59
4
- data.tar.gz: f9008090cb542228780baa0dc9b3b3e5fc2531ed
3
+ metadata.gz: 98d21fd0c11e6b04a5c566370a212cfb13069c21
4
+ data.tar.gz: 1a8fc051d3c4e267c2eda8258596db72ee9ca07e
5
5
  SHA512:
6
- metadata.gz: 3c0f0b8c7e3f1c96113a626bbd82f7bfeecb981ead880df5416d075d7040df349cc9d160f37d17dc56cdaeddbe95e9490e5d9c2ff78cfaf7485d82f7073c43cd
7
- data.tar.gz: a2fb03a087f317b468486ba140f54e29af9af9aec1dbb8d1911b781fc132aa1dbddfeec08092a2812a5529e88ae9802cd7495462154b06431a70db57eb516199
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
 
@@ -1,3 +1,3 @@
1
1
  module Dragoman
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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"]
@@ -36,6 +36,9 @@ Dummy::Application.routes.draw do
36
36
  # route with blank translation
37
37
  get 'music' => 'application#index'
38
38
 
39
+ # route without translation
40
+ get 'sounds' => 'application#index'
41
+
39
42
  end
40
43
 
41
44
  end
@@ -1,5 +1,6 @@
1
1
  en:
2
2
  routes:
3
+ sounds: 'glitches'
3
4
  nl:
4
5
  routes:
5
6
  admin: beheer
@@ -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.5
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-05 00:00:00.000000000 Z
12
+ date: 2015-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-rails