locca 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/locca +4 -1
- data/lib/locca.rb +2 -2
- data/lib/locca/actions/onesky_sync_action.rb +2 -2
- data/lib/locca/genstrings.rb +1 -1
- data/lib/locca/sync/onesky.rb +2 -2
- data/lib/locca/version.rb +1 -1
- 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: 0de31b1cfbf5dc6be572c084cef8289b33c3749f
|
4
|
+
data.tar.gz: a6bfe34dc35e921aa820b89307ef65b9aba2d4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ac44b04a266a3be55956243e18f8657761cda099415ca84da8057bdd3eab185920aa0bb72481e4ee4664f32262a6a37cb62f996d9648d3f05a6f5583ab3136
|
7
|
+
data.tar.gz: bda3270eb43c1848535d70c575f61dd175f784e24f1186d7bc9f3b439634c9893b7787233a5df989e6febee989b09a2d9a6ef642d3a2df62ffe2f0efcd9f9a4c
|
data/bin/locca
CHANGED
@@ -62,13 +62,16 @@ end
|
|
62
62
|
|
63
63
|
desc 'Sync (fetch, merge and upload new) translations with external translation service'
|
64
64
|
command :sync do |c|
|
65
|
+
c.desc 'Prune missing strings from external service'
|
66
|
+
c.switch :prune, :negatable => false
|
67
|
+
|
65
68
|
c.action do |global_options, options, args|
|
66
69
|
work_dir = global_options['work-dir'.to_sym]
|
67
70
|
if not work_dir
|
68
71
|
work_dir = Dir.getwd
|
69
72
|
end
|
70
73
|
|
71
|
-
$locca.sync(project_in_dir(work_dir))
|
74
|
+
$locca.sync(project_in_dir(work_dir), options[:prune])
|
72
75
|
end
|
73
76
|
end
|
74
77
|
|
data/lib/locca.rb
CHANGED
@@ -71,12 +71,12 @@ module Locca
|
|
71
71
|
action.execute()
|
72
72
|
end
|
73
73
|
|
74
|
-
def sync(project)
|
74
|
+
def sync(project, prune_missing_strings = false)
|
75
75
|
if not project
|
76
76
|
raise 'Can\'t initialize Locca with nil project'
|
77
77
|
end
|
78
78
|
|
79
|
-
one_sky_action(project).sync()
|
79
|
+
one_sky_action(project).sync(prune_missing_strings)
|
80
80
|
end
|
81
81
|
|
82
82
|
def fetch(project)
|
@@ -62,7 +62,7 @@ module Locca
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
def sync()
|
65
|
+
def sync(prune_missing_strings = false)
|
66
66
|
fetch()
|
67
67
|
|
68
68
|
# 3
|
@@ -97,7 +97,7 @@ module Locca
|
|
97
97
|
@generated_collections.each do |generated_collection|
|
98
98
|
print "[*] upload: #{@project.base_lang}/#{generated_collection.name}\n"
|
99
99
|
collection_path = @project.path_for_collection(generated_collection.name, @project.base_lang())
|
100
|
-
@onesky.upload_file(collection_path, @project.one_sky_file_format)
|
100
|
+
@onesky.upload_file(collection_path, @project.one_sky_file_format, prune_missing_strings)
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
data/lib/locca/genstrings.rb
CHANGED
@@ -29,7 +29,7 @@ module Locca
|
|
29
29
|
class Genstrings
|
30
30
|
def generate(code_dir)
|
31
31
|
Dir.mktmpdir do |tmp_dir|
|
32
|
-
command = "find #{code_dir} -iname \"*.m\" -or -iname \"*.mm\" -or -iname \"*.c\" | xargs genstrings -o '#{tmp_dir}'"
|
32
|
+
command = "find #{code_dir} -iname \"*.m\" -or -iname \"*.mm\" -or -iname \"*.c\" -or -iname \"*.swift\" | xargs genstrings -o '#{tmp_dir}'"
|
33
33
|
stdout, stderr, status = Open3.capture3(command)
|
34
34
|
|
35
35
|
stderr = stderr.strip
|
data/lib/locca/sync/onesky.rb
CHANGED
@@ -34,8 +34,8 @@ module Locca
|
|
34
34
|
@secret_key = secret_key
|
35
35
|
end
|
36
36
|
|
37
|
-
def upload_file(file_path, file_format)
|
38
|
-
fetch_response(:post, "files", {'file' => File.new(file_path), 'file_format' => file_format, 'is_keeping_all_strings' =>
|
37
|
+
def upload_file(file_path, file_format, prune_missing_strings = false)
|
38
|
+
fetch_response(:post, "files", {'file' => File.new(file_path), 'file_format' => file_format, 'is_keeping_all_strings' => !prune_missing_strings})
|
39
39
|
end
|
40
40
|
|
41
41
|
def fetch_translations(lang, file_name)
|
data/lib/locca/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shurakov Evgeny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|