zlocalize 6.0.2.1 → 6.0.3
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 +4 -4
- data/lib/zlocalize/harvester.rb +1 -1
- data/lib/zlocalize/rails/generators/initializer.rb +1 -0
- data/lib/zlocalize/rails/generators/templates/initializer_template.rb +2 -2
- data/lib/zlocalize/rails/tasks/harvest.rake +2 -2
- data/lib/zlocalize/rails/translation_validator.rb +2 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b5522b6ea82798fe981eebf7d3dc4194244150004eb86b293db3fd8800978d
|
4
|
+
data.tar.gz: 281562dcdc5ca40e6618c60c4629856d152606b746fbaee0b53be84ef720f666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6be05d4c717b68ef0b2dd1babfc31e98e44e85f3e019418bc4e58852af9f99b3fe74dfa37d87d65b1a3c4ec66a628e23686e37cb6db1ed6d8cf51c5f5c492c20
|
7
|
+
data.tar.gz: 815138a1bea01dd2695ef521d841615a6e92c398f01bd7712c527ad8cc00a065f045166863ca81b7088f3bef395f5a713abefeb9c7e473e047a8ea4a3300ad07
|
data/lib/zlocalize/harvester.rb
CHANGED
@@ -15,7 +15,7 @@ module ZLocalize
|
|
15
15
|
|
16
16
|
attr_accessor :rails_root
|
17
17
|
|
18
|
-
DEFAULT_HARVEST_OPTIONS = { :output => 'config/
|
18
|
+
DEFAULT_HARVEST_OPTIONS = { :output => 'config/translations/app-strings.yml',
|
19
19
|
:overwrite_existing => false,
|
20
20
|
:add_paths => [],
|
21
21
|
:silent => false,
|
@@ -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/
|
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/
|
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/
|
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/
|
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
|
-
|
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.
|
4
|
+
version: 6.0.3
|
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-
|
12
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -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.
|
136
|
+
rubygems_version: 3.3.10
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Translation engine for Rails applications
|