ad_localize 4.0.9 → 4.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e17293e2000accb75875be47bacc58bf7193039c4f0f2a407c5787fbcde38d6
4
- data.tar.gz: e0b68dcc055d3e303878496953411b96926f774fbd28805ec9684d4022a54c2a
3
+ metadata.gz: c1a18c57ba71812f3a373cb5b5904b784cf2855f444b1cf979a6c854db3d585b
4
+ data.tar.gz: aa1199ab974d906eb9b3bad2b319601709251632e42d13965dded74fa4a9384e
5
5
  SHA512:
6
- metadata.gz: e81296d0f5bb5bbe41d1fedddf36814a0ee695919bf8f00f527ecdf02a830e6f1ccb5c3a4c4542c47345d552cac0d229f4dbb41797e1bdd66d89dbd7d6b812d1
7
- data.tar.gz: 7a963846243a0fd6026bb3f9e604ea946937cace3f6d66d8e22a4a698d0aa3c2f4fe1b98a60620f1d21cbd179f75e153e216b2736827b7c5b8409b9ef25e94a8
6
+ metadata.gz: 3b7c19e962e871d0248443ba4a64f53a4f7a4348c63cbee07fabdeb2e020d97a8f9d6ae3beff1e46f89347c252615510c003b8cec30c96f93dde9c938e786374
7
+ data.tar.gz: 12eaeeded22193ea3c0e5e6a6fc5c4bf9faece87cb4c33811452b0bfa44bb73ca448c3665a26930d824acf724701c85e7e49a045974ca9d470c4da4c1d226051
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.1.0] - 2022-03-02
9
+
10
+ ### Changed
11
+
12
+ - Do not export empty translation on Android in PR [#72](https://github.com/faberNovel/ad_localize/pull/72)
13
+
14
+
8
15
  ## [4.0.9] - 2021-09-05
9
16
 
10
17
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ad_localize (4.0.9)
4
+ ad_localize (4.1.0)
5
5
  activesupport (>= 6.1.3.2, < 7.0)
6
6
  colorize (~> 0.8)
7
7
  google-apis-sheets_v4 (~> 0.9)
@@ -11,7 +11,7 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (6.1.4.1)
14
+ activesupport (6.1.4.6)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
@@ -26,26 +26,30 @@ GEM
26
26
  concurrent-ruby (1.1.9)
27
27
  declarative (0.0.20)
28
28
  diffy (3.3.0)
29
- faraday (1.7.1)
29
+ faraday (1.10.0)
30
30
  faraday-em_http (~> 1.0)
31
31
  faraday-em_synchrony (~> 1.0)
32
32
  faraday-excon (~> 1.1)
33
- faraday-httpclient (~> 1.0.1)
33
+ faraday-httpclient (~> 1.0)
34
+ faraday-multipart (~> 1.0)
34
35
  faraday-net_http (~> 1.0)
35
- faraday-net_http_persistent (~> 1.1)
36
+ faraday-net_http_persistent (~> 1.0)
36
37
  faraday-patron (~> 1.0)
37
38
  faraday-rack (~> 1.0)
38
- multipart-post (>= 1.2, < 3)
39
+ faraday-retry (~> 1.0)
39
40
  ruby2_keywords (>= 0.0.4)
40
41
  faraday-em_http (1.0.0)
41
42
  faraday-em_synchrony (1.0.0)
42
43
  faraday-excon (1.1.0)
43
44
  faraday-httpclient (1.0.1)
45
+ faraday-multipart (1.0.3)
46
+ multipart-post (>= 1.2, < 3)
44
47
  faraday-net_http (1.0.1)
45
48
  faraday-net_http_persistent (1.2.0)
46
49
  faraday-patron (1.0.0)
47
50
  faraday-rack (1.0.0)
48
- google-apis-core (0.4.1)
51
+ faraday-retry (1.0.3)
52
+ google-apis-core (0.4.2)
49
53
  addressable (~> 2.5, >= 2.5.1)
50
54
  googleauth (>= 0.16.2, < 2.a)
51
55
  httpclient (>= 2.8.1, < 3.a)
@@ -54,7 +58,7 @@ GEM
54
58
  retriable (>= 2.0, < 4.a)
55
59
  rexml
56
60
  webrick
57
- google-apis-sheets_v4 (0.9.0)
61
+ google-apis-sheets_v4 (0.11.0)
58
62
  google-apis-core (>= 0.4, < 2.a)
59
63
  googleauth (0.17.1)
60
64
  faraday (>= 0.17.3, < 2.0)
@@ -64,12 +68,12 @@ GEM
64
68
  os (>= 0.9, < 2.0)
65
69
  signet (~> 0.15)
66
70
  httpclient (2.8.3)
67
- i18n (1.8.10)
71
+ i18n (1.10.0)
68
72
  concurrent-ruby (~> 1.0)
69
- jwt (2.2.3)
73
+ jwt (2.3.0)
70
74
  memoist (0.16.2)
71
- mini_mime (1.1.1)
72
- mini_portile2 (2.6.1)
75
+ mini_mime (1.1.2)
76
+ mini_portile2 (2.8.0)
73
77
  minitest (5.14.4)
74
78
  minitest-reporters (1.4.2)
75
79
  ansi
@@ -78,12 +82,12 @@ GEM
78
82
  ruby-progressbar
79
83
  multi_json (1.15.0)
80
84
  multipart-post (2.1.1)
81
- nokogiri (1.12.4)
82
- mini_portile2 (~> 2.6.1)
85
+ nokogiri (1.13.3)
86
+ mini_portile2 (~> 2.8.0)
83
87
  racc (~> 1.4)
84
- os (1.1.1)
88
+ os (1.1.4)
85
89
  public_suffix (4.0.6)
86
- racc (1.5.2)
90
+ racc (1.6.0)
87
91
  rake (12.3.3)
88
92
  representable (3.1.1)
89
93
  declarative (< 0.1.0)
@@ -93,17 +97,17 @@ GEM
93
97
  rexml (3.2.5)
94
98
  ruby-progressbar (1.10.1)
95
99
  ruby2_keywords (0.0.5)
96
- signet (0.16.0)
100
+ signet (0.16.1)
97
101
  addressable (~> 2.8)
98
- faraday (>= 0.17.3, < 2.0)
102
+ faraday (>= 0.17.5, < 3.0)
99
103
  jwt (>= 1.5, < 3.0)
100
104
  multi_json (~> 1.10)
101
- trailblazer-option (0.1.1)
105
+ trailblazer-option (0.1.2)
102
106
  tzinfo (2.0.4)
103
107
  concurrent-ruby (~> 1.0)
104
108
  uber (0.1.0)
105
109
  webrick (1.7.0)
106
- zeitwerk (2.4.2)
110
+ zeitwerk (2.5.4)
107
111
 
108
112
  PLATFORMS
109
113
  ruby
data/README.md CHANGED
@@ -123,6 +123,7 @@ $ ad_localize -k <your-spreadsheet-drive-key> -s <comma-separated-sheet-id-list>
123
123
  - Any column after the `key` column will be considered as a locale column (except from the optional `comment` columns)
124
124
  - Keys should contain only letter, number, underscore and dot : [a-z0-9_.]+.
125
125
  - Format specifiers must be numeroted if there are more than one in a translation string (eg: `"%1$@ %2$@'s report"`).
126
+ - _Only for Android_ keys without translation won't be considered
126
127
 
127
128
  ### Comments
128
129
 
@@ -23,6 +23,10 @@ module AdLocalize
23
23
  o.value == value &&
24
24
  o.comment == comment
25
25
  end
26
+
27
+ def has_value?
28
+ value.present?
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -22,11 +22,13 @@ module AdLocalize
22
22
  end
23
23
 
24
24
  def map_singulars(translations:)
25
- translations.map { |translation| @translation_mapper.map(translation: translation) }
25
+ translations.select(&:has_value?).map { |translation| @translation_mapper.map(translation: translation) }
26
26
  end
27
27
 
28
28
  def map_plurals(plurals:)
29
- plurals.map { |label, translations| @translation_group_mapper.map(label: label, translations: translations) }
29
+ plurals
30
+ .map { |label, translations| @translation_group_mapper.map(label: label, translations: translations.select(&:has_value?)) }
31
+ .select(&:has_translations?)
30
32
  end
31
33
  end
32
34
  end
@@ -1,3 +1,3 @@
1
1
  module AdLocalize
2
- VERSION = "4.0.9"
2
+ VERSION = "4.1.0"
3
3
  end
@@ -10,6 +10,10 @@ module AdLocalize
10
10
  @label = label
11
11
  @translation_view_models = translation_view_models
12
12
  end
13
+
14
+ def has_translations?
15
+ (translation_view_models || []).any?(&:has_value?)
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -14,6 +14,10 @@ module AdLocalize
14
14
  @value = value
15
15
  @comment = comment
16
16
  end
17
+
18
+ def has_value?
19
+ value.present?
20
+ end
17
21
  end
18
22
  end
19
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ad_localize
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.9
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edouard Siegel
@@ -17,7 +17,7 @@ authors:
17
17
  - Claire Dufetrelle
18
18
  - Pierre Felgines
19
19
  - Satyan Jacquens
20
- autorequire:
20
+ autorequire:
21
21
  bindir: exe
22
22
  cert_chain: []
23
23
  date: 2018-04-18 00:00:00.000000000 Z
@@ -270,7 +270,7 @@ homepage: https://github.com/applidium/ad_localize
270
270
  licenses:
271
271
  - MIT
272
272
  metadata: {}
273
- post_install_message:
273
+ post_install_message:
274
274
  rdoc_options: []
275
275
  require_paths:
276
276
  - lib
@@ -285,8 +285,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  requirements: []
288
- rubygems_version: 3.2.26
289
- signing_key:
288
+ rubygems_version: 3.2.15
289
+ signing_key:
290
290
  specification_version: 4
291
291
  summary: AdLocalize helps with mobile and web applications wording
292
292
  test_files: []