bisu 1.3.0 → 1.3.1
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 +4 -4
- data/lib/bisu/dictionary.rb +9 -17
- data/lib/bisu/google_sheet.rb +6 -6
- data/lib/bisu/localizer.rb +2 -2
- data/lib/bisu/version.rb +2 -2
- data/lib/bisu.rb +1 -1
- data/spec/fixtures/sample_kb_public_sheet.html +1 -1
- data/spec/lib/bisu/dictionary_spec.rb +16 -17
- data/spec/lib/bisu/google_sheet_spec.rb +17 -10
- data/spec/lib/bisu/localizer_spec.rb +24 -19
- data/spec/lib/bisu_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae037a0d6145c6c2517b9ada533931cce6fbb028
|
4
|
+
data.tar.gz: bb08d97f16d8a1fe65a8eced03d785961e7369d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf229024552eb4081d51aeaeffcb014c2f2787e8592eb166a5d2aa04fc980fa9789c605b4f796c1be68d6a56b5763a2b9662b8480c2ac472dd3e66fe3135254
|
7
|
+
data.tar.gz: 3b2fdc69cade70b5a7d6d14e615dd129e8296adb2ab57b7ba82ca57fd17d9e0cf858391f84af839694b9cbed354284cdd5c7a8c29782d5c0ce7fd1f2e166646d
|
data/lib/bisu/dictionary.rb
CHANGED
@@ -2,17 +2,17 @@ module Bisu
|
|
2
2
|
class Dictionary
|
3
3
|
def initialize(keys)
|
4
4
|
unless keys.is_a?(Hash)
|
5
|
-
raise ArgumentError.new("keys: expected Hash")
|
5
|
+
raise ArgumentError.new("keys: expected Hash, got #{keys.class}")
|
6
6
|
end
|
7
7
|
|
8
|
-
keys.each do |
|
8
|
+
keys.each do |lang,v|
|
9
9
|
unless v.is_a?(Hash)
|
10
|
-
raise ArgumentError.new("keys['#{
|
10
|
+
raise ArgumentError.new("keys['#{lang}']: expected Hash, got #{v.class}")
|
11
11
|
end
|
12
12
|
|
13
|
-
v.each do |
|
13
|
+
v.each do |key,v|
|
14
14
|
unless v.is_a?(String) || v.nil?
|
15
|
-
raise ArgumentError.new("keys['#{
|
15
|
+
raise ArgumentError.new("keys['#{lang}']['#{key}']: expected String, got #{v.class}")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -21,23 +21,15 @@ module Bisu
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def has_language?(language)
|
24
|
-
|
24
|
+
@keys.include?(language)
|
25
25
|
end
|
26
26
|
|
27
|
-
def localize(
|
28
|
-
if
|
29
|
-
|
27
|
+
def localize(language, key)
|
28
|
+
if has_language?(language)
|
29
|
+
@keys[language][key]
|
30
30
|
else
|
31
31
|
nil
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def languages
|
38
|
-
@languages ||= begin
|
39
|
-
@keys.map { |_,v| v.keys }.flatten.uniq
|
40
|
-
end
|
41
|
-
end
|
42
34
|
end
|
43
35
|
end
|
data/lib/bisu/google_sheet.rb
CHANGED
@@ -8,23 +8,23 @@ module Bisu
|
|
8
8
|
@key_column = keys_column_title
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def to_i18
|
12
12
|
raw = raw_data(@sheet_id)
|
13
13
|
|
14
14
|
Logger.info("Parsing Google Sheet...")
|
15
15
|
|
16
|
-
|
16
|
+
non_language_columns = ["id", "updated", "category", "title", "content", "link", @key_column]
|
17
17
|
|
18
18
|
kb = {}
|
19
19
|
raw["entry"].each do |entry|
|
20
|
-
hash = entry.select { |d| !remove.include?(d) }
|
21
|
-
hash = hash.each.map { |k, v| v.first == {} ? [k, nil] : [k, v.first] }
|
22
|
-
|
23
20
|
unless (key = entry[@key_column]) && key = key.first
|
24
21
|
raise "Cannot find key column '#{@key_column}'"
|
25
22
|
end
|
26
23
|
|
27
|
-
|
24
|
+
entry.select { |c| !non_language_columns.include?(c) }.each do |lang, texts|
|
25
|
+
kb[lang] ||= {}
|
26
|
+
kb[lang][key] = texts.first unless texts.first == {}
|
27
|
+
end
|
28
28
|
end
|
29
29
|
|
30
30
|
Logger.info("Google Sheet parsed successfully!")
|
data/lib/bisu/localizer.rb
CHANGED
@@ -10,7 +10,7 @@ module Bisu
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
def localize(text, language, locale,
|
13
|
+
def localize(text, language, locale, fallback_language=nil)
|
14
14
|
t = text
|
15
15
|
t = t.gsub("$specialKLanguage$", language)
|
16
16
|
t = t.gsub("$specialKLocale$", locale)
|
@@ -18,7 +18,7 @@ module Bisu
|
|
18
18
|
t = t.gsub("$specialKComment2$", "Remember to CHANGE THE TEMPLATE and not this file!")
|
19
19
|
|
20
20
|
to_localize(t).map do |l|
|
21
|
-
if localized = @dict.localize(l[:key]
|
21
|
+
if localized = @dict.localize(language, l[:key]) || @dict.localize(fallback_language, l[:key])
|
22
22
|
l[:params].each do |param, value|
|
23
23
|
if localized.match("%{#{param}}")
|
24
24
|
localized = localized.gsub("%{#{param}}", value)
|
data/lib/bisu/version.rb
CHANGED
data/lib/bisu.rb
CHANGED
@@ -18,7 +18,7 @@ module Bisu
|
|
18
18
|
if config_file = open_file("translatable.yml", "r", true)
|
19
19
|
config = Bisu::Config.new(hash: YAML::load(config_file))
|
20
20
|
google_sheet = Bisu::GoogleSheet.new(config.dictionary[:sheet_id], config.dictionary[:keys_column])
|
21
|
-
dictionary = Bisu::Dictionary.new(google_sheet.
|
21
|
+
dictionary = Bisu::Dictionary.new(google_sheet.to_i18)
|
22
22
|
localizer = Bisu::Localizer.new(dictionary, config.type)
|
23
23
|
|
24
24
|
config.localize_files do |in_path, out_path, language, locale|
|
@@ -1 +1 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full</id><updated>2015-02-09T18:59:53.874Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>Translations</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/spreadsheets/d/abc1234567890/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><author><name>anthony.douglas</name><email>anthony.douglas@hole19golf.com</email></author><openSearch:totalResults>664</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr</id><updated>2015-02-09T18:59:53.874Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>kConnectFacebook</title><content type='text'>english: Connect with Facebook, german: Mit Facebook verbinden, portuguese: Registar com Facebook, spanish: Conéctate con Facebook, french: Connecter Facebook, dutch: Facebook Verbinden, korean: 페이스북으로 접속, japanese: フェイスブックへ接続, key_column_2: kConnectFacebook</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr'/><gsx:key_column>kConnectFacebook</gsx:key_column><gsx:english>Connect with Facebook</gsx:english><gsx:german>Mit Facebook verbinden</gsx:german><gsx:portuguese>Registar com Facebook</gsx:portuguese><gsx:spanish>Conéctate con Facebook</gsx:spanish><gsx:french>Connecter Facebook</gsx:french><gsx:dutch>Facebook Verbinden</gsx:dutch><gsx:korean>페이스북으로 접속</gsx:korean><gsx:japanese>フェイスブックへ接続</gsx:japanese
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gsx='http://schemas.google.com/spreadsheets/2006/extended'><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full</id><updated>2015-02-09T18:59:53.874Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>Translations</title><link rel='alternate' type='application/atom+xml' href='https://docs.google.com/spreadsheets/d/abc1234567890/pubhtml'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='http://schemas.google.com/g/2005#post' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full'/><author><name>anthony.douglas</name><email>anthony.douglas@hole19golf.com</email></author><openSearch:totalResults>664</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr</id><updated>2015-02-09T18:59:53.874Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>kConnectFacebook</title><content type='text'>english: Connect with Facebook, german: Mit Facebook verbinden, portuguese: Registar com Facebook, spanish: Conéctate con Facebook, french: Connecter Facebook, dutch: Facebook Verbinden, korean: 페이스북으로 접속, japanese: フェイスブックへ接続, key_column_2: kConnectFacebook</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cokwr'/><gsx:key_column>kConnectFacebook</gsx:key_column><gsx:english>Connect with Facebook</gsx:english><gsx:german>Mit Facebook verbinden</gsx:german><gsx:portuguese>Registar com Facebook</gsx:portuguese><gsx:spanish>Conéctate con Facebook</gsx:spanish><gsx:french>Connecter Facebook</gsx:french><gsx:dutch>Facebook Verbinden</gsx:dutch><gsx:korean>페이스북으로 접속</gsx:korean><gsx:japanese>フェイスブックへ接続</gsx:japanese></entry><entry><id>https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cpzh4</id><updated>2015-02-09T18:59:53.874Z</updated><category scheme='http://schemas.google.com/spreadsheets/2006' term='http://schemas.google.com/spreadsheets/2006#list'/><title type='text'>kConnectEmail</title><content type='text'>english: Connect with Email, german: Mit E-Mail verbinden, portuguese: Registar com Email, spanish: Conéctate con Email, dutch: Email Verbinden, korean: 이메일로 접속, japanese: 電子メールアカウントに接続, key_column_2: kConnectEmail</content><link rel='self' type='application/atom+xml' href='https://spreadsheets.google.com/feeds/list/abc1234567890/od6/public/full/cpzh4'/><gsx:key_column>kConnectEmail</gsx:key_column><gsx:english>Connect with Email</gsx:english><gsx:german>Mit E-Mail verbinden</gsx:german><gsx:portuguese>Registar com Email</gsx:portuguese><gsx:spanish>Conéctate con Email</gsx:spanish><gsx:french></gsx:french><gsx:dutch>Email Verbinden</gsx:dutch><gsx:korean>이메일로 접속</gsx:korean><gsx:japanese>電子メールアカウントに接続</gsx:japanese></entry></feed>
|
@@ -2,34 +2,35 @@ describe Bisu::Dictionary do
|
|
2
2
|
subject(:dict) { Bisu::Dictionary.new(keys) }
|
3
3
|
|
4
4
|
describe ".initialize" do
|
5
|
-
let(:keys) { { "
|
5
|
+
let(:keys) { { "lang" => { "kNo1" => "text" } } }
|
6
6
|
it { expect { subject }.not_to raise_error }
|
7
7
|
|
8
8
|
context "when created with invalid type parameters" do
|
9
9
|
let(:keys) { "cenas" }
|
10
|
-
it { expect { subject }.to raise_error /expected Hash
|
10
|
+
it { expect { subject }.to raise_error /expected Hash/ }
|
11
11
|
end
|
12
12
|
|
13
13
|
context "when created with an invalid json schema" do
|
14
|
-
let(:keys) { { "
|
15
|
-
it { expect { subject }.to raise_error /
|
14
|
+
let(:keys) { { "lang" => "text" } }
|
15
|
+
it { expect { subject }.to raise_error /lang.+expected Hash/ }
|
16
16
|
end
|
17
17
|
|
18
18
|
context "when created with an invalid json schema" do
|
19
|
-
let(:keys) { { "
|
20
|
-
it { expect { subject }.to raise_error /
|
19
|
+
let(:keys) { { "a-lang" => { "kNo1" => { "wtvr" => "text" } } } }
|
20
|
+
it { expect { subject }.to raise_error /a-lang.+kNo1.+expected String/ }
|
21
21
|
end
|
22
22
|
|
23
23
|
context "when given empty translations" do
|
24
|
-
let(:keys) { { "
|
24
|
+
let(:keys) { { "lang" => { "kNo1" => nil } } }
|
25
25
|
it { expect { subject }.not_to raise_error }
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "#has_language?" do
|
30
30
|
let(:keys) { {
|
31
|
-
"
|
32
|
-
"
|
31
|
+
"lang1" => { "kNo1" => "no1-lang1" },
|
32
|
+
"lang2" => { "kNo1" => "no1-lang2", "kNo2" => "no1-lang2" },
|
33
|
+
"lang3" => { "kNo2" => "no2-lang3" }
|
33
34
|
} }
|
34
35
|
|
35
36
|
it "returns true if that language is translated" do
|
@@ -47,23 +48,21 @@ describe Bisu::Dictionary do
|
|
47
48
|
|
48
49
|
describe "#localize" do
|
49
50
|
let(:keys) { {
|
50
|
-
"kCray" =>
|
51
|
-
|
52
|
-
|
53
|
-
"kriolo" => "Bo sta crazy!"
|
54
|
-
}
|
51
|
+
"english" => { "kCray" => "You are crazy!" },
|
52
|
+
"portuguese" => { "kCray" => "Estás maluco!" },
|
53
|
+
"kriolo" => { "kCray" => "Bo sta crazy!" }
|
55
54
|
} }
|
56
55
|
|
57
56
|
it "localizes a key" do
|
58
|
-
expect(dict.localize("
|
57
|
+
expect(dict.localize("kriolo", "kCray")).to eq "Bo sta crazy!"
|
59
58
|
end
|
60
59
|
|
61
60
|
it "returns nil when the key does not exist" do
|
62
|
-
expect(dict.localize("
|
61
|
+
expect(dict.localize("kriolo", "kDoesntExist")).to be nil
|
63
62
|
end
|
64
63
|
|
65
64
|
it "returns nil when language is not available" do
|
66
|
-
expect(dict.localize("
|
65
|
+
expect(dict.localize("finish", "kCray")).to be nil
|
67
66
|
end
|
68
67
|
end
|
69
68
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
describe Bisu::GoogleSheet do
|
2
|
-
subject(:
|
2
|
+
subject(:to_i18) { Bisu::GoogleSheet.new(sheet_id, key_column).to_i18 }
|
3
3
|
|
4
4
|
let(:sheet_id) { "abc1234567890" }
|
5
5
|
let(:url_info) { "https://spreadsheets.google.com/feeds/worksheets/#{sheet_id}/public/full" }
|
@@ -17,20 +17,27 @@ describe Bisu::GoogleSheet do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it do
|
20
|
-
expect {
|
20
|
+
expect { to_i18 }.not_to raise_error
|
21
21
|
end
|
22
22
|
|
23
|
-
it "returns an hash" do
|
24
|
-
expect(
|
25
|
-
|
26
|
-
|
23
|
+
it "returns an hash in i18 format" do
|
24
|
+
expect(to_i18).to eq({
|
25
|
+
"english" => { "kConnectFacebook" => "Connect with Facebook", "kConnectEmail" => "Connect with Email" },
|
26
|
+
"german" => { "kConnectFacebook" => "Mit Facebook verbinden", "kConnectEmail" => "Mit E-Mail verbinden" },
|
27
|
+
"portuguese" => { "kConnectFacebook" => "Registar com Facebook", "kConnectEmail" => "Registar com Email" },
|
28
|
+
"spanish" => { "kConnectFacebook" => "Conéctate con Facebook", "kConnectEmail" => "Conéctate con Email" },
|
29
|
+
"french" => { "kConnectFacebook" => "Connecter Facebook" },
|
30
|
+
"dutch" => { "kConnectFacebook" => "Facebook Verbinden", "kConnectEmail" => "Email Verbinden" },
|
31
|
+
"korean" => { "kConnectFacebook" => "페이스북으로 접속", "kConnectEmail" => "이메일로 접속" },
|
32
|
+
"japanese" => { "kConnectFacebook" => "フェイスブックへ接続", "kConnectEmail" => "電子メールアカウントに接続" }
|
33
|
+
})
|
27
34
|
end
|
28
35
|
|
29
36
|
context "but the key column is not present in the first sheet" do
|
30
37
|
let(:key_column) { "expecting_another_key_column" }
|
31
38
|
|
32
39
|
it do
|
33
|
-
expect {
|
40
|
+
expect { to_i18 }.to raise_error /Cannot find key column/
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
@@ -39,7 +46,7 @@ describe Bisu::GoogleSheet do
|
|
39
46
|
before { stub_request(:get, url_info).to_return(:status => 400, :body => "Not Found", :headers => {}) }
|
40
47
|
|
41
48
|
it do
|
42
|
-
expect {
|
49
|
+
expect { to_i18 }.to raise_error /Cannot access sheet/
|
43
50
|
end
|
44
51
|
end
|
45
52
|
|
@@ -47,7 +54,7 @@ describe Bisu::GoogleSheet do
|
|
47
54
|
before { stub_request(:get, url_info).to_return(:status => 302, :body => "<HTML></HTML>", :headers => {}) }
|
48
55
|
|
49
56
|
it do
|
50
|
-
expect {
|
57
|
+
expect { to_i18 }.to raise_error /Cannot access sheet/
|
51
58
|
end
|
52
59
|
end
|
53
60
|
|
@@ -55,7 +62,7 @@ describe Bisu::GoogleSheet do
|
|
55
62
|
before { stub_request(:get, url_info).to_return(:status => 200, :body => "This is not XML; { this: \"is json\" }", :headers => {}) }
|
56
63
|
|
57
64
|
it do
|
58
|
-
expect {
|
65
|
+
expect { to_i18 }.to raise_error /Cannot parse. Expected XML/
|
59
66
|
end
|
60
67
|
end
|
61
68
|
end
|
@@ -3,18 +3,22 @@ describe Bisu::Localizer do
|
|
3
3
|
let(:locale) { "PT-PT" }
|
4
4
|
|
5
5
|
let(:keys) { {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
language => {
|
7
|
+
"kTranslationKey" => "Não sabes nada João das Neves",
|
8
|
+
"kTranslationKey2" => "Naaada!",
|
9
|
+
"k1ParameterKey" => "Não sabes nada %{name}",
|
10
|
+
"k2ParametersKey" => "Sabes %{perc} por cento %{name}",
|
11
|
+
|
12
|
+
# type dependent translations
|
13
|
+
"kDoubleQuoted" => "Não sabes nada \"João das Neves\"",
|
14
|
+
"kSingleQuoted" => "Não sabes nada 'João das Neves'",
|
15
|
+
"kEllipsis" => "Não sabes nada João das Neves...",
|
16
|
+
"kAmpersand" => "Não sabes nada João das Neves & Pícaros",
|
17
|
+
"kAtSign" => "\@johnsnow sabes alguma coisa?"
|
18
|
+
},
|
19
|
+
"english" => {
|
20
|
+
"kMissingTransKey" => "You know little John Snow"
|
21
|
+
}
|
18
22
|
} }
|
19
23
|
|
20
24
|
let(:kb) { Bisu::Dictionary.new(keys) }
|
@@ -23,8 +27,8 @@ describe Bisu::Localizer do
|
|
23
27
|
shared_examples_for "a localizer" do
|
24
28
|
it { expect { localizer }.not_to raise_error }
|
25
29
|
|
26
|
-
def translates(text, to:)
|
27
|
-
translation = localizer.localize(text, language, locale)
|
30
|
+
def translates(text, fallback: nil, to:)
|
31
|
+
translation = localizer.localize(text, language, locale, fallback)
|
28
32
|
expect(translation).to eq to
|
29
33
|
end
|
30
34
|
|
@@ -38,6 +42,7 @@ describe Bisu::Localizer do
|
|
38
42
|
it { translates("this key: $kTranslationKey$", to: "this key: Não sabes nada João das Neves") }
|
39
43
|
it { translates("this unknown key: $kUnknownKey$", to: "this unknown key: $kUnknownKey$") }
|
40
44
|
it { translates("this key with missing translations: $kMissingTransKey$", to: "this key with missing translations: $kMissingTransKey$") }
|
45
|
+
it { translates("this key with missing translations: $kMissingTransKey$", fallback: "english", to: "this key with missing translations: You know little John Snow") }
|
41
46
|
it { translates("these 2 keys: $kTranslationKey$, $kTranslationKey2$", to: "these 2 keys: Não sabes nada João das Neves, Naaada!") }
|
42
47
|
|
43
48
|
it { translates("1 parameter: $k1ParameterKey$", to: "1 parameter: Não sabes nada %{name}") }
|
@@ -100,11 +105,11 @@ describe Bisu::Localizer do
|
|
100
105
|
end
|
101
106
|
|
102
107
|
let(:type_dependent_defaults) { {
|
103
|
-
double_quoted: keys["kDoubleQuoted"]
|
104
|
-
single_quoted: keys["kSingleQuoted"]
|
105
|
-
ellipsis: keys["kEllipsis"]
|
106
|
-
ampersand: keys["kAmpersand"]
|
107
|
-
at_sign: keys["kAtSign"]
|
108
|
+
double_quoted: keys[language]["kDoubleQuoted"],
|
109
|
+
single_quoted: keys[language]["kSingleQuoted"],
|
110
|
+
ellipsis: keys[language]["kEllipsis"],
|
111
|
+
ampersand: keys[language]["kAmpersand"],
|
112
|
+
at_sign: keys[language]["kAtSign"]
|
108
113
|
} }
|
109
114
|
|
110
115
|
describe "of type iOS" do
|
data/spec/lib/bisu_spec.rb
CHANGED
@@ -6,8 +6,8 @@ describe Bisu do
|
|
6
6
|
|
7
7
|
before do
|
8
8
|
allow(Bisu).to receive(:open_file).and_return(file)
|
9
|
-
allow_any_instance_of(Bisu::GoogleSheet).to receive(:
|
10
|
-
"
|
9
|
+
allow_any_instance_of(Bisu::GoogleSheet).to receive(:to_i18).and_return({
|
10
|
+
"english" => { "kKey" => "Value" }
|
11
11
|
})
|
12
12
|
allow(Bisu).to receive(:localize_file)
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bisu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joaoffcosta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|