qualiac_twine 0.0.5 → 0.0.6
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: 5bbde77aade42c6cdf725a65d5d7347562e20418ac739718aba0e766478bb1a9
|
4
|
+
data.tar.gz: dd93439e52f11c63b74c26da6eb9d0a8a8806f8d853c57918092c20fb83fbb82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35093a77975d842c989fba7a34d234257ce6923e09c0987a8502ded925ac658936f45d27ee51c5db3cc1ee08999ea732b4012c3b391de636b150b0859723299e
|
7
|
+
data.tar.gz: 75eb571e9b9dcd3afe881fbc3987b1d8472e9d483dd675952c08aba5594e00576c61da2d4d2eb0eb330eb531a40bbafe4c4768c1255961c90a91f7fa49a4e270
|
@@ -41,7 +41,7 @@ module Twine
|
|
41
41
|
result += super + "\n"
|
42
42
|
|
43
43
|
result += "}\n"
|
44
|
-
result += "// swiftlint:enable identifier_name line_length superfluous_disable_command
|
44
|
+
result += "// swiftlint:enable identifier_name line_length superfluous_disable_command"
|
45
45
|
end
|
46
46
|
|
47
47
|
def format_section_header(section)
|
@@ -61,4 +61,4 @@ module Twine
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
-
end
|
64
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Twine
|
2
|
+
module Formatters
|
3
|
+
class QKRStringSwiftKernel < Abstract
|
4
|
+
def format_name
|
5
|
+
'qkr_string_swift_kernel'
|
6
|
+
end
|
7
|
+
|
8
|
+
def extension
|
9
|
+
'.swift'
|
10
|
+
end
|
11
|
+
|
12
|
+
def can_handle_directory?(path)
|
13
|
+
true
|
14
|
+
end
|
15
|
+
|
16
|
+
def default_file_name
|
17
|
+
'QKRString+QualiacKernel.swift'
|
18
|
+
end
|
19
|
+
|
20
|
+
def determine_language_given_path(path)
|
21
|
+
return @twine_file.language_codes[0]
|
22
|
+
end
|
23
|
+
|
24
|
+
def output_path_for_language(lang)
|
25
|
+
""
|
26
|
+
end
|
27
|
+
|
28
|
+
def read(io, lang)
|
29
|
+
end
|
30
|
+
|
31
|
+
def format_header(lang)
|
32
|
+
"/**\n * Apple Strings File\n * Generated by Twine #{Twine::VERSION}\n */"
|
33
|
+
end
|
34
|
+
|
35
|
+
def format_sections(twine_file, lang)
|
36
|
+
result = "import Foundation\n"
|
37
|
+
result += "// swiftlint:disable identifier_name line_length superfluous_disable_command\n"
|
38
|
+
result += "extension QKRString {\n"
|
39
|
+
|
40
|
+
result += super + "\n"
|
41
|
+
|
42
|
+
result += "}\n"
|
43
|
+
result += "// swiftlint:enable identifier_name line_length superfluous_disable_command"
|
44
|
+
end
|
45
|
+
|
46
|
+
def format_section_header(section)
|
47
|
+
"\t/********** #{section.name} **********/\n"
|
48
|
+
end
|
49
|
+
|
50
|
+
def key_value_pattern
|
51
|
+
"\tvar %{key}: String { return load(\"%{key}\", in: Bundle.main, table: \"Localizable\") }\n"
|
52
|
+
end
|
53
|
+
|
54
|
+
def format_key(key)
|
55
|
+
escape_quotes(key)
|
56
|
+
end
|
57
|
+
|
58
|
+
def format_value(value)
|
59
|
+
escape_quotes(value)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -2,5 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'twine'
|
3
3
|
|
4
4
|
require_relative 'formatter/qkr_string_swift'
|
5
|
+
require_relative 'formatter/qkr_string_swift_kernel'
|
5
6
|
|
6
|
-
Twine::Formatters.register_formatter Twine::Formatters::QKRStringSwift
|
7
|
+
Twine::Formatters.register_formatter Twine::Formatters::QKRStringSwift
|
8
|
+
Twine::Formatters.register_formatter Twine::Formatters::QKRStringSwiftKernel
|
data/qualiac_twine.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qualiac_twine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien DANGLARD
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- README.md
|
35
35
|
- lib/qualiac_twine.rb
|
36
36
|
- lib/qualiac_twine/formatter/qkr_string_swift.rb
|
37
|
+
- lib/qualiac_twine/formatter/qkr_string_swift_kernel.rb
|
37
38
|
- lib/qualiac_twine/qualiac_twine.rb
|
38
39
|
- qualiac_twine.gemspec
|
39
40
|
homepage: http://rubygems.org/gems/qualiac_twine
|