air18n 0.1.48 → 0.1.49
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
# Automatic conversion of one locale to another where it is possible, like
|
2
4
|
# American to British English.
|
3
5
|
module Air18n
|
@@ -10,7 +12,9 @@ module Air18n
|
|
10
12
|
:"en-CA" => AmericanToCanadian.new,
|
11
13
|
:"en-GB" => AmericanToBritish.new,
|
12
14
|
:"en-NZ" => AmericanToKiwi.new,
|
13
|
-
}
|
15
|
+
},
|
16
|
+
:de => { :"de-CH" => GermanToSwissGerman.new }
|
17
|
+
}
|
14
18
|
end
|
15
19
|
|
16
20
|
# Given a text in orig_locale, tries to guess a translation into
|
@@ -140,4 +144,11 @@ module Air18n
|
|
140
144
|
@variants["bathroom's"] = "washroom's"
|
141
145
|
end
|
142
146
|
end
|
147
|
+
|
148
|
+
# Swiss German replaces "ß" with "ss".
|
149
|
+
class GermanToSwissGerman
|
150
|
+
def convert(text)
|
151
|
+
text.gsub('ß', 'ss').gsub('ẞ', 'SS')
|
152
|
+
end
|
153
|
+
end
|
143
154
|
end
|
data/lib/air18n/version.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
require 'air18n/mock_priority'
|
@@ -217,6 +219,12 @@ describe Air18n::Backend do
|
|
217
219
|
@backend.lookup(:en, 'british english, key 1', @scope, :default => 'canceled neighborhood')
|
218
220
|
@backend.lookup(:"en-GB", 'british english, key 1', @scope, :default => 'value 1').should == 'cancelled neighbourhood'
|
219
221
|
end
|
222
|
+
|
223
|
+
it 'should produce Swiss German' do
|
224
|
+
@backend.lookup(:en, 'Swiss German, key 1', @scope, :default => 'the majority')
|
225
|
+
@backend.store_translations(:de, { 'Swiss German, key 1' => 'den größten Teil' })
|
226
|
+
@backend.lookup(:"de-CH", 'Swiss German, key 1', @scope, :default => 'value 1').should == 'den grössten Teil'
|
227
|
+
end
|
220
228
|
end
|
221
229
|
|
222
230
|
context 'Smart counting' do
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Air18n::PrimAndProper do
|
@@ -68,4 +70,13 @@ describe Air18n::PrimAndProper do
|
|
68
70
|
"vacation apartment elevator couch coupon cell Hi washroom neighbourhood's"
|
69
71
|
end
|
70
72
|
end
|
73
|
+
|
74
|
+
describe Air18n::GermanToSwissGerman do
|
75
|
+
it "should convert sharp s" do
|
76
|
+
@airpnp.guess(
|
77
|
+
"beheimatet den größten Teil des Boulevard La Rambla",
|
78
|
+
:de, :"de-CH").should ==
|
79
|
+
"beheimatet den grössten Teil des Boulevard La Rambla"
|
80
|
+
end
|
81
|
+
end
|
71
82
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: air18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.49
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-01-
|
16
|
+
date: 2013-01-04 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: i18n
|