phraseapp_updater 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +2 -3
- data/bin/phraseapp_updater +1 -0
- data/lib/phraseapp_updater/locale_file/json_file.rb +3 -1
- data/lib/phraseapp_updater/locale_file/yaml_file.rb +3 -1
- data/lib/phraseapp_updater/phraseapp_api.rb +2 -2
- data/lib/phraseapp_updater/version.rb +1 -1
- data/lib/phraseapp_updater/yml_config_loader.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0d34620e813a3d8381bb9e69718c4eddf00861c
|
4
|
+
data.tar.gz: 83376f665f0c2a2db922f5297f2a29890700be54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e17e637e811441675d66c88a948913ba8526a014934405889b31422200991e66cc68d8cc9e0a733d99cd98f87e7b0f6f051fa0b358d5d15f3af8f47ad6eb28c3
|
7
|
+
data.tar.gz: 4b3e48725db68140f04d6c12f836ce82e6514151b652525331925ea3a8b690209fdf2d67ff5c6594c2f0b75c7629ffd3e1254ca1a191ff43228edc4e224f101a
|
data/README.markdown
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/iknow/phraseapp_updater.svg?branch=master)](https://travis-ci.org/iknow/phraseapp_updater)
|
4
4
|
|
5
|
-
**Version** 0.1.
|
5
|
+
**Version** 0.1.7
|
6
6
|
|
7
7
|
This is a tool for merging PhraseApp locale data with locale data
|
8
8
|
committed in your project.
|
@@ -89,7 +89,7 @@ committed to your application's respository. These will be used in the
|
|
89
89
|
merge with the files on PhraseApp.
|
90
90
|
|
91
91
|
```
|
92
|
-
phraseapp_updater push --new_locales_path="/data/
|
92
|
+
phraseapp_updater push --new_locales_path="/data/new", --previous_locales_path="/data/previous" --phraseapp_api_key="yourkey" --phraseapp_project_id="projectid --file_format=json"
|
93
93
|
```
|
94
94
|
|
95
95
|
The arguments provided to the command can also be specified as shell
|
@@ -160,7 +160,6 @@ If you'd like to contribute, these would be very helpful!
|
|
160
160
|
* Separating downloading and resolving data from PhraseApp from pushing
|
161
161
|
back up to it, to enable different kinds of workflows.
|
162
162
|
* Expose the changed files on the command line.
|
163
|
-
* Implement other `LocaleFile`s with `parse` for non-JSON types.
|
164
163
|
* Checking if PhraseApp files changed during execution before upload, to reduce the race condition window.
|
165
164
|
* More specs for the API and shell.
|
166
165
|
|
data/bin/phraseapp_updater
CHANGED
@@ -57,6 +57,7 @@ class PhraseAppUpdaterCLI < Thor
|
|
57
57
|
option :phraseapp_api_key, type: :string, desc: "PhraseApp API key. Shell variable: PA_API_KEY"
|
58
58
|
option :phraseapp_project_id, type: :string, desc: "PhraseApp project ID. Shell variable: PA_PROJECT_ID"
|
59
59
|
option :config_file_path, type: :string, desc: "Path to .phraseapp.yml config file to read API key and project ID."
|
60
|
+
option :file_format, type: :string, desc: "Filetype of localization files."
|
60
61
|
|
61
62
|
def pull
|
62
63
|
phraseapp_api_key, phraseapp_project_id, file_format = load_phraseapp_configuration(options)
|
@@ -8,7 +8,9 @@ Oj.default_options = {mode: :strict}
|
|
8
8
|
class PhraseAppUpdater
|
9
9
|
class LocaleFile
|
10
10
|
class JSONFile < LocaleFile
|
11
|
-
EXTENSION
|
11
|
+
EXTENSION = "json"
|
12
|
+
PHRASEAPP_TYPE = "nested_json"
|
13
|
+
|
12
14
|
def self.from_hash(name, hash)
|
13
15
|
new(name, MultiJson.dump(hash))
|
14
16
|
end
|
@@ -46,7 +46,7 @@ class PhraseAppUpdater
|
|
46
46
|
def download_file(locale, skip_unverified)
|
47
47
|
download_params = PhraseApp::RequestParams::LocaleDownloadParams.new
|
48
48
|
|
49
|
-
download_params.file_format =
|
49
|
+
download_params.file_format = @locale_file_class.const_get(:PHRASEAPP_TYPE)
|
50
50
|
download_params.skip_unverified_translations = skip_unverified
|
51
51
|
|
52
52
|
phraseapp_request { @client.locale_download(@project_id, locale.id, download_params) }
|
@@ -142,7 +142,7 @@ class PhraseAppUpdater
|
|
142
142
|
def create_upload_params(locale_name)
|
143
143
|
upload_params = PhraseApp::RequestParams::UploadParams.new
|
144
144
|
upload_params.file_encoding = "UTF-8"
|
145
|
-
upload_params.file_format =
|
145
|
+
upload_params.file_format = @locale_file_class.const_get(:PHRASEAPP_TYPE)
|
146
146
|
upload_params.locale_id = locale_name
|
147
147
|
upload_params.skip_unverification = false
|
148
148
|
upload_params.update_translations = true
|
@@ -32,6 +32,10 @@ class PhraseAppUpdater
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
+
# TODO As this information is now duplicated in the file type
|
36
|
+
# classes, it would be better to pass this around and use it to determine
|
37
|
+
# which class to instantiate. Maybe? Should probably go along with a change
|
38
|
+
# to the command line which forces the use of PhraseApp types.
|
35
39
|
def convert(phraseapp_file_format)
|
36
40
|
case phraseapp_file_format
|
37
41
|
when "nested_json"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phraseapp_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|