zlocalize 6.0.2.1 → 6.0.4

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: f1d045086410b4219efddf96ff7165fffbf4d6f79f3c058d1b8a64a4a014d67e
4
- data.tar.gz: ddf36c917e025267baadf4d3dbdf4d47fcce6028d73f570170b1fe73c642060d
3
+ metadata.gz: c7dba6245e36abb8ee6386924b30611372e613983f34df379ada843efdd1d288
4
+ data.tar.gz: 95e6cac078466ce4e07cc7ba6608fb881a761180c49862e29c47f016eda4d4f2
5
5
  SHA512:
6
- metadata.gz: 5def0cdcc38cb4711f069683a03cf75c63e4da9e18c0319790f20c80a2c497418679c619b550eb1843b8f476694e405f8f763a7e95acd7fa2a90f11f2b88d53c
7
- data.tar.gz: 9bb5d022d727b30904b4269575e9e3c7b566061cac95228015b9bfa3e82ef2671e267e1fd98e3606b5fb5ecbcd86415613f8f72333d6f024852be691d346f3ff
6
+ metadata.gz: 8a2515c3d643fc7fea27fd2f26d9e7fe289495c2b2da60df51bd26b8f5347e87780b6ba7d79ea6a4facc7574e17de62b9740bbf5845fbbe61a6e39b64ab88d61
7
+ data.tar.gz: 8ebf838852723b9fd7db9ea52823f9aff5fc39b2da10977a83a345014e085e17f01c79a6a10e804cfd3c859da2f5b8a333b7878528b49f5ef5d299df9669c9f9
@@ -15,7 +15,7 @@ module ZLocalize
15
15
 
16
16
  attr_accessor :rails_root
17
17
 
18
- DEFAULT_HARVEST_OPTIONS = { :output => 'config/locales/app-strings.yml',
18
+ DEFAULT_HARVEST_OPTIONS = { :output => 'config/translations/app-strings.yml',
19
19
  :overwrite_existing => false,
20
20
  :add_paths => [],
21
21
  :silent => false,
@@ -12,6 +12,7 @@ require 'rails/generators/base'
12
12
 
13
13
  def create_initializer_file
14
14
  template "initializer_template.rb", "config/initializers/zlocalize.rb"
15
+ FileUtils.mkdir_p "config/translations"
15
16
  end
16
17
 
17
18
  end
@@ -35,12 +35,12 @@ ZLocalize.config.return_source_on_missing = { development: false, test: false,
35
35
  ZLocalize.config.locales = {
36
36
  en: {
37
37
  plural_select: -> (n) { n <= 0 ? 0 : (n > 1 ? 2 : 1) },
38
- translations: File.join(Rails.root,'config/locales/en.strings.yml'),
38
+ translations: File.join(Rails.root,'config/translations/en.strings.yml'),
39
39
  convert_float: -> (s) { s.to_s.gsub(',','') }
40
40
  },
41
41
  # fr: {
42
42
  # plural_select: -> (n) { n <= 0 ? 0 : (n > 1 ? 2 : 1) },
43
- # translations: File.join(Rails.root,'config/locales/fr.strings.yml'),
43
+ # translations: File.join(Rails.root,'config/translations/fr.strings.yml'),
44
44
  # titleize: -> (s) { s.capitalize.to_s },
45
45
  # convert_float: -> (s) { s.to_s.gsub(' ','').gsub(',','.') }
46
46
  # }
@@ -5,7 +5,7 @@ namespace :zlocalize do
5
5
  desc "Collect all translatable strings (used in _('...') and n_('...') calls) in your Rails application\n\n" +
6
6
  "Usage: rake zlocalize:harvest\n" +
7
7
  "Options and their defaults are:\n\n" +
8
- " output=FILE_PATH Output file, relative to Rails.root (default: \'config/locales/app-strings.yml\')\n" +
8
+ " output=FILE_PATH Output file, relative to Rails.root (default: \'config/translations/app-strings.yml\')\n" +
9
9
  " purge=true|false Remove unused entries in the existing output file (if it exists). (default: false)\n" +
10
10
  " clear=true|false Clearing the existing translations in output file (if it exists). (default: false)\n" +
11
11
  " silent=true|false If true, do not report progress. (default: false)\n" +
@@ -14,7 +14,7 @@ namespace :zlocalize do
14
14
  task :harvest => :environment do
15
15
  options = { :clear => ['1','true'].include?(ENV['clear']),
16
16
  :purge => ['1','true'].include?(ENV['purge']),
17
- :output => ENV['output'].to_s.empty? ? 'config/locales/app-strings.yml' : ENV['output'],
17
+ :output => ENV['output'].to_s.empty? ? 'config/translations/app-strings.yml' : ENV['output'],
18
18
  :add_paths => ENV['add_paths'].to_s.empty? ? [] : ENV['add_paths'].split(','),
19
19
  :silent => ['1','true'].include?(ENV['silent']) }
20
20
 
@@ -27,7 +27,7 @@ class TranslationValidator < ActiveModel::EachValidator
27
27
  end
28
28
  end
29
29
 
30
- def validate_each(record,attr_name,value)
30
+ def validate_each(record, attr_name, value)
31
31
  configuration = { :message => :missing_translations,
32
32
  :required_locales => record.respond_to?(:get_required_locales) ? :get_required_locales : [] }
33
33
  configuration.update(options)
@@ -44,8 +44,7 @@ class TranslationValidator < ActiveModel::EachValidator
44
44
  end
45
45
  end
46
46
  if missing_locales.size > 0
47
- # m = configuration[:message].to_s.gsub()
48
- record.errors.add(attr_name, configuration[:message], { :locales => missing_locales.to_sentence })
47
+ record.errors.add(attr_name, :missing_translation, :message => configuration[:message], :locales => missing_locales.to_sentence)
49
48
  end
50
49
  end
51
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zlocalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.2.1
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Bedard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-25 00:00:00.000000000 Z
12
+ date: 2023-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,42 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '6.0'
20
+ version: '5.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '6.0'
27
+ version: '5.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '6.0'
34
+ version: '5.2'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '6.0'
41
+ version: '5.2'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: actionpack
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '6.0'
48
+ version: '5.2'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '6.0'
55
+ version: '5.2'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: i18n
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubygems_version: 3.3.5
136
+ rubygems_version: 3.3.7
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Translation engine for Rails applications