route_translator 11.0.1 → 13.0.0
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/LICENSE +1 -1
- data/README.md +17 -0
- data/lib/route_translator/extensions/action_controller.rb +1 -1
- data/lib/route_translator/translator/path/segment.rb +3 -3
- 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 +12 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ed12e648ee1182125c8c2348fdecb75ac6e61b6f5dbb6a8d5ab2c41bfbf2992
|
|
4
|
+
data.tar.gz: 9ca7e205c7ce45931322ac69e388bc35a8a8ed4866277a512c8acfe10087e7b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f12fa98cbb77cb37837df68921bfda3be3a7672f1cdf60cdc3d0638e94030e1408645c9fc012d9aa00b7ef52ccdc9cc0ee5a10d116f3dcfa616b0d53acf09583
|
|
7
|
+
data.tar.gz: 80444879f58a98abbbb257699d2f9e2d072526276e02d25fda83df929eea5c16aeb203fcb5d25a85586ff76ab9818afc1da14b6822eeee3836f6c7112b868eab
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 13.0.0 / 2022-09-01
|
|
4
|
+
|
|
5
|
+
* [FEATURE] Replace Addressable gem with `URI::DEFAULT_PARSER` ([#268](https://github.com/enriclluelles/route_translator/pull/234))
|
|
6
|
+
* [FEATURE] Drop Ruby 2.5 support ([#270](https://github.com/enriclluelles/route_translator/pull/270))
|
|
7
|
+
* [ENHANCEMENT] Update development dependencies
|
|
8
|
+
|
|
9
|
+
## 12.1.0 / 2021-12-20
|
|
10
|
+
|
|
11
|
+
* [FEATURE] Add Rails 7.0 compatibility
|
|
12
|
+
* [ENHANCEMENT] Update development dependencies
|
|
13
|
+
|
|
14
|
+
## 12.0.0 / 2021-11-28
|
|
15
|
+
|
|
16
|
+
* [BUGFIX] Fix disable_fallback behavior ([#241](https://github.com/enriclluelles/route_translator/issues/241))
|
|
17
|
+
* [ENHANCEMENT] Update development dependencies
|
|
18
|
+
|
|
3
19
|
## 11.0.1 / 2021-11-15
|
|
4
20
|
|
|
5
21
|
* [ENHANCEMENT] Require MFA to publish gems
|
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], 2022 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
|
@@ -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
|
|
|
@@ -24,7 +24,7 @@ end
|
|
|
24
24
|
|
|
25
25
|
ActiveSupport.on_load(:action_controller) do
|
|
26
26
|
include RouteTranslator::Controller
|
|
27
|
-
if ENV
|
|
27
|
+
if ENV.fetch('RAILS_ENV', nil) == 'test'
|
|
28
28
|
require 'route_translator/extensions/test_case'
|
|
29
29
|
ActionController::TestCase.include RouteTranslator::TestCase
|
|
30
30
|
end
|
|
@@ -9,7 +9,7 @@ module RouteTranslator
|
|
|
9
9
|
|
|
10
10
|
def fallback_options(str, locale)
|
|
11
11
|
if RouteTranslator.config.disable_fallback && locale.to_s != I18n.default_locale.to_s
|
|
12
|
-
{ scope: :routes, fallback:
|
|
12
|
+
{ scope: :routes, fallback: false }
|
|
13
13
|
else
|
|
14
14
|
{ scope: :routes, default: str }
|
|
15
15
|
end
|
|
@@ -25,7 +25,7 @@ module RouteTranslator
|
|
|
25
25
|
opts = { locale: locale, scope: scope }
|
|
26
26
|
|
|
27
27
|
if I18n.t(str, **opts.merge(exception_handler: handler)).is_a?(I18n::MissingTranslation)
|
|
28
|
-
I18n.t str, **opts.merge(fallback_options(str, locale))
|
|
28
|
+
I18n.t! str, **opts.merge(fallback_options(str, locale))
|
|
29
29
|
else
|
|
30
30
|
I18n.t str, **opts
|
|
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.0.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-09-01 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: actionpack
|
|
@@ -21,7 +21,7 @@ dependencies:
|
|
|
21
21
|
version: '5.2'
|
|
22
22
|
- - "<"
|
|
23
23
|
- !ruby/object:Gem::Version
|
|
24
|
-
version: '7.
|
|
24
|
+
version: '7.1'
|
|
25
25
|
type: :runtime
|
|
26
26
|
prerelease: false
|
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -31,7 +31,7 @@ dependencies:
|
|
|
31
31
|
version: '5.2'
|
|
32
32
|
- - "<"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '7.
|
|
34
|
+
version: '7.1'
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: activesupport
|
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -41,7 +41,7 @@ dependencies:
|
|
|
41
41
|
version: '5.2'
|
|
42
42
|
- - "<"
|
|
43
43
|
- !ruby/object:Gem::Version
|
|
44
|
-
version: '7.
|
|
44
|
+
version: '7.1'
|
|
45
45
|
type: :runtime
|
|
46
46
|
prerelease: false
|
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -51,21 +51,7 @@ dependencies:
|
|
|
51
51
|
version: '5.2'
|
|
52
52
|
- - "<"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '7.
|
|
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'
|
|
54
|
+
version: '7.1'
|
|
69
55
|
- !ruby/object:Gem::Dependency
|
|
70
56
|
name: appraisal
|
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -106,14 +92,14 @@ dependencies:
|
|
|
106
92
|
requirements:
|
|
107
93
|
- - "~>"
|
|
108
94
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '5.
|
|
95
|
+
version: '5.15'
|
|
110
96
|
type: :development
|
|
111
97
|
prerelease: false
|
|
112
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
113
99
|
requirements:
|
|
114
100
|
- - "~>"
|
|
115
101
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '5.
|
|
102
|
+
version: '5.15'
|
|
117
103
|
- !ruby/object:Gem::Dependency
|
|
118
104
|
name: rails
|
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -123,7 +109,7 @@ dependencies:
|
|
|
123
109
|
version: '5.2'
|
|
124
110
|
- - "<"
|
|
125
111
|
- !ruby/object:Gem::Version
|
|
126
|
-
version: '7.
|
|
112
|
+
version: '7.1'
|
|
127
113
|
type: :development
|
|
128
114
|
prerelease: false
|
|
129
115
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -133,7 +119,7 @@ dependencies:
|
|
|
133
119
|
version: '5.2'
|
|
134
120
|
- - "<"
|
|
135
121
|
- !ruby/object:Gem::Version
|
|
136
|
-
version: '7.
|
|
122
|
+
version: '7.1'
|
|
137
123
|
- !ruby/object:Gem::Dependency
|
|
138
124
|
name: rake
|
|
139
125
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -223,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
223
209
|
requirements:
|
|
224
210
|
- - ">="
|
|
225
211
|
- !ruby/object:Gem::Version
|
|
226
|
-
version: '2.
|
|
212
|
+
version: '2.6'
|
|
227
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
214
|
requirements:
|
|
229
215
|
- - ">="
|
|
230
216
|
- !ruby/object:Gem::Version
|
|
231
217
|
version: '0'
|
|
232
218
|
requirements: []
|
|
233
|
-
rubygems_version: 3.
|
|
219
|
+
rubygems_version: 3.3.12
|
|
234
220
|
signing_key:
|
|
235
221
|
specification_version: 4
|
|
236
222
|
summary: Translate your Rails routes in a simple manner
|