route_translator 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/route_translator/translator.rb +2 -1
- data/lib/route_translator/version.rb +1 -1
- data/test/locales/routes.yml +3 -0
- data/test/routing_test.rb +10 -0
- metadata +63 -46
@@ -78,7 +78,8 @@ module RouteTranslator
|
|
78
78
|
|
79
79
|
def self.translate_string(str, locale)
|
80
80
|
fallback = I18n.translate(str, :locale => locale, :default => str)
|
81
|
-
I18n.translate("routes.#{str}", :locale => locale, :default => fallback)
|
81
|
+
res = I18n.translate("routes.#{str}", :locale => locale, :default => fallback)
|
82
|
+
URI.escape(res)
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
data/test/locales/routes.yml
CHANGED
data/test/routing_test.rb
CHANGED
@@ -49,6 +49,16 @@ class TranslateRoutesTest < ActionController::TestCase
|
|
49
49
|
assert_routing({:path => '/productos/1', :method => "PUT"}, {:controller => 'products', :action => 'update', :id => '1', :locale => 'es'})
|
50
50
|
end
|
51
51
|
|
52
|
+
def test_utf8_characters
|
53
|
+
draw_routes do
|
54
|
+
localized do
|
55
|
+
get 'people', :to => 'people#index'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
assert_routing URI.escape('/ru/люди'), :controller => 'people', :action => 'index', :locale => 'ru'
|
60
|
+
end
|
61
|
+
|
52
62
|
def test_resources_with_only
|
53
63
|
config_default_locale_settings 'es'
|
54
64
|
|
metadata
CHANGED
@@ -1,56 +1,63 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: route_translator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 3.0.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Raul Murciano
|
9
14
|
- Enric Lluelles
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
|
19
|
+
date: 2013-05-03 00:00:00 +02:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
16
23
|
name: minitest
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
|
-
requirements:
|
20
|
-
- - ~>
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 4.7.0
|
23
|
-
type: :development
|
24
24
|
prerelease: false
|
25
|
-
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
27
|
-
requirements:
|
27
|
+
requirements:
|
28
28
|
- - ~>
|
29
|
-
- !ruby/object:Gem::Version
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 35
|
31
|
+
segments:
|
32
|
+
- 4
|
33
|
+
- 7
|
34
|
+
- 0
|
30
35
|
version: 4.7.0
|
31
|
-
- !ruby/object:Gem::Dependency
|
32
|
-
name: sinatra
|
33
|
-
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
|
-
requirements:
|
36
|
-
- - ! '>='
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: '0'
|
39
36
|
type: :development
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: sinatra
|
40
40
|
prerelease: false
|
41
|
-
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
description: Translates the Rails routes of your application into the languages defined in your locale files
|
49
53
|
email: enric@lluell.es
|
50
54
|
executables: []
|
55
|
+
|
51
56
|
extensions: []
|
57
|
+
|
52
58
|
extra_rdoc_files: []
|
53
|
-
|
59
|
+
|
60
|
+
files:
|
54
61
|
- lib/route_translator.rb
|
55
62
|
- lib/route_translator/extensions.rb
|
56
63
|
- lib/route_translator/extensions/action_controller.rb
|
@@ -73,31 +80,41 @@ files:
|
|
73
80
|
- test/locales/routes.yml
|
74
81
|
- test/routing_test.rb
|
75
82
|
- test/test_helper.rb
|
83
|
+
has_rdoc: true
|
76
84
|
homepage: http://github.com/enriclluelles/route_translator
|
77
85
|
licenses: []
|
86
|
+
|
78
87
|
post_install_message:
|
79
88
|
rdoc_options: []
|
80
|
-
|
89
|
+
|
90
|
+
require_paths:
|
81
91
|
- lib
|
82
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
93
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
hash: 3
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
102
|
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
hash: 3
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
version: "0"
|
94
110
|
requirements: []
|
111
|
+
|
95
112
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.
|
113
|
+
rubygems_version: 1.6.2
|
97
114
|
signing_key:
|
98
115
|
specification_version: 3
|
99
116
|
summary: Translate your Rails routes in a simple manner
|
100
|
-
test_files:
|
117
|
+
test_files:
|
101
118
|
- test/dummy/app/controllers/dummy_controller.rb
|
102
119
|
- test/dummy/config.ru
|
103
120
|
- test/dummy/config/application.rb
|