fast_gettext 2.0.2 → 2.0.3

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: b420be2be4266dfd061983817348080deae822f1c1524d34403b138320b917b6
4
- data.tar.gz: 5ffbc563510c68990336f5392d2813345ccae52453a623d16a1cfc5e6c40ff1a
3
+ metadata.gz: c5ed0cfe1dff67b67403f857c85eb5bd118f0eed9a23b43648226f371f9aa3da
4
+ data.tar.gz: 3a95468daabeb1b5428fd2e5d89a3df5a1718f8bd27a717faa9f99b0e6527db9
5
5
  SHA512:
6
- metadata.gz: 7973515f3e272e2ac4d0aeac673c3b88b89446eac45267be7119e2a6e0cf8d2d965757fbd32434b940b67b6041ca97232745b0235dc54ae2e1de1ee826c335b6
7
- data.tar.gz: 5ba8cd48c3df0c98aa167da5f2a908d25c6a50403f6f108013a0f557fd2cea3fe8a8123ec593f5fba03e650f1f3af817b1c0d44474ae5b9f49098d974483e286
6
+ metadata.gz: 944d697e9bea9763e8e14d54f3d5443e7d50d86d838910eef90e02d444128c61639e62863e4361bc65f76d87376897499989b57452d0723d303dbdb708798055
7
+ data.tar.gz: 2fe267c185b82822b529139b03cdb1939ed612bc9c25317b2914fbbff3ddbb41090f75178ad9f90cb498fbf910f8eebdf0833c274c38f97488194b4cd7763570
data/Readme.md CHANGED
@@ -126,7 +126,7 @@ p_('File', 'Open') == _("File\004Open") == "öffnen"
126
126
  p_('Context', 'not-found') == 'not-found'
127
127
  ```
128
128
 
129
- #### `s_()` or `sgetext()`: translation with namespace
129
+ #### `s_()` or `sgettext()`: translation with namespace
130
130
 
131
131
  ```ruby
132
132
  s_('File|Open') == _('File|Open') == "öffnen"
@@ -153,13 +153,13 @@ sn_('Fruit|Apple', 'Apples', 1) == 'Apfel'
153
153
 
154
154
  #### `N_()` and `Nn_()`: make dynamic translations available to the parser.
155
155
 
156
- In many instances, your strings will not be found the by the ruby-parse. These methods
156
+ In many instances, your strings will not be found by the ruby parsing. These methods
157
157
  allow for those strings to be discovered.
158
158
 
159
159
  ```
160
160
  N_("active"); N_("inactive"); N_("paused") # possible value of status for parser to find.
161
161
  Nn_("active", "inactive", "paused") # alternative method
162
- _("Your account is %{account_state}.") % { account_state: status }
162
+ _("Your account is %{account_state}.") % { account_state: _(status) }
163
163
  ```
164
164
 
165
165
 
@@ -180,7 +180,7 @@ Use the [original GetText](http://github.com/ruby-gettext/gettext) to create and
180
180
 
181
181
  ### Database
182
182
  [Example migration for ActiveRecord](http://github.com/grosser/fast_gettext/blob/master/examples/db/migration.rb)<br/>
183
- The default plural separator is `||||` but you may overwrite it (or suggest a better one..).
183
+ The default plural separator is `||||` but you may overwrite it (or suggest a better one...).
184
184
 
185
185
  This is usable with any model DataMapper/Sequel or any other(non-database) backend, the only thing you need to do is respond to the self.translation(key, locale) call.
186
186
  If you want to use your own models, have a look at the [default models](http://github.com/grosser/fast_gettext/tree/master/lib/fast_gettext/translation_repository/db_models) to see what you want/need to implement.
@@ -305,7 +305,7 @@ Unfound may not always mean missing, if you choose not to translate a word becau
305
305
  A lambda or anything that responds to `call` will do as callback. A good starting point may be `examples/missing_translations_logger.rb`.
306
306
 
307
307
  ### Plugins
308
- Want a xml version ?
308
+ Want an xml version?
309
309
  Write your own TranslationRepository!
310
310
 
311
311
  ```Ruby
@@ -362,7 +362,7 @@ Alternatively you can use [merge repository](https://github.com/grosser/fast_get
362
362
 
363
363
  #### Block defaults
364
364
 
365
- All the translation methods (includ MultiDomain) support a block default, a feature not provided by ruby-gettext. When a translation is
365
+ All the translation methods (including MultiDomain) support a block default, a feature not provided by ruby-gettext. When a translation is
366
366
  not found, if a block is provided the block is always returned. Otherwise, a key is returned. Methods doing pluralization will attempt a simple translation of alternate keys.
367
367
 
368
368
  ```ruby
@@ -172,7 +172,7 @@ module FastGettext
172
172
  locales = locales.to_s.gsub(/\s/, '')
173
173
  found = [[]]
174
174
  locales.split(',').each do |part|
175
- if part =~ /;q=/ # contains language and weight ?
175
+ if /;q=/.match?(part) # contains language and weight ?
176
176
  found.last << part.split(/;q=/)
177
177
  found.last.flatten!
178
178
  found << []
@@ -30,7 +30,7 @@ module FastGettext
30
30
  end
31
31
 
32
32
  def pluralisation_rule
33
- @model.pluralsation_rule if @model.respond_to? :pluralsation_rule
33
+ @model.pluralisation_rule if @model.respond_to? :pluralisation_rule
34
34
  end
35
35
 
36
36
  def [](key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FastGettext
4
- VERSION = Version = '2.0.2' # rubocop:disable Naming/ConstantName
4
+ VERSION = Version = '2.0.3' # rubocop:disable Naming/ConstantName
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -195,14 +195,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - ">="
197
197
  - !ruby/object:Gem::Version
198
- version: 2.3.0
198
+ version: 2.4.0
199
199
  required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ">="
202
202
  - !ruby/object:Gem::Version
203
203
  version: '0'
204
204
  requirements: []
205
- rubygems_version: 3.0.3
205
+ rubygems_version: 3.1.3
206
206
  signing_key:
207
207
  specification_version: 4
208
208
  summary: A simple, fast, memory-efficient and threadsafe implementation of GetText