fastlane-plugin-poesie 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522a64de11d89de80904b62e34f3bb822cab0c428e113109efda313d2067ef28
|
4
|
+
data.tar.gz: 0b012087e2270ba93254f83291c73f2c9461e0c5b6c710306c481c89fbad6074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '073924908b39e144b542b310a4b40e2b27bed0bb293adeb3d05ee0b179781a914a36b1474e9b5e40c5847a18534c29776829c8f0feb1aa6d8878eec92cb24d35'
|
7
|
+
data.tar.gz: a2de6fa0f345dbece8548f8f656c715cc2fe5a33effdc0529712c79011d7e563eb0c8421018b5259c1a4f52fb2d43cba8736df395fc88cfe000e0fd328071378
|
@@ -9,9 +9,17 @@ module Fastlane
|
|
9
9
|
if languages.nil?
|
10
10
|
languages = Helper::PoesieHelper.list_of_languages(params[:api_token], params[:project_id])
|
11
11
|
end
|
12
|
+
|
13
|
+
paths = Helper::PoesieHelper.path_for_localized_file(languages, params[:strings_file_name])
|
14
|
+
|
15
|
+
if paths.count != languages.count
|
16
|
+
::Poesie.exit_with_error("Error while finding localized files.\nSearching for languages: #{languages}\nFound: #{paths.keys
|
17
|
+
}}")
|
18
|
+
end
|
19
|
+
|
12
20
|
languages.each do |language|
|
13
21
|
::Poesie::Log::title("== Language #{language} ==")
|
14
|
-
string_path =
|
22
|
+
string_path = paths[language]
|
15
23
|
exporter.run(language) do |terms|
|
16
24
|
# Localizable.strings
|
17
25
|
::Poesie::AppleFormatter::write_strings_file(
|
@@ -58,10 +66,10 @@ module Fastlane
|
|
58
66
|
description: "The languages to export",
|
59
67
|
optional: true,
|
60
68
|
type: Array),
|
61
|
-
FastlaneCore::ConfigItem.new(key: :
|
62
|
-
env_name: "
|
63
|
-
description: "
|
64
|
-
optional:
|
69
|
+
FastlaneCore::ConfigItem.new(key: :strings_file_name,
|
70
|
+
env_name: "PROJECT_STRING_FILE_NAME",
|
71
|
+
description: "Name of a localized .strings file. Default is Localizable.strings",
|
72
|
+
optional: true,
|
65
73
|
type: String)
|
66
74
|
]
|
67
75
|
end
|
@@ -20,8 +20,26 @@ module Fastlane
|
|
20
20
|
json["result"]["languages"].map { |lan| lan["code"] }
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
|
23
|
+
def self.path_for_localized_file(languages, filename = nil)
|
24
|
+
require 'find'
|
25
|
+
|
26
|
+
if filename.nil?
|
27
|
+
filename = "Localizable.strings"
|
28
|
+
end
|
29
|
+
paths = {}
|
30
|
+
Find.find(Dir.pwd) do |path|
|
31
|
+
if FileTest.file?(path) && File.basename(path) == filename
|
32
|
+
languages.each { |lang|
|
33
|
+
if File.basename(File.dirname(path)) == "#{lang}.lproj"
|
34
|
+
paths[lang] = path
|
35
|
+
end
|
36
|
+
}
|
37
|
+
Find.prune
|
38
|
+
else
|
39
|
+
next
|
40
|
+
end
|
41
|
+
end
|
42
|
+
paths
|
25
43
|
end
|
26
44
|
end
|
27
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-poesie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Potoček
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: poesie
|