babelish 0.5.6 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0c50bdc07265dcc37a15d445529ec631c08b9013433740d719dea55ea275c2b
4
- data.tar.gz: c7a1b60e9b5753e49883c82046d7897368250ee5b588be1f25751b25d2c73414
3
+ metadata.gz: c9709d366bbd01ef995912d9aaf6d13a06ba75d19f029ce1c79f37a7dec0ceb6
4
+ data.tar.gz: 3bafcb6946230ab029073b559347b13ad834cff2d53666a31681e4dad5b64496
5
5
  SHA512:
6
- metadata.gz: 8aae420d78d9f9cb11433ef203820cdaa39b1ab1b5a809bd8884b664b2136c333091a388ce4bde3e4af91de89b3d4ce985436ea6b39e81656596898c8b5563fb
7
- data.tar.gz: 5a9ceeef88575b111ce1c7b272d18e35c6b1456f6685f161951dc2c391eb6a35cdd6d49700aa028af3b8a2c344d6bfd84d0a0741d5045db859e7f285c147ff3e
6
+ metadata.gz: 47046a32499286a83df69f7adb3d220b565e347343ce69edad1285cb275f527b22406ae4fb78c5670451c4a608359814ad0618cdbfa86f80e6c4c0547256eb38
7
+ data.tar.gz: c80caaa09dd010f95c9562cf9eff090ee64d5f8d1fd1b2123982ec84a716c1def4d04afe0c20aea60dd1f9119bfaebd1d806a22500e79c01faae4372133020e4
@@ -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
- filepath = Pathname.new(@file_path) + "values-#{language.code}" + output_name
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
 
@@ -1,3 +1,3 @@
1
1
  module Babelish
2
- VERSION = "0.5.6"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -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.5.6
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-08-07 00:00:00.000000000 Z
12
+ date: 2019-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor