twine 1.1 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/twine/formatters/android.rb +1 -0
- data/lib/twine/version.rb +1 -1
- data/test/test_formatters.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f4d5f35555d309af477e468d170c086657eafb79659040f23d9a3803c0b59f2
|
4
|
+
data.tar.gz: 6d6858513e345694beb1c031b5a1753a45d31e1038023794a7315b7953df90bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae57c2695b90b0c641b10c54f851543870bf4d2025197c634a5ad7bb0405befa7c29b2b5dff0430e5d6015e8346c202e036298032fb4d2b65fd95d267a797e16
|
7
|
+
data.tar.gz: a71413208993949abca200308296790e8f3a163430b7aa1d8381f2961437e2049480086521835f2c8920b5eb95a03cfc1736063d81f1bd6df570da9472231679
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Continuous Integration by CircleCI](https://circleci.com/gh/scelis/twine.svg?style=shield)](https://circleci.com/gh/scelis/twine)
|
4
4
|
|
5
|
-
Twine is a command line tool for managing your strings and their translations. These are all stored in a
|
5
|
+
Twine is a command line tool for managing your strings and their translations. These are all stored in a single text file and then Twine uses this file to import and export localization files in a variety of types, including iOS and Mac OS X `.strings` files, Android `.xml` files, gettext `.po` files, and [jquery-localize][jquerylocalize] `.json` files. This allows individuals and companies to easily share translations across multiple projects, as well as export localization files in any format the user wants.
|
6
6
|
|
7
7
|
## Install
|
8
8
|
|
@@ -212,7 +212,7 @@ apply plugin: 'com.github.jruby-gradle.base'
|
|
212
212
|
|
213
213
|
dependencies {
|
214
214
|
/* NOTE: Set your prefered version of twine here. */
|
215
|
-
jrubyExec 'rubygems:twine:1.
|
215
|
+
jrubyExec 'rubygems:twine:1.1'
|
216
216
|
}
|
217
217
|
|
218
218
|
task generateLocalizations (type: JRubyExec) {
|
@@ -65,6 +65,7 @@ module Twine
|
|
65
65
|
document.root.children.each do |child|
|
66
66
|
if child.is_a? REXML::Comment
|
67
67
|
content = child.string.strip
|
68
|
+
content.gsub!(/[\s]+/, ' ')
|
68
69
|
comment = content if content.length > 0 and not content.start_with?("SECTION:")
|
69
70
|
elsif child.is_a? REXML::Element
|
70
71
|
next unless child.name == 'string'
|
data/lib/twine/version.rb
CHANGED
data/test/test_formatters.rb
CHANGED
@@ -167,6 +167,24 @@ class TestAndroidFormatter < FormatterTest
|
|
167
167
|
assert_equal 'This is\n a string', @empty_twine_file.definitions_by_key["foo"].translations['en']
|
168
168
|
end
|
169
169
|
|
170
|
+
def test_read_multiline_comment
|
171
|
+
content = <<-EOCONTENT
|
172
|
+
<?xml version="1.0" encoding="utf-8"?>
|
173
|
+
<resources>
|
174
|
+
<!-- multiline
|
175
|
+
comment -->
|
176
|
+
<string name="foo">This is
|
177
|
+
a string</string>
|
178
|
+
</resources>
|
179
|
+
EOCONTENT
|
180
|
+
|
181
|
+
io = StringIO.new(content)
|
182
|
+
|
183
|
+
@formatter.read io, 'en'
|
184
|
+
|
185
|
+
assert_equal 'multiline comment', @empty_twine_file.definitions_by_key["foo"].comment
|
186
|
+
end
|
187
|
+
|
170
188
|
def test_read_html_tags
|
171
189
|
content = <<-EOCONTENT
|
172
190
|
<?xml version="1.0" encoding="utf-8"?>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|