zlocalize 6.0.1.5 → 6.0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zlocalize/source_processor.rb +8 -4
- data/lib/zlocalize/translation_file.rb +5 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b47c0bdc87138208ef5941ce9e4bbe02fcd1ab5c61d7ac96cb4b1152a1ae9183
|
4
|
+
data.tar.gz: c41a5e58777b8d804bb65508e74d6ce2590e8e091fd8bce509c1e48355f644dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ef0a7650d371550f99899ae77d0eb617d332186aa27333442fbb40893ba2b6ad4071726b0d75308ae555570b16753b407f8ef97e1d814879f73450f505de213
|
7
|
+
data.tar.gz: 5ff9fd2151b32aac19cda55738f8f3d91e6f84d060acd863da03d437aa7d965e5a8dac6237425a4645ec9f7cd8dead6e92611430ef1911d933779d07e8215843
|
@@ -18,8 +18,12 @@ module ZLocalize
|
|
18
18
|
content = ActionView::Template::Handlers::ERB::Erubi.new(content, escape: true, trim: true).src
|
19
19
|
end
|
20
20
|
@parser = create_parser_for_ruby_version
|
21
|
-
|
22
|
-
|
21
|
+
begin
|
22
|
+
@stree = @parser.parse(content)
|
23
|
+
process(@stree)
|
24
|
+
rescue ArgumentError => ae
|
25
|
+
raise ArgumentError.new("In #{filename} #{ae.message}")
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def create_parser_for_ruby_version
|
@@ -59,14 +63,14 @@ module ZLocalize
|
|
59
63
|
|
60
64
|
def get_string_node_value(node)
|
61
65
|
unless node.is_a?(AST::Node) && node.type == :str
|
62
|
-
raise ArgumentError.new("String Expected but got: #{node.inspect}")
|
66
|
+
raise ArgumentError.new("On line #{node.loc.selector.line} at column #{node.loc.selector.column+1} : String Expected but got: #{node.inspect}")
|
63
67
|
end
|
64
68
|
return node.children[0]
|
65
69
|
end
|
66
70
|
|
67
71
|
def get_string_array_node_value(node)
|
68
72
|
unless node.is_a?(AST::Node) || node.type != :array
|
69
|
-
raise ArgumentError.new("Array expected but got: #{node.inspect}")
|
73
|
+
raise ArgumentError.new("On line #{node.loc.selector.line} at column #{node.loc.selector.column+1} : Array expected but got: #{node.inspect}")
|
70
74
|
end
|
71
75
|
a = []
|
72
76
|
for i in 0..node.children.size - 1
|
@@ -199,7 +199,11 @@ module ZLocalize
|
|
199
199
|
if File.exists?(filename)
|
200
200
|
content = File.open(filename,"r") { |f| f.read }
|
201
201
|
read_yaml_header(content)
|
202
|
-
|
202
|
+
begin
|
203
|
+
entries = YAML::load(content)
|
204
|
+
rescue StandardError => e
|
205
|
+
raise TranslationFileError.new("Error reading ZLocalize TranslationFile #{filename} : #{e.message}")
|
206
|
+
end
|
203
207
|
if entries && !entries.is_a?(Hash)
|
204
208
|
raise TranslationFileError.new("Invalid YAML translation file #{filename}\n\n#{entries.inspect}")
|
205
209
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Bedard
|
8
8
|
- Stephane Volet
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '2.7'
|
90
|
-
description:
|
90
|
+
description:
|
91
91
|
email:
|
92
92
|
- zzeligg@gmail.com
|
93
93
|
- steph@zboing.ca
|
@@ -118,7 +118,7 @@ homepage: https://github.com/zzeligg/zlocalize
|
|
118
118
|
licenses:
|
119
119
|
- MIT
|
120
120
|
metadata: {}
|
121
|
-
post_install_message:
|
121
|
+
post_install_message:
|
122
122
|
rdoc_options: []
|
123
123
|
require_paths:
|
124
124
|
- lib
|
@@ -133,8 +133,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
rubygems_version: 3.
|
137
|
-
signing_key:
|
136
|
+
rubygems_version: 3.3.5
|
137
|
+
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Translation engine for Rails applications
|
140
140
|
test_files: []
|