phrase 0.4.28 → 0.4.29
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/README.md +6 -0
- data/lib/phrase/api/client.rb +3 -2
- data/lib/phrase/tool/commands.rb +2 -1
- data/lib/phrase/tool/commands/pull.rb +5 -4
- data/lib/phrase/tool/config.rb +9 -0
- data/lib/phrase/tool/options_factory.rb +4 -0
- data/lib/phrase/version.rb +1 -1
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f50629fe11a9b95170ba6be764a7f1c06329b13
|
4
|
+
data.tar.gz: 149c60787026183d56b8f1aa89c1cbb4e9e4ecc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 033e1d168b55edf35b2d6ae6ffd956e6ee8b88eb279e59fb77c0da377bbe566e7b01ee2f893cf29768bd103888d9c05358772b6ee56eee7fd43e6869205f2efc
|
7
|
+
data.tar.gz: bfaf505c644852d1cef722ff13cd08ba04e389dc78768d0e4aaf0166f35ecafdd17f350026eda104c0deeac17d5eb422167f9b424ffb62275aca938a27c6c829
|
data/README.md
CHANGED
@@ -223,6 +223,12 @@ This will pull localization files for all of your locales available in the curre
|
|
223
223
|
|
224
224
|
Please note that the encodings only work for a handful of formats like IOS .strings or Java .properties. The default will be UTF-8. If none is provided the default encoding of the formats is used.
|
225
225
|
|
226
|
+
* `--skip-unverified-translations`
|
227
|
+
|
228
|
+
By default all translations are downloaded. Use this flag to skip all unverified translations.
|
229
|
+
|
230
|
+
phrase pull --skip-unverified-translations
|
231
|
+
|
226
232
|
|
227
233
|
* `--secret`
|
228
234
|
|
data/lib/phrase/api/client.rb
CHANGED
@@ -87,7 +87,7 @@ class Phrase::Api::Client
|
|
87
87
|
true
|
88
88
|
end
|
89
89
|
|
90
|
-
def download_translations_for_locale(name, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=nil)
|
90
|
+
def download_translations_for_locale(name, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=nil, skip_unverified_translations=nil)
|
91
91
|
raise "You must specify a name" if name.nil? || name.blank?
|
92
92
|
raise "You must specify a format" if format.nil? || format.blank?
|
93
93
|
|
@@ -99,7 +99,8 @@ class Phrase::Api::Client
|
|
99
99
|
updated_since: updated_since,
|
100
100
|
include_empty_translations: include_empty_translations ? "1" : nil,
|
101
101
|
convert_emoji: convert_emoji ? "1" : nil,
|
102
|
-
encoding: encoding
|
102
|
+
encoding: encoding,
|
103
|
+
skip_unverified_translations: skip_unverified_translations ? "1" : nil
|
103
104
|
}
|
104
105
|
|
105
106
|
content = perform_api_request("/translations/download", :get, params)
|
data/lib/phrase/tool/commands.rb
CHANGED
@@ -17,22 +17,23 @@ class Phrase::Tool::Commands::Pull < Phrase::Tool::Commands::Base
|
|
17
17
|
@updated_since = @options.get(:updated_since)
|
18
18
|
@include_empty_translations = @options.get(:include_empty_translations)
|
19
19
|
@convert_emoji = @options.get(:convert_emoji)
|
20
|
-
@encoding = @options.get(:encoding)
|
20
|
+
@encoding = @options.get(:encoding) || config.encoding
|
21
21
|
@target ||= Phrase::Formats.target_directory(@format) if format_valid?(@format)
|
22
|
+
@skip_unverified_translations = @options.get(:skip_unverified_translations)
|
22
23
|
end
|
23
24
|
|
24
25
|
def execute!
|
25
26
|
(print_error("Invalid format: #{@format}") and exit_command) unless format_valid?(@format)
|
26
27
|
locales_to_download.compact.each do |locale|
|
27
28
|
print_message "Downloading #{locale.name}..."
|
28
|
-
fetch_translations_for_locale(locale, @format, @tag, @updated_since, @include_empty_translations, @convert_emoji, @encoding)
|
29
|
+
fetch_translations_for_locale(locale, @format, @tag, @updated_since, @include_empty_translations, @convert_emoji, @encoding, @skip_unverified_translations)
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
33
|
private
|
33
|
-
def fetch_translations_for_locale(locale, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=nil)
|
34
|
+
def fetch_translations_for_locale(locale, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=nil, skip_unverified_translations=nil)
|
34
35
|
begin
|
35
|
-
content = api_client.download_translations_for_locale(locale.name, format, tag, updated_since, include_empty_translations, convert_emoji, encoding)
|
36
|
+
content = api_client.download_translations_for_locale(locale.name, format, tag, updated_since, include_empty_translations, convert_emoji, encoding, skip_unverified_translations)
|
36
37
|
store_content_in_locale_file(locale, content)
|
37
38
|
rescue Exception => e
|
38
39
|
print_error "Failed"
|
data/lib/phrase/tool/config.rb
CHANGED
@@ -94,6 +94,15 @@ class Phrase::Tool::Config
|
|
94
94
|
save_config!
|
95
95
|
end
|
96
96
|
|
97
|
+
def encoding
|
98
|
+
get_setting("encoding")
|
99
|
+
end
|
100
|
+
|
101
|
+
def encoding=(new_encoding)
|
102
|
+
config["encoding"] = new_encoding
|
103
|
+
save_config!
|
104
|
+
end
|
105
|
+
|
97
106
|
private
|
98
107
|
def config
|
99
108
|
@config ||= {}
|
@@ -112,6 +112,10 @@ class OptionsFactory
|
|
112
112
|
set[:encoding] = encoding
|
113
113
|
end
|
114
114
|
|
115
|
+
opts.on("--skip-unverified-translations", "Skip unverified translations in the result") do |skip_unverified_translations|
|
116
|
+
set[:skip_unverified_translations] = skip_unverified_translations
|
117
|
+
end
|
118
|
+
|
115
119
|
opts.on("--secret=YOUR_AUTH_TOKEN", String, "The Auth Token to use for this operation instead of the saved one (optional)") do |secret|
|
116
120
|
set[:secret] = secret
|
117
121
|
end
|
data/lib/phrase/version.rb
CHANGED
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dynport GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: i18n
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: webmock
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: vcr
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: timecop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: genspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rails
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description: phrase allows you to edit translations in-place on the page itself. More
|
@@ -159,8 +159,8 @@ executables:
|
|
159
159
|
extensions: []
|
160
160
|
extra_rdoc_files: []
|
161
161
|
files:
|
162
|
-
- .gitignore
|
163
|
-
- .travis.yml
|
162
|
+
- ".gitignore"
|
163
|
+
- ".travis.yml"
|
164
164
|
- Gemfile
|
165
165
|
- Gemfile.lock
|
166
166
|
- Guardfile
|
@@ -252,12 +252,12 @@ require_paths:
|
|
252
252
|
- lib
|
253
253
|
required_ruby_version: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
|
-
- -
|
255
|
+
- - ">="
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
259
|
requirements:
|
260
|
-
- -
|
260
|
+
- - ">="
|
261
261
|
- !ruby/object:Gem::Version
|
262
262
|
version: 1.3.6
|
263
263
|
requirements: []
|