flame-r18n 2.3.1 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f7b0223f3e2c36030c264cc491def07e23c87799
4
- data.tar.gz: 3d8fdc16f0e55ef2028d59f34646f42fa8d39519
2
+ SHA256:
3
+ metadata.gz: 5a5f6fc1c0c0f1f730300be1408affef95fec1566ffd6a32924814612f1f7f67
4
+ data.tar.gz: a4f30a3d514ba7470a40772502b6fe6585ef0c4caac61e555d2479bf53867da0
5
5
  SHA512:
6
- metadata.gz: d20a69c75064726642204b896aa71222b8f9529d1898b3d82e9e8ecdc1dbf4132c2011d9f81507922e0a7c8cdff02baea111229e6d059cbf1c998cd151cd1470
7
- data.tar.gz: dececf076eaff24214df9788b3e05fd3dc2d9e7c4e827b3ea8f6858a56e4f6e031b9bdf49fde3a66d55b0c79bf68871bd80c26ad00e67d8c7bc6ebaa9dea31a6
6
+ metadata.gz: bc0cb8373fc77e73b38bf13644b6f9ac6811872f52dfb3f1e4a287a99d2aaba3d363b86093f7cae8473544bb64a219b82222e54ca2ff855b49fb09a4948dca55
7
+ data.tar.gz: e98841a62976c6763fa43e465b8a4fb7359cf5fc31bc675d1aaa2f10098eb7fae49e247ba0029305f3fe12ba02bed6df33989853dfae29749fcf28acc2792c92
data/CHANGELOG.md ADDED
@@ -0,0 +1,90 @@
1
+ # Changelog
2
+
3
+ ## master (unreleased)
4
+
5
+ ## 3.0.0.rc1 (2021-04-16)
6
+
7
+ * Add tests, fix some errors.
8
+ 100% coverage, yay!
9
+ * Update version of Flame dependency to `~> 5.0`.
10
+ * Set locale with region by locale without.
11
+ From `Accept-Language` HTTP header.
12
+ * Remove extra slashes in a root path with query string when redirecting (`LocaleInPath`).
13
+ * Replace `LocaleInPath#path_witout_locale` with `#fullpath_without_locale`.
14
+ * Take out `path_with_preferred_locale` from `redirect_to_path_with_preferred_locale`.
15
+ * Update R18n dependency.
16
+ * Update development dependencies, lock them better.
17
+ * Add Travis CI, then switch to Cirrus CI.
18
+ * Add `rubocop-performance` and `rubocop-rspec`.
19
+ Resolve new offenses.
20
+ * Support Ruby 3.
21
+ * Move gem version to a separate file.
22
+ * Add RuboCop task for CI.
23
+ * Add `remark` task for CI.
24
+ * Replace `rake` with `toys`.
25
+ * Add code documentation.
26
+ * Add more meta-information to gem specs.
27
+ * Add badges to README.
28
+ * Add "Development", "Contributing" and "License" sections to README.
29
+
30
+ ## 2.3.1 (2017-10-13)
31
+
32
+ * Fix the critical issue with caching 301 Location by browsers.
33
+
34
+ ## 2.3.0.1 (2017-10-13)
35
+
36
+ * Fix the critical issue with caching 301 Location by browsers.
37
+
38
+ ## 2.3.0 (2017-08-23)
39
+
40
+ * Add redefined `LocaleInPath#path_to` method.
41
+
42
+ ## 2.2.1 (2017-08-10)
43
+
44
+ * Fix an error with `LocaleInPath` module.
45
+
46
+ ## 2.2.0 (2017-08-09)
47
+
48
+ * Add `Flame::R18n::LocaleInPath` module for general methods in such case.
49
+
50
+ ## 2.1.1 (2017-08-08)
51
+
52
+ * Fix calling root `::R18n` constant.
53
+
54
+ ## 2.1.0 (2017-08-08)
55
+
56
+ * Don't use locale param if it is not in available locales.
57
+
58
+ ## 2.0.0 (2017-05-17)
59
+
60
+ * Split `Flame::R18n` to `Configuration` and `Initialization`.
61
+ Change `prepend` to `include`s for application and controller.
62
+ * Fix gem building.
63
+ * Add RuboCop config.
64
+
65
+ ## 1.3.0 (2016-11-11)
66
+
67
+ * Initialize `R18n` already with `preferred_locale` instead of setting it later to `session`.
68
+
69
+ ## 1.2.0 (2016-11-08)
70
+
71
+ * Add possibility of redefining `preferred_locale`.
72
+
73
+ ## 1.1.1 (2016-09-28)
74
+
75
+ * Fix an error with non-word chars in `preferred_locale`.
76
+
77
+ ## 1.1.0 (2016-05-20)
78
+
79
+ * Set default locale to `session[:locale]` when no preferred.
80
+ Change `include` to `prepend`.
81
+ * Prevent `preferred_locale` duplicates in `locales`.
82
+ * Fix issue when `locales_from_env` returns `nil`.
83
+ * Add README file.
84
+ * Add LICENSE file.
85
+ * Fix gem specs file name.
86
+ * Change homepage in gem specs from GitLab to GitHub.
87
+
88
+ ## 1.0.0 (2016-01-29)
89
+
90
+ * Initial release.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Alexander Popov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # Flame R18n
2
+
3
+ Flame plugin which provides
4
+ [i18n and L10n](https://en.wikipedia.org/wiki/Internationalization_and_localization) support
5
+ to your web application.
6
+
7
+ It is a wrapper for [R18n core library](https://github.com/r18n/r18n-core).
8
+ See [R18n documentation](https://github.com/r18n/r18n-core/blob/master/README.md)
9
+ for more information.
10
+
11
+ [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/flame-r18n?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/flame-r18n)
12
+ [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/flame-r18n/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/flame-r18n)
13
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/flame-r18n.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/flame-r18n)
14
+ ![Depfu](https://img.shields.io/depfu/AlexWayfer/flame-r18n?style=flat-square)
15
+ [![Inline docs](https://inch-ci.org/github/AlexWayfer/flame-r18n.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/flame-r18n)
16
+ [![license](https://img.shields.io/github/license/AlexWayfer/flame-r18n.svg?style=flat-square)](https://github.com/AlexWayfer/flame-r18n/blob/master/LICENSE.txt)
17
+ [![Gem](https://img.shields.io/gem/v/flame-r18n.svg?style=flat-square)](https://rubygems.org/gems/flame-r18n)
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ # Gemfile
23
+ gem 'flame-r18n'
24
+
25
+ # config.ru
26
+ require 'flame-r18n' # or `Bundler.require`
27
+
28
+ # For application configuration
29
+ # config/processors/r18n.rb
30
+ ::R18n.default_places = File.join config[:root_dir], 'locales'
31
+ ::R18n::I18n.default = 'en'
32
+
33
+ # _controller.rb
34
+ include Flame::R18n::Initialization # for loading thread-based locale
35
+
36
+ # site/_controller.rb
37
+ prepend Flame::R18n::LocaleInPath # for mounting controllers at `/:locale`
38
+ ```
39
+
40
+ ## Development
41
+
42
+ After checking out the repo, run `bundle install` to install dependencies.
43
+
44
+ Then, run `toys rspec` to run the tests.
45
+
46
+ To install this gem onto your local machine, run `toys gem install`.
47
+
48
+ To release a new version, run `toys gem release %version%`.
49
+ See how it works [here](https://github.com/AlexWayfer/gem_toys#release).
50
+
51
+ ## Contributing
52
+
53
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/flame-r18n).
54
+
55
+ ## License
56
+
57
+ The gem is available as open source under the terms of the
58
+ [MIT License](https://opensource.org/licenses/MIT).
data/lib/flame/r18n.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'r18n-core'
4
4
 
5
- require_relative './r18n/configuration'
5
+ require_relative './r18n/version'
6
+
6
7
  require_relative './r18n/initialization'
7
8
  require_relative './r18n/locale_in_path'
@@ -1,28 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'r18n-core'
4
-
5
3
  module Flame
6
4
  module R18n
7
5
  ## Module for R18n in thread initialization with helper methods
8
6
  module Initialization
9
7
  include ::R18n::Helpers
10
8
 
9
+ ## Patch controller initialization
10
+ ## Load R18n and set the current locale to the session
11
11
  def initialize(*)
12
12
  super
13
13
  load_r18n
14
14
  session[:locale] = r18n.locale.code
15
15
  end
16
16
 
17
- def init_r18n(locale)
18
- ::R18n::I18n.new(
19
- Array(locale) | locales_from_env,
20
- ::R18n.default_places,
21
- off_filters: :untranslated,
22
- on_filters: :untranslated_html
23
- )
24
- end
25
-
17
+ ## Force change thread locale
18
+ ## @param locale [R18n::Locale] the locale that will be set
26
19
  def thread_locale=(locale)
27
20
  ::R18n.thread_set init_r18n locale
28
21
  end
@@ -48,12 +41,16 @@ module Flame
48
41
  def load_r18n
49
42
  ::R18n.clear_cache! if config[:environment] == 'development'
50
43
 
51
- ::R18n.thread_set do
52
- default_locale = config[:default_locale]
53
- ::R18n::I18n.default = default_locale if default_locale
44
+ self.thread_locale = preferred_locale
45
+ end
54
46
 
55
- init_r18n preferred_locale
56
- end
47
+ def init_r18n(locale)
48
+ ::R18n::I18n.new(
49
+ Array(locale) | locales_from_env,
50
+ ::R18n.default_places,
51
+ off_filters: :untranslated,
52
+ on_filters: :untranslated_html
53
+ )
57
54
  end
58
55
  end
59
56
  end
@@ -4,19 +4,23 @@ module Flame
4
4
  module R18n
5
5
  ## Module for including to controllers, mounted with `:locale` param in path
6
6
  module LocaleInPath
7
- include Flame::R18n::Initialization
8
-
9
7
  protected
10
8
 
11
- def execute(method)
9
+ ## Patch controller execution
10
+ ## Halt with redirect to the same URL, but with the preferred locale,
11
+ ## if necessary
12
+ ## @param action [Symbol] action which will be executed
13
+ def execute(action)
12
14
  unless request_path_with_available_locale?
13
- return redirect_with_preferred_locale_in_path
15
+ return halt redirect_to_path_with_preferred_locale
14
16
  end
17
+
15
18
  super
16
19
  end
17
20
 
18
21
  private
19
22
 
23
+ ## Complete returning path with locale, if necessary
20
24
  def path_to(*args)
21
25
  args << {} unless args.last.is_a? Hash
22
26
  args.last[:locale] = r18n.locale.code unless args.last.include?(:locale)
@@ -27,21 +31,27 @@ module Flame
27
31
  available_locale_codes.include?(request.path.parts.first.to_s)
28
32
  end
29
33
 
30
- def redirect_with_preferred_locale_in_path
31
- path_with_locale = Flame::Path.merge(
32
- nil, r18n.locale.code, request.fullpath
33
- )
34
- path_with_locale.sub!(%r{(\/)+$}, '')
35
- redirect path_with_locale, 302
34
+ def redirect_to_path_with_preferred_locale
35
+ redirect path_with_preferred_locale.sub(%r{(/)+(?=\?|$)}, ''), 302
36
36
  end
37
37
 
38
- def path_without_locale
39
- return request.path.to_s unless request_path_with_available_locale?
38
+ def path_with_preferred_locale
39
+ Flame::Path.merge(nil, r18n.locale.code, request.fullpath)
40
+ end
41
+
42
+ ## Get the current path without the preferred locale in it
43
+ ## @return [Flame::Path] the current path without locale in it
44
+ def fullpath_without_locale
45
+ return request.fullpath.to_s unless request_path_with_available_locale?
46
+
40
47
  Flame::Path.merge(
41
- request.path.parts[1..-1].unshift('/')
48
+ request.fullpath.to_s.split('/')[2..-1].unshift('/')
42
49
  )
43
50
  end
44
51
 
52
+ ## Get the current path with the specific locale in it
53
+ ## @param locale [R18n::Locale] the locale that will be in the path
54
+ ## @return [Flame::Path] the current path with the specific locale in it
45
55
  def fullpath_with_specific_locale(locale)
46
56
  fullpath_parts = request.fullpath.to_s.split('/')
47
57
  fullpath_parts[1] = locale.code
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flame
4
+ module R18n
5
+ VERSION = '3.0.0.rc1'
6
+ end
7
+ end
metadata CHANGED
@@ -1,50 +1,205 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame-r18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-13 00:00:00.000000000 Z
11
+ date: 2021-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flame
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '4.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 4.0.0
19
+ version: 5.0.0.rc3
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '4.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
- version: 4.0.0
29
+ version: 5.0.0.rc3
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: r18n-core
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '2'
39
+ version: '5.0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '2'
47
- description: Flame extension which provides i18n support to translate your web application.
46
+ version: '5.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: pry-byebug
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.9'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.9'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bundler
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '2.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: gem_toys
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 0.8.0
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 0.8.0
89
+ - !ruby/object:Gem::Dependency
90
+ name: toys
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 0.11.0
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 0.11.0
103
+ - !ruby/object:Gem::Dependency
104
+ name: codecov
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.5.1
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.5.1
117
+ - !ruby/object:Gem::Dependency
118
+ name: rack-test
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1.0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1.0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rspec
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '3.9'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '3.9'
145
+ - !ruby/object:Gem::Dependency
146
+ name: simplecov
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: 0.21.2
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: 0.21.2
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '1.3'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '1.3'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rubocop-performance
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '1.0'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '1.0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: rubocop-rspec
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - "~>"
192
+ - !ruby/object:Gem::Version
193
+ version: '2.0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '2.0'
201
+ description: |
202
+ Flame plugin which provides i18n and L10n support to your web application.
48
203
  It is a wrapper for R18n core library. See R18n documentation for more information.
49
204
  email:
50
205
  - alex.wayfer@gmail.com
@@ -52,15 +207,21 @@ executables: []
52
207
  extensions: []
53
208
  extra_rdoc_files: []
54
209
  files:
210
+ - CHANGELOG.md
211
+ - LICENSE.txt
212
+ - README.md
55
213
  - lib/flame/r18n.rb
56
- - lib/flame/r18n/configuration.rb
57
214
  - lib/flame/r18n/initialization.rb
58
215
  - lib/flame/r18n/locale_in_path.rb
216
+ - lib/flame/r18n/version.rb
59
217
  homepage: https://github.com/AlexWayfer/flame-r18n
60
218
  licenses:
61
219
  - MIT
62
- metadata: {}
63
- post_install_message:
220
+ metadata:
221
+ source_code_uri: https://github.com/AlexWayfer/flame-r18n
222
+ homepage_uri: https://github.com/AlexWayfer/flame-r18n
223
+ changelog_uri: https://github.com/AlexWayfer/flame-r18n/blob/master/CHANGELOG.md
224
+ post_install_message:
64
225
  rdoc_options: []
65
226
  require_paths:
66
227
  - lib
@@ -68,16 +229,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
229
  requirements:
69
230
  - - ">="
70
231
  - !ruby/object:Gem::Version
71
- version: '0'
232
+ version: '2.5'
72
233
  required_rubygems_version: !ruby/object:Gem::Requirement
73
234
  requirements:
74
- - - ">="
235
+ - - ">"
75
236
  - !ruby/object:Gem::Version
76
- version: '0'
237
+ version: 1.3.1
77
238
  requirements: []
78
- rubyforge_project:
79
- rubygems_version: 2.6.13
80
- signing_key:
239
+ rubygems_version: 3.2.15
240
+ signing_key:
81
241
  specification_version: 4
82
- summary: R18n plugin for Flame-framework
242
+ summary: Flame plugin which provides i18n and L10n support
83
243
  test_files: []
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Flame
4
- module R18n
5
- ## Module for adding Flame::R18n properties into application configuration
6
- module Configuration
7
- def self.included(app)
8
- app.config[:default_locale] = proc { ::R18n::I18n.default }
9
- app.config[:locales] = proc { ::R18n.default_places }
10
- app.config[:locales_dir] = proc do
11
- File.join(app.config[:root_dir], 'locales')
12
- end
13
-
14
- ::R18n.default_places { app.config[:locales_dir] }
15
- end
16
- end
17
- end
18
- end