fast_gettext 0.6.6 → 0.6.7
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.
- data/Gemfile.lock +1 -1
- data/Readme.md +1 -1
- data/lib/fast_gettext/storage.rb +1 -1
- data/lib/fast_gettext/version.rb +1 -1
- data/spec/aa_unconfigued_spec.rb +2 -2
- data/spec/fast_gettext/mo_file_spec.rb +1 -1
- data/spec/fast_gettext/po_file_spec.rb +1 -1
- data/spec/fast_gettext/storage_spec.rb +12 -1
- data/spec/fast_gettext/translation_repository/base_spec.rb +1 -1
- data/spec/fast_gettext/translation_repository/chain_spec.rb +1 -1
- data/spec/fast_gettext/translation_repository/db_spec.rb +2 -2
- data/spec/fast_gettext/translation_repository/logger_spec.rb +2 -2
- data/spec/fast_gettext/translation_repository/mo_spec.rb +1 -1
- data/spec/fast_gettext/translation_repository/po_spec.rb +1 -1
- data/spec/fast_gettext/translation_repository/yaml_spec.rb +2 -2
- data/spec/fast_gettext/translation_repository_spec.rb +2 -2
- data/spec/fast_gettext/translation_spec.rb +1 -1
- data/spec/fast_gettext/vendor/iconv_spec.rb +1 -1
- data/spec/fast_gettext/vendor/string_spec.rb +1 -1
- data/spec/fast_gettext_spec.rb +1 -1
- metadata +5 -5
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -224,5 +224,5 @@ Mo/Po-file parsing from Masao Mutoh, see vendor/README
|
|
224
224
|
|
225
225
|
[Michael Grosser](http://grosser.it)<br/>
|
226
226
|
michael@grosser.it<br/>
|
227
|
-
|
227
|
+
License: MIT<br/>
|
228
228
|
[](http://travis-ci.org/grosser/fast_gettext)
|
data/lib/fast_gettext/storage.rb
CHANGED
@@ -185,7 +185,7 @@ module FastGettext
|
|
185
185
|
|
186
186
|
#de-de -> de_DE
|
187
187
|
def format_locale(locale)
|
188
|
-
locale.sub(/^([a-zA-Z]{2})[-_]([a-zA-Z]{2})$/){$1.downcase+'_'+$2.upcase}
|
188
|
+
locale.sub(/^([a-zA-Z]{2,3})[-_]([a-zA-Z]{2,3})$/){$1.downcase+'_'+$2.upcase}
|
189
189
|
end
|
190
190
|
|
191
191
|
def update_current_cache
|
data/lib/fast_gettext/version.rb
CHANGED
data/spec/aa_unconfigued_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe 'unconfigured' do
|
4
4
|
it "gives a useful error message when trying to just translate" do
|
@@ -18,4 +18,4 @@ describe 'unconfigured' do
|
|
18
18
|
rescue FastGettext::Storage::NoTextDomainConfigured
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
|
+
require 'fast_gettext/translation_repository/base'
|
2
3
|
|
3
4
|
describe 'Storage' do
|
4
5
|
include FastGettext::Storage
|
@@ -316,6 +317,16 @@ describe 'Storage' do
|
|
316
317
|
end
|
317
318
|
end
|
318
319
|
|
320
|
+
describe :format_locale do
|
321
|
+
it "allows 2-letter locales to be formatted" do
|
322
|
+
format_locale("de-ch").should == "de_CH"
|
323
|
+
end
|
324
|
+
|
325
|
+
it "allows 3-letter locales to be formatted" do
|
326
|
+
format_locale("gsw-ch").should == "gsw_CH"
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
319
330
|
describe FastGettext::Storage::NoTextDomainConfigured do
|
320
331
|
it "shows what to do" do
|
321
332
|
FastGettext::Storage::NoTextDomainConfigured.new.to_s.should =~ /FastGettext\.add_text_domain/
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
require 'active_record'
|
4
4
|
require 'fast_gettext/translation_repository/db'
|
@@ -67,4 +67,4 @@ describe FastGettext::TranslationRepository::Db do
|
|
67
67
|
create_translation 'Axis||||Axis', 'Achse||||Achsen'
|
68
68
|
@rep.plural('Axis','Axis').should == ['Achse','Achsen']
|
69
69
|
end
|
70
|
-
end
|
70
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe 'FastGettext::TranslationRepository::Logger' do
|
4
4
|
before do
|
@@ -37,4 +37,4 @@ describe 'FastGettext::TranslationRepository::Logger' do
|
|
37
37
|
@rep.plural('a','b').should == []
|
38
38
|
end
|
39
39
|
end
|
40
|
-
end
|
40
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe 'FastGettext::TranslationRepository::Yaml' do
|
4
4
|
before do
|
@@ -58,4 +58,4 @@ describe 'FastGettext::TranslationRepository::Yaml' do
|
|
58
58
|
@rep.pluralisation_rule.call(input).should == expected
|
59
59
|
end
|
60
60
|
end
|
61
|
-
end
|
61
|
+
end
|
data/spec/fast_gettext_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_gettext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: michael@grosser.it
|
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
segments:
|
112
112
|
- 0
|
113
|
-
hash:
|
113
|
+
hash: 2481622648606723903
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
116
116
|
requirements:
|
@@ -119,10 +119,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
segments:
|
121
121
|
- 0
|
122
|
-
hash:
|
122
|
+
hash: 2481622648606723903
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.8.
|
125
|
+
rubygems_version: 1.8.24
|
126
126
|
signing_key:
|
127
127
|
specification_version: 3
|
128
128
|
summary: A simple, fast, memory-efficient and threadsafe implementation of GetText
|