route_translator 14.2.0 → 15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 133d2558351805c54d4d96231a01b9b1c4e5137a42895e8c1d3b2eaff55d03c0
4
- data.tar.gz: 648a700ae5378e5e11b94034ae5f43808519cf9f931f52d49c14596cca3c6337
3
+ metadata.gz: 5a393716835c2c542d7f158782dcf1dcbaf163185bb4a1f85ff1be5507accbbf
4
+ data.tar.gz: 9ea86dcbebec6a9cea19b280da5a821cfccd6951e5d4c5b79ca43582053c8869
5
5
  SHA512:
6
- metadata.gz: a3675a5b82eb29c7436d881718fff7cb82452266a40f7c6d6053dd7f912bab544fd4773c2e8c7ce20bfbd76643d72c5be4ab037e3990ddb84ab4b2c4d20d8cb8
7
- data.tar.gz: 6cba258743408f08ad05e71d05693af3b29740675f093a047990df258904c539400229c7b74c1c5f4282b26a1eefde1cf4268f9b5b1515f3959ef1206467bd23
6
+ metadata.gz: b1fe1869d56070ea8de79618f8c6cd8fe5e6360b6be50637ac94ac9a13db13d6ce44f807a4745b4973cef5126049b1d7314d2c46401d7aa6af1d081cb63c9f84
7
+ data.tar.gz: d91df79e0dabed0f438757b364e467d85c1d1691c324e9098b5c1446805e6735a594e5d425d48345c47dcdb01f6438a30358a09a52195de93a46c425b5ccc944
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 15.0.0 / 2025-06-12
4
+
5
+ * [FEATURE] Drop Ruby < 3.1 support
6
+ * [BUGFIX] POTENTIAL BREAKING CHANGE: Route helper locale parameters now work without host_locales configuration ([#329](https://github.com/enriclluelles/route_translator/pull/329))
7
+
3
8
  ## 14.2.0 / 2024-11-08
4
9
 
5
10
  * [FEATURE] Rails 8.0 compatibility
data/README.md CHANGED
@@ -275,7 +275,7 @@ end
275
275
  | `generate_unlocalized_routes` | Add translated routes without deleting original unlocalized versions. **Note:** Autosets `force_locale` to `true` | `false` |
276
276
  | `generate_unnamed_unlocalized_routes` | Add the behavior of `force_locale`, but with a named default route which behaves as if `generate_unlocalized_routes` was `true`. `root_path` will redirect to `/en` or `/es`, depending on the value of `I18n.locale` | `false` |
277
277
  | `hide_locale` | Force the locale to be hidden on generated route paths | `false` |
278
- | `host_locales` | Set `I18n.locale` based on `request.host`. Useful for apps accepting requests from more than one domain. See below for more details | `{}` |
278
+ | `host_locales` | Set `I18n.locale` based on `request.host`. Useful for apps accepting requests from more than one domain. The key is a host pattern (supports wildcards for domains, subdomains, and TLDs), and the value is the locale symbol or string to use. See below for more details and examples. | `{}` |
279
279
  | `locale_param_key` | The param key used to set the locale to the newly generated routes | `:locale` |
280
280
  | `locale_segment_proc` | The locale segment of the url will by default be `locale.to_s.downcase`. You can supply your own mechanism via a Proc that takes `locale` as an argument, e.g. `->(locale) { locale.to_s.upcase }` | `false` |
281
281
 
@@ -31,7 +31,10 @@ RouteTranslator.config do |config|
31
31
  # config.hide_locale = false
32
32
 
33
33
  # Set `I18n.locale` based on `request.host`. Useful for apps accepting
34
- # requests from more than one domain. See Readme for more details
34
+ # requests from more than one domain. This option expects a hash where each
35
+ # key is a host pattern (as a String, supporting `*` wildcards for subdomains
36
+ # or TLDs), and each value is a locale (as a Symbol or String).
37
+ # See the README for more details.
35
38
  # config.host_locales = {}
36
39
 
37
40
  # The param key used to set the locale to the newly generated routes
@@ -10,8 +10,6 @@ module RouteTranslator
10
10
  private
11
11
 
12
12
  def locale_from_args(args)
13
- return if RouteTranslator.config.host_locales.blank?
14
-
15
13
  args_hash = args.find { |arg| arg.is_a?(Hash) }
16
14
  args_hash&.fetch(:locale, nil)
17
15
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RouteTranslator
4
- VERSION = '14.2.0'
4
+ VERSION = '15.0.0'
5
5
  end
@@ -10,7 +10,7 @@ require_relative 'route_translator/version'
10
10
  module RouteTranslator
11
11
  extend RouteTranslator::Host
12
12
 
13
- TRANSLATABLE_SEGMENT = /^([-_a-zA-Z0-9]+)(\()?/.freeze
13
+ TRANSLATABLE_SEGMENT = /^([-_a-zA-Z0-9]+)(\()?/
14
14
 
15
15
  DEFAULT_CONFIGURATION = {
16
16
  available_locales: [],
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: route_translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.2.0
4
+ version: 15.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geremia Taglialatela
8
8
  - Enric Lluelles
9
9
  - Raul Murciano
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-11-08 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: actionpack
@@ -75,7 +74,6 @@ metadata:
75
74
  bug_tracker_uri: https://github.com/enriclluelles/route_translator/issues
76
75
  changelog_uri: https://github.com/enriclluelles/route_translator/blob/master/CHANGELOG.md
77
76
  source_code_uri: https://github.com/enriclluelles/route_translator
78
- post_install_message:
79
77
  rdoc_options: []
80
78
  require_paths:
81
79
  - lib
@@ -83,15 +81,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
81
  requirements:
84
82
  - - ">="
85
83
  - !ruby/object:Gem::Version
86
- version: '2.7'
84
+ version: '3.1'
87
85
  required_rubygems_version: !ruby/object:Gem::Requirement
88
86
  requirements:
89
87
  - - ">="
90
88
  - !ruby/object:Gem::Version
91
89
  version: '0'
92
90
  requirements: []
93
- rubygems_version: 3.5.18
94
- signing_key:
91
+ rubygems_version: 3.6.7
95
92
  specification_version: 4
96
93
  summary: Translate your Rails routes in a simple manner
97
94
  test_files: []