gettext_i18n_rails 1.8.1 → 1.9.0

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
2
  SHA256:
3
- metadata.gz: 03205ca066f3c898e4da0ec0a8262e4fd0127498b5c975c0b5b2935062d146f5
4
- data.tar.gz: c1d50f46d8a6e4805d3ddec69c4a1965fdafdc5b06ecea0534c2cb1e7cec4b45
3
+ metadata.gz: 3259e666c1481870b3fc42ef15f9122f550dacb20676dc94ed6f2626a85d881f
4
+ data.tar.gz: f9c946d849eefe7fb3bc282e82075e05c1e1343f3bea58b57466a77c0a95dfe3
5
5
  SHA512:
6
- metadata.gz: 660ee38d092d0538f4ced161e32c0976edbf58c2ce5a4230b32729787103728f18ba6e5435ef185314ff4696762c929c1578c2c240a5ce5ca35fe79d259ba824
7
- data.tar.gz: 7fa2d67dbe95ab585c01dd3f8c988f20a23f3d46cfadc99da0b04acd41d87deb5d932a859a7d7dda6f90d137df661c704458d5091db0e2d084a389b39eba47db
6
+ metadata.gz: 8cf6c57bfb859e54b78ee70b4dc19429b49d9d5eb328ccc4b281f1217b81626daa61a68fefd48fee422305678eeab649a3f936d2e5b25d7d3dc4d1d182cf3ff5
7
+ data.tar.gz: c7e08204399174c13dec49e3d10389eb1a2316e1aa2e3cfad9e40b5eaf6bf40aebfc7230fef67dcdb831e443c25960065e0fd970962f68775e2b54efeae2a8ba
@@ -7,7 +7,7 @@ module ActiveModel
7
7
 
8
8
  def gettext_translation_for_attribute_name(attribute)
9
9
  attribute = attribute.to_s
10
- if attribute.ends_with?('_id')
10
+ if attribute.end_with?('_id')
11
11
  humanize_class_name(attribute)
12
12
  else
13
13
  "#{inheritance_tree_root(self)}|#{attribute.split('.').map! {|a| a.humanize }.join('|')}"
@@ -16,6 +16,7 @@ module GettextI18nRails
16
16
  end
17
17
 
18
18
  def translate(locale, key, options)
19
+ current_locale = FastGettext.set_locale locale
19
20
  if gettext_key = gettext_key(key, options)
20
21
  translation =
21
22
  plural_translate(gettext_key, options) || FastGettext._(gettext_key)
@@ -24,6 +25,8 @@ module GettextI18nRails
24
25
  result = backend.translate(locale, key, options)
25
26
  (RUBY19 and result.is_a?(String)) ? result.force_encoding("UTF-8") : result
26
27
  end
28
+ ensure
29
+ FastGettext.set_locale current_locale
27
30
  end
28
31
 
29
32
  def method_missing(method, *args)
@@ -9,7 +9,11 @@ module GettextI18nRails
9
9
  def self.convert_to_code(text)
10
10
  case @library_loaded
11
11
  when "haml"
12
- Haml::Engine.new(text).precompiled()
12
+ if Haml::VERSION.split('.').first.to_i <= 5
13
+ Haml::Engine.new(text).precompiled()
14
+ else
15
+ Haml::Engine.new.call(text)
16
+ end
13
17
  when "hamlit"
14
18
  Hamlit::Engine.new.call(text)
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '1.8.1'
2
+ Version = VERSION = '1.9.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-10 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_gettext
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: hamlit
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rails
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,35 +95,35 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: ruby_parser
98
+ name: rails
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 3.7.1
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 3.7.1
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: sexp_processor
112
+ name: ruby_parser
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: 3.7.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: 3.7.1
125
125
  - !ruby/object:Gem::Dependency
126
- name: rspec
126
+ name: sexp_processor
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: slim
140
+ name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: sqlite3
154
+ name: slim
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -165,7 +165,7 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: wwtd
168
+ name: sqlite3
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
@@ -178,7 +178,7 @@ dependencies:
178
178
  - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
- description:
181
+ description:
182
182
  email: michael@grosser.it
183
183
  executables: []
184
184
  extensions: []
@@ -209,7 +209,7 @@ homepage: http://github.com/grosser/gettext_i18n_rails
209
209
  licenses:
210
210
  - MIT
211
211
  metadata: {}
212
- post_install_message:
212
+ post_install_message:
213
213
  rdoc_options: []
214
214
  require_paths:
215
215
  - lib
@@ -224,8 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
- rubygems_version: 3.0.3
228
- signing_key:
227
+ rubygems_version: 3.3.3
228
+ signing_key:
229
229
  specification_version: 4
230
230
  summary: Simple FastGettext Rails integration.
231
231
  test_files: []