fast_gettext 0.5.11 → 0.5.12
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/Readme.md +2 -0
- data/VERSION +1 -1
- data/fast_gettext.gemspec +5 -3
- data/lib/fast_gettext.rb +1 -1
- data/spec/fast_gettext/translation_repository/mo_spec.rb +2 -2
- data/spec/fast_gettext/translation_repository/po_spec.rb +2 -2
- data/spec/fast_gettext_spec.rb +6 -1
- data/spec/locale/gsw_CH/LC_MESSAGES/test.mo +0 -0
- data/spec/locale/gsw_CH/test.po +61 -0
- data/spec/spec_helper.rb +2 -2
- metadata +7 -5
data/Readme.md
CHANGED
|
@@ -177,6 +177,7 @@ Write your own TranslationRepository!
|
|
|
177
177
|
FAQ
|
|
178
178
|
===
|
|
179
179
|
- [Problems with ActiveRecord messages?](http://wiki.github.com/grosser/fast_gettext/activerecord)
|
|
180
|
+
- [Iconv require error in 1.9.2](http://exceptionz.wordpress.com/2010/02/03/how-to-fix-the-iconv-require-error-in-ruby-1-9)
|
|
180
181
|
|
|
181
182
|
|
|
182
183
|
TODO
|
|
@@ -194,6 +195,7 @@ Mo/Po-file parsing from Masao Mutoh, see vendor/README
|
|
|
194
195
|
- [Antonio Terceiro](http://softwarelivre.org/terceiro)
|
|
195
196
|
- [J. Pablo Fernández](http://pupeno.com)
|
|
196
197
|
- Rudolf Gavlas
|
|
198
|
+
- [Ramón Cahenzli](http://www.psy-q.ch)
|
|
197
199
|
|
|
198
200
|
[Michael Grosser](http://grosser.it)<br/>
|
|
199
201
|
michael@grosser.it<br/>
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.12
|
data/fast_gettext.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{fast_gettext}
|
|
8
|
-
s.version = "0.5.
|
|
8
|
+
s.version = "0.5.12"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Michael Grosser"]
|
|
12
|
-
s.date = %q{2011-
|
|
12
|
+
s.date = %q{2011-06-17}
|
|
13
13
|
s.email = %q{michael@grosser.it}
|
|
14
14
|
s.files = [
|
|
15
15
|
"CHANGELOG",
|
|
@@ -77,6 +77,8 @@ Gem::Specification.new do |s|
|
|
|
77
77
|
"spec/locale/en/LC_MESSAGES/test.mo",
|
|
78
78
|
"spec/locale/en/plural_test.po",
|
|
79
79
|
"spec/locale/en/test.po",
|
|
80
|
+
"spec/locale/gsw_CH/LC_MESSAGES/test.mo",
|
|
81
|
+
"spec/locale/gsw_CH/test.po",
|
|
80
82
|
"spec/locale/yaml/de.yml",
|
|
81
83
|
"spec/locale/yaml/en.yml",
|
|
82
84
|
"spec/locale/yaml/notfound.yml",
|
|
@@ -85,7 +87,7 @@ Gem::Specification.new do |s|
|
|
|
85
87
|
]
|
|
86
88
|
s.homepage = %q{http://github.com/grosser/fast_gettext}
|
|
87
89
|
s.require_paths = ["lib"]
|
|
88
|
-
s.rubygems_version = %q{1.
|
|
90
|
+
s.rubygems_version = %q{1.6.2}
|
|
89
91
|
s.summary = %q{A simple, fast, memory-efficient and threadsafe implementation of GetText}
|
|
90
92
|
s.test_files = [
|
|
91
93
|
"examples/db/migration.rb",
|
data/lib/fast_gettext.rb
CHANGED
|
@@ -9,7 +9,7 @@ module FastGettext
|
|
|
9
9
|
extend self
|
|
10
10
|
|
|
11
11
|
VERSION = File.read( File.join(File.dirname(__FILE__), 'fast_gettext', 'VERSION') ).strip
|
|
12
|
-
LOCALE_REX = /^[a-z]{2}$|^[a-z]{2}_[A-Z]{2}$/
|
|
12
|
+
LOCALE_REX = /^[a-z]{2,3}$|^[a-z]{2,3}_[A-Z]{2,3}$/
|
|
13
13
|
NAMESPACE_SEPARATOR = '|'
|
|
14
14
|
|
|
15
15
|
# users should not include FastGettext, since this would contaminate their namespace
|
|
@@ -7,7 +7,7 @@ describe 'FastGettext::TranslationRepository::Mo' do
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "can be built" do
|
|
10
|
-
@rep.available_locales.sort.should == ['de','en']
|
|
10
|
+
@rep.available_locales.sort.should == ['de','en','gsw_CH']
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
it "can translate" do
|
|
@@ -26,4 +26,4 @@ describe 'FastGettext::TranslationRepository::Mo' do
|
|
|
26
26
|
rep['car'].should == 'Test'#just check it is loaded correctly
|
|
27
27
|
rep.pluralisation_rule.call(2).should == 3
|
|
28
28
|
end
|
|
29
|
-
end
|
|
29
|
+
end
|
|
@@ -7,7 +7,7 @@ describe 'FastGettext::TranslationRepository::Po' do
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "can be built" do
|
|
10
|
-
@rep.available_locales.sort.should == ['de','en']
|
|
10
|
+
@rep.available_locales.sort.should == ['de','en','gsw_CH']
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
it "can translate" do
|
|
@@ -50,4 +50,4 @@ describe 'FastGettext::TranslationRepository::Po' do
|
|
|
50
50
|
FastGettext::TranslationRepository.build('test',:path=>File.join('spec','obsolete_locale'),:type=>:po, :ignore_obsolete => true)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
|
-
end
|
|
53
|
+
end
|
data/spec/fast_gettext_spec.rb
CHANGED
|
@@ -37,7 +37,12 @@ describe FastGettext do
|
|
|
37
37
|
IncludeTest.xx.should == 'Auto'
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
it "loads 3-letter locales as well" do
|
|
41
|
+
FastGettext.locale = 'gsw_CH'
|
|
42
|
+
FastGettext._('Car was successfully created.').should == "Z auto isch erfolgriich gspeicharat worda."
|
|
43
|
+
end
|
|
44
|
+
|
|
40
45
|
it "has a VERSION" do
|
|
41
46
|
FastGettext::VERSION.should =~ /^\d+\.\d+\.\d+$/
|
|
42
47
|
end
|
|
43
|
-
end
|
|
48
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
|
+
#
|
|
6
|
+
msgid ""
|
|
7
|
+
msgstr ""
|
|
8
|
+
"Project-Id-Version: version 0.0.1\n"
|
|
9
|
+
"POT-Creation-Date: 2009-02-26 19:50+0100\n"
|
|
10
|
+
"PO-Revision-Date: 2011-06-17 14:09+0100\n"
|
|
11
|
+
"Last-Translator: Ramón Cahenzli <rca@psy-q.ch>\n"
|
|
12
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
13
|
+
"MIME-Version: 1.0\n"
|
|
14
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
16
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
|
17
|
+
|
|
18
|
+
#: app/helpers/translation_helper.rb:3
|
|
19
|
+
msgid "%{relative_time} ago"
|
|
20
|
+
msgstr "vor %{relative_time}"
|
|
21
|
+
|
|
22
|
+
#: app/views/cars/show.html.erb:5
|
|
23
|
+
msgid "Axis"
|
|
24
|
+
msgid_plural "Axis"
|
|
25
|
+
msgstr[0] "Achsa"
|
|
26
|
+
msgstr[1] "Achsana"
|
|
27
|
+
|
|
28
|
+
#: app/controllers/cars_controller.rb:47
|
|
29
|
+
msgid "Car was successfully created."
|
|
30
|
+
msgstr "Z auto isch erfolgriich gspeicharat worda."
|
|
31
|
+
|
|
32
|
+
#: app/controllers/cars_controller.rb:64
|
|
33
|
+
msgid "Car was successfully updated."
|
|
34
|
+
msgstr "Z auto isch erfolgriich aktualisiart worda."
|
|
35
|
+
|
|
36
|
+
#: app/views/cars/show.html.erb:1
|
|
37
|
+
#: locale/model_attributes.rb:3
|
|
38
|
+
msgid "Car|Model"
|
|
39
|
+
msgstr "Modell"
|
|
40
|
+
|
|
41
|
+
#: app/views/cars/show.html.erb:3
|
|
42
|
+
#: locale/model_attributes.rb:4
|
|
43
|
+
msgid "Car|Wheels count"
|
|
44
|
+
msgstr "Räderzahl"
|
|
45
|
+
|
|
46
|
+
#: app/views/cars/show.html.erb:7
|
|
47
|
+
msgid "Created"
|
|
48
|
+
msgstr "Erstellt"
|
|
49
|
+
|
|
50
|
+
#: app/views/cars/show.html.erb:9
|
|
51
|
+
msgid "Month"
|
|
52
|
+
msgstr "Monat"
|
|
53
|
+
|
|
54
|
+
#: locale/model_attributes.rb:2
|
|
55
|
+
msgid "car"
|
|
56
|
+
msgstr "Auto"
|
|
57
|
+
|
|
58
|
+
#: locale/testlog_phrases.rb:2
|
|
59
|
+
msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
|
|
60
|
+
msgstr "Das isch a dynamischi übersetzig, wo dur gettext_test_log gfunda worda isch!"
|
|
61
|
+
|
data/spec/spec_helper.rb
CHANGED
|
@@ -21,6 +21,6 @@ end
|
|
|
21
21
|
def default_setup
|
|
22
22
|
FastGettext.add_text_domain('test',:path=>File.join(File.dirname(__FILE__),'locale'))
|
|
23
23
|
FastGettext.text_domain = 'test'
|
|
24
|
-
FastGettext.available_locales = ['en','de']
|
|
24
|
+
FastGettext.available_locales = ['en','de','gsw_CH']
|
|
25
25
|
FastGettext.locale = 'de'
|
|
26
|
-
end
|
|
26
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fast_gettext
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 5
|
|
9
|
-
-
|
|
10
|
-
version: 0.5.
|
|
9
|
+
- 12
|
|
10
|
+
version: 0.5.12
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Michael Grosser
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
18
|
+
date: 2011-06-17 00:00:00 +02:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies: []
|
|
21
21
|
|
|
@@ -93,6 +93,8 @@ files:
|
|
|
93
93
|
- spec/locale/en/LC_MESSAGES/test.mo
|
|
94
94
|
- spec/locale/en/plural_test.po
|
|
95
95
|
- spec/locale/en/test.po
|
|
96
|
+
- spec/locale/gsw_CH/LC_MESSAGES/test.mo
|
|
97
|
+
- spec/locale/gsw_CH/test.po
|
|
96
98
|
- spec/locale/yaml/de.yml
|
|
97
99
|
- spec/locale/yaml/en.yml
|
|
98
100
|
- spec/locale/yaml/notfound.yml
|
|
@@ -128,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
128
130
|
requirements: []
|
|
129
131
|
|
|
130
132
|
rubyforge_project:
|
|
131
|
-
rubygems_version: 1.
|
|
133
|
+
rubygems_version: 1.6.2
|
|
132
134
|
signing_key:
|
|
133
135
|
specification_version: 3
|
|
134
136
|
summary: A simple, fast, memory-efficient and threadsafe implementation of GetText
|