babelish 0.5.6 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/babelish/csv2android.rb +2 -1
- data/lib/babelish/version.rb +1 -1
- data/test/babelish/commands/test_command_csv2android.rb +15 -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: c9709d366bbd01ef995912d9aaf6d13a06ba75d19f029ce1c79f37a7dec0ceb6
|
4
|
+
data.tar.gz: 3bafcb6946230ab029073b559347b13ad834cff2d53666a31681e4dad5b64496
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47046a32499286a83df69f7adb3d220b565e347343ce69edad1285cb275f527b22406ae4fb78c5670451c4a608359814ad0618cdbfa86f80e6c4c0547256eb38
|
7
|
+
data.tar.gz: c80caaa09dd010f95c9562cf9eff090ee64d5f8d1fd1b2123982ec84a716c1def4d04afe0c20aea60dd1f9119bfaebd1d806a22500e79c01faae4372133020e4
|
data/lib/babelish/csv2android.rb
CHANGED
@@ -13,7 +13,8 @@ module Babelish
|
|
13
13
|
require 'pathname'
|
14
14
|
output_name = "strings.xml"
|
15
15
|
output_name = "#{@output_basename}.xml" unless @output_basename.empty?
|
16
|
-
|
16
|
+
region = language.region.to_s.empty? ? "" : "-r#{language.region}"
|
17
|
+
filepath = Pathname.new(@file_path) + "values-#{language.code}#{region}" + output_name
|
17
18
|
return filepath ? [filepath] : []
|
18
19
|
end
|
19
20
|
|
data/lib/babelish/version.rb
CHANGED
@@ -16,6 +16,21 @@ class TestCSV2AndroidCommand < Test::Unit::TestCase
|
|
16
16
|
system("rm -rf ./values-fr/")
|
17
17
|
end
|
18
18
|
|
19
|
+
def test_csv2android_with_multiple_2_languages_with_region
|
20
|
+
options = {
|
21
|
+
:filename => "test/data/test_data_multiple_langs.csv",
|
22
|
+
:langs => {"English" => "en-US", "French" => "fr"}
|
23
|
+
}
|
24
|
+
Commandline.new([], options).csv2android
|
25
|
+
|
26
|
+
assert File.exist?("./values-en-rUS/strings.xml")
|
27
|
+
assert File.exist?("./values-fr/strings.xml")
|
28
|
+
|
29
|
+
# clean up
|
30
|
+
system("rm -rf ./values-en-rUS/")
|
31
|
+
system("rm -rf ./values-fr/")
|
32
|
+
end
|
33
|
+
|
19
34
|
def test_csv2android_with_output_dir
|
20
35
|
options = {
|
21
36
|
:filename => "test/data/test_data_multiple_langs.csv",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babelish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- François Benaiteau
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|