route_translator 12.1.0 → 13.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/LICENSE +1 -1
- data/README.md +18 -1
- data/lib/route_translator/extensions/action_controller.rb +6 -6
- data/lib/route_translator/translator/path/segment.rb +1 -1
- data/lib/route_translator/translator/route_helpers.rb +1 -1
- data/lib/route_translator/version.rb +1 -1
- data/lib/route_translator.rb +0 -1
- metadata +14 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 773a40298cd3819de8d7801f3ae31b0dc5fcb4c3db65f809570adb1ae0a25e7e
|
4
|
+
data.tar.gz: 9176264924cade856a3c1e2e6b811bb744ca132f4382a377afb45aa4dd79061c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d20204dae597c1d97111bf3f75d2079dd027bd71f8c36918d65be770daed4c5eb695d7802977b0650d9bd394861e93b5293d512f6dbc29d3e766ad9619ce5145
|
7
|
+
data.tar.gz: 87155014e01709f6418964b4278b699b2009371e03c69eb6b75d0ac32f1d579a6f415f3437fb77b08b0044fb954aefcb02e03cfe2f387b703fe9a94d40f38729
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 13.1.0 / 2022-12-26
|
4
|
+
|
5
|
+
* [ENHANCEMENT] Test against Ruby 3.1 and Ruby 3.2
|
6
|
+
* [ENHANCEMENT] Better integration with ActionController::TestCase
|
7
|
+
|
8
|
+
## 13.0.0 / 2022-09-01
|
9
|
+
|
10
|
+
* [FEATURE] Replace Addressable gem with `URI::DEFAULT_PARSER` ([#268](https://github.com/enriclluelles/route_translator/pull/234))
|
11
|
+
* [FEATURE] Drop Ruby 2.5 support ([#270](https://github.com/enriclluelles/route_translator/pull/270))
|
12
|
+
* [ENHANCEMENT] Update development dependencies
|
13
|
+
|
3
14
|
## 12.1.0 / 2021-12-20
|
4
15
|
|
5
16
|
* [FEATURE] Add Rails 7.0 compatibility
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org], 2015 Enric Lluelles [http://enric.lluell.es],
|
3
|
+
Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org], 2015 Enric Lluelles [http://enric.lluell.es], 2023 Geremia Taglialatela
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -9,7 +9,7 @@ RouteTranslator is a gem to allow you to manage the translations of your app rou
|
|
9
9
|
|
10
10
|
It started as a fork of the awesome [translate_routes](https://github.com/raul/translate_routes) plugin by [Raúl Murciano](https://github.com/raul).
|
11
11
|
|
12
|
-
Right now it works with Rails 5.2 and
|
12
|
+
Right now it works with Rails 5.2, 6.x, and 7.x
|
13
13
|
|
14
14
|
|
15
15
|
|
@@ -354,6 +354,23 @@ people_products_favourites_es GET /people/products/fans(.:format) people/
|
|
354
354
|
products_favourites_es GET /products/favoritos(.:format) products#favourites {:locale=>"es"}
|
355
355
|
```
|
356
356
|
|
357
|
+
It is also possible to translated resources scoped into a namespace. Example:
|
358
|
+
|
359
|
+
```yml
|
360
|
+
es:
|
361
|
+
routes:
|
362
|
+
controllers:
|
363
|
+
people:
|
364
|
+
products:
|
365
|
+
products: productos_favoritos
|
366
|
+
```
|
367
|
+
|
368
|
+
Routes will be translated as in:
|
369
|
+
|
370
|
+
```
|
371
|
+
people_products_es GET /people/productos_favoritos(.:format) people/products#index {:locale=>"es"}
|
372
|
+
```
|
373
|
+
|
357
374
|
The gem will lookup translations under `controllers` scope first and then lookup translations under `routes` scope.
|
358
375
|
|
359
376
|
|
@@ -22,10 +22,10 @@ module RouteTranslator
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
ActiveSupport.on_load(:action_controller)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
ActiveSupport.on_load(:action_controller) { include RouteTranslator::Controller }
|
26
|
+
|
27
|
+
ActiveSupport.on_load(:action_controller_test_case) do
|
28
|
+
require 'route_translator/extensions/test_case'
|
29
|
+
|
30
|
+
include RouteTranslator::TestCase
|
31
31
|
end
|
@@ -34,7 +34,7 @@ module RouteTranslator
|
|
34
34
|
def translate_string(str, locale, scope)
|
35
35
|
translated_resource = translate_resource(str, locale.to_s, scope)
|
36
36
|
|
37
|
-
|
37
|
+
URI::DEFAULT_PARSER.escape translated_resource
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -35,7 +35,7 @@ module RouteTranslator
|
|
35
35
|
__send__(Translator.route_name_for(args, old_name, suffix, self), *args)
|
36
36
|
end
|
37
37
|
|
38
|
-
add_helpers_to_test_cases(helper_container) if ENV
|
38
|
+
add_helpers_to_test_cases(helper_container) if ENV.fetch('RAILS_ENV', nil) == 'test'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/route_translator.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: route_translator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 13.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geremia Taglialatela
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-12-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: actionpack
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '7.1'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: addressable
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '2.7'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '2.7'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: appraisal
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,36 +70,30 @@ dependencies:
|
|
84
70
|
name: byebug
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - "
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '10.0'
|
90
|
-
- - "<"
|
73
|
+
- - "~>"
|
91
74
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
75
|
+
version: '11.1'
|
93
76
|
type: :development
|
94
77
|
prerelease: false
|
95
78
|
version_requirements: !ruby/object:Gem::Requirement
|
96
79
|
requirements:
|
97
|
-
- - "
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: '10.0'
|
100
|
-
- - "<"
|
80
|
+
- - "~>"
|
101
81
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
82
|
+
version: '11.1'
|
103
83
|
- !ruby/object:Gem::Dependency
|
104
84
|
name: minitest
|
105
85
|
requirement: !ruby/object:Gem::Requirement
|
106
86
|
requirements:
|
107
87
|
- - "~>"
|
108
88
|
- !ruby/object:Gem::Version
|
109
|
-
version: '5.
|
89
|
+
version: '5.16'
|
110
90
|
type: :development
|
111
91
|
prerelease: false
|
112
92
|
version_requirements: !ruby/object:Gem::Requirement
|
113
93
|
requirements:
|
114
94
|
- - "~>"
|
115
95
|
- !ruby/object:Gem::Version
|
116
|
-
version: '5.
|
96
|
+
version: '5.16'
|
117
97
|
- !ruby/object:Gem::Dependency
|
118
98
|
name: rails
|
119
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,22 +132,16 @@ dependencies:
|
|
152
132
|
name: simplecov
|
153
133
|
requirement: !ruby/object:Gem::Requirement
|
154
134
|
requirements:
|
155
|
-
- - "
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
version: 0.18.5
|
158
|
-
- - "<"
|
135
|
+
- - "~>"
|
159
136
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
137
|
+
version: 0.22.0
|
161
138
|
type: :development
|
162
139
|
prerelease: false
|
163
140
|
version_requirements: !ruby/object:Gem::Requirement
|
164
141
|
requirements:
|
165
|
-
- - "
|
166
|
-
- !ruby/object:Gem::Version
|
167
|
-
version: 0.18.5
|
168
|
-
- - "<"
|
142
|
+
- - "~>"
|
169
143
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
144
|
+
version: 0.22.0
|
171
145
|
- !ruby/object:Gem::Dependency
|
172
146
|
name: simplecov-lcov
|
173
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -223,14 +197,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
197
|
requirements:
|
224
198
|
- - ">="
|
225
199
|
- !ruby/object:Gem::Version
|
226
|
-
version: '2.
|
200
|
+
version: '2.6'
|
227
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
202
|
requirements:
|
229
203
|
- - ">="
|
230
204
|
- !ruby/object:Gem::Version
|
231
205
|
version: '0'
|
232
206
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
207
|
+
rubygems_version: 3.2.33
|
234
208
|
signing_key:
|
235
209
|
specification_version: 4
|
236
210
|
summary: Translate your Rails routes in a simple manner
|