phrase 0.4.27 → 0.4.28
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 +10 -0
- data/lib/phrase/api/client.rb +3 -2
- data/lib/phrase/tool/commands.rb +2 -1
- data/lib/phrase/tool/commands/pull.rb +4 -3
- 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: e9d2d05c19674e93f05ec0aeb9beae4b98f5c3c4
|
|
4
|
+
data.tar.gz: d4674160f5add7df47c43b9a8cfb18b517022429
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f2f714cdd9a9ee0ecfee366096f691db953faf7a4cf83fb82da380c3628f4af1f064c3609d2f11591e5a87b1b1436d8fde349b62ec61a96252fba830764b04b3
|
|
7
|
+
data.tar.gz: 18f174fe7383f8294228e02a449bf909e8bdc59d460034e221394ea6b87d83a1622f381b262727ffd9f9bdd279e98665757a83e27be58338d2864cebf2bb69dd
|
data/README.md
CHANGED
|
@@ -215,6 +215,15 @@ This will pull localization files for all of your locales available in the curre
|
|
|
215
215
|
|
|
216
216
|
Please note that you should only use this option if your translations definitely contains Emojis since it slows down the download time a bit.
|
|
217
217
|
|
|
218
|
+
* `--encoding`
|
|
219
|
+
|
|
220
|
+
Set the encoding for your localization files to UTF-8, UTF-16 or Latin-1.
|
|
221
|
+
|
|
222
|
+
phrase pull --encoding=UTF-8
|
|
223
|
+
|
|
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
|
+
|
|
226
|
+
|
|
218
227
|
* `--secret`
|
|
219
228
|
|
|
220
229
|
Your project auth token. You can find the auth token in your project overview or project settings form. This will fall back to the token stored in your `.phrase` config file.
|
|
@@ -248,6 +257,7 @@ The `phrase init` command allows several advanced configuration options to furth
|
|
|
248
257
|
* `--default-target`
|
|
249
258
|
|
|
250
259
|
Set the target directly to store your localization files retrieved by `phrase pull`. Allows [placeholders](#allowed-placeholders-for-advanced-configuration).
|
|
260
|
+
|
|
251
261
|
|
|
252
262
|
These options will be stored in your `.phrase` config file where you can edit them later on as well.
|
|
253
263
|
|
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)
|
|
90
|
+
def download_translations_for_locale(name, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=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
|
|
|
@@ -98,7 +98,8 @@ class Phrase::Api::Client
|
|
|
98
98
|
tag: tag,
|
|
99
99
|
updated_since: updated_since,
|
|
100
100
|
include_empty_translations: include_empty_translations ? "1" : nil,
|
|
101
|
-
convert_emoji: convert_emoji ? "1" : nil
|
|
101
|
+
convert_emoji: convert_emoji ? "1" : nil,
|
|
102
|
+
encoding: encoding
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
content = perform_api_request("/translations/download", :get, params)
|
data/lib/phrase/tool/commands.rb
CHANGED
|
@@ -17,6 +17,7 @@ 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
21
|
@target ||= Phrase::Formats.target_directory(@format) if format_valid?(@format)
|
|
21
22
|
end
|
|
22
23
|
|
|
@@ -24,14 +25,14 @@ class Phrase::Tool::Commands::Pull < Phrase::Tool::Commands::Base
|
|
|
24
25
|
(print_error("Invalid format: #{@format}") and exit_command) unless format_valid?(@format)
|
|
25
26
|
locales_to_download.compact.each do |locale|
|
|
26
27
|
print_message "Downloading #{locale.name}..."
|
|
27
|
-
fetch_translations_for_locale(locale, @format, @tag, @updated_since, @include_empty_translations, @convert_emoji)
|
|
28
|
+
fetch_translations_for_locale(locale, @format, @tag, @updated_since, @include_empty_translations, @convert_emoji, @encoding)
|
|
28
29
|
end
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
private
|
|
32
|
-
def fetch_translations_for_locale(locale, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil)
|
|
33
|
+
def fetch_translations_for_locale(locale, format, tag=nil, updated_since=nil, include_empty_translations=nil, convert_emoji=nil, encoding=nil)
|
|
33
34
|
begin
|
|
34
|
-
content = api_client.download_translations_for_locale(locale.name, format, tag, updated_since, include_empty_translations, convert_emoji)
|
|
35
|
+
content = api_client.download_translations_for_locale(locale.name, format, tag, updated_since, include_empty_translations, convert_emoji, encoding)
|
|
35
36
|
store_content_in_locale_file(locale, content)
|
|
36
37
|
rescue Exception => e
|
|
37
38
|
print_error "Failed"
|
|
@@ -108,6 +108,10 @@ class OptionsFactory
|
|
|
108
108
|
set[:convert_emoji] = convert_emoji
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
+
opts.on("--encoding=utf-8", String, "Convert .strings or .properties with alternate encoding") do |encoding|
|
|
112
|
+
set[:encoding] = encoding
|
|
113
|
+
end
|
|
114
|
+
|
|
111
115
|
opts.on("--secret=YOUR_AUTH_TOKEN", String, "The Auth Token to use for this operation instead of the saved one (optional)") do |secret|
|
|
112
116
|
set[:secret] = secret
|
|
113
117
|
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.28
|
|
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-10-
|
|
11
|
+
date: 2014-10-21 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
|
-
-
|
|
163
|
-
-
|
|
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: []
|