fast_gettext 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -0
- data/VERSION +1 -1
- data/benchmark/ideal.rb +4 -2
- data/benchmark/original.rb +5 -1
- data/fast_gettext.gemspec +16 -15
- data/lib/fast_gettext.rb +3 -3
- data/lib/fast_gettext/VERSION +1 -0
- data/lib/fast_gettext/mo_file.rb +3 -3
- data/lib/fast_gettext/po_file.rb +2 -2
- data/{vendor → lib/fast_gettext/vendor}/README.rdoc +0 -0
- data/{vendor → lib/fast_gettext/vendor}/empty.mo +0 -0
- data/{vendor → lib/fast_gettext/vendor}/iconv.rb +0 -0
- data/{vendor → lib/fast_gettext/vendor}/mofile.rb +0 -0
- data/{vendor → lib/fast_gettext/vendor}/poparser.rb +0 -0
- data/{vendor → lib/fast_gettext/vendor}/string.rb +0 -0
- data/spec/{vendor → fast_gettext/vendor}/fake_load_path/iconv.rb +0 -0
- data/spec/{vendor → fast_gettext/vendor}/iconv_spec.rb +1 -1
- data/spec/{vendor → fast_gettext/vendor}/string_spec.rb +0 -0
- metadata +16 -15
data/README.markdown
CHANGED
@@ -189,6 +189,7 @@ Mo/Po-file parsing from Masao Mutoh, see vendor/README
|
|
189
189
|
###Contributors
|
190
190
|
- [geekq](http://www.innoq.com/blog/vd)
|
191
191
|
- [Matt Sanford](http://blog.mzsanford.com)
|
192
|
+
- [Antonio Terceiro](http://softwarelivre.org/terceiro)
|
192
193
|
- Rudolf Gavlas
|
193
194
|
|
194
195
|
[Michael Grosser](http://pragmatig.wordpress.com)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
data/benchmark/ideal.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'benchmark/base'
|
2
2
|
|
3
|
+
$LOAD_PATH.unshift 'lib'
|
4
|
+
|
3
5
|
module FastestGettext
|
4
6
|
def set_domain(folder,domain,locale)
|
5
7
|
@data = {}
|
6
|
-
require
|
8
|
+
require 'fast_gettext/vendor/mofile'
|
7
9
|
FastGettext::GetText::MOFile.open(File.join(folder,locale,'LC_MESSAGES',"#{domain}.mo"), "UTF-8").each{|k,v|@data[k]=v}
|
8
10
|
end
|
9
11
|
def _(word)
|
@@ -19,4 +21,4 @@ results_test{_('car') == 'Auto'}
|
|
19
21
|
|
20
22
|
#i cannot add the large file, since its an internal applications mo file
|
21
23
|
set_domain(locale_folder('large'),'large','de')
|
22
|
-
results_large
|
24
|
+
results_large
|
data/benchmark/original.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'benchmark/base'
|
2
2
|
|
3
|
+
begin
|
3
4
|
gem 'gettext', '>=2.0.0'
|
5
|
+
rescue LoadError
|
6
|
+
$LOAD_PATH.unshift 'lib'
|
7
|
+
end
|
4
8
|
require 'gettext'
|
5
9
|
include GetText
|
6
10
|
|
@@ -12,4 +16,4 @@ results_test{_('car') == 'Auto'}
|
|
12
16
|
|
13
17
|
#i cannot add the large file, since its an internal applications mo file
|
14
18
|
bindtextdomain('large',:path=>locale_folder('large'))
|
15
|
-
results_large
|
19
|
+
results_large
|
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.3"
|
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{2010-04-
|
12
|
+
s.date = %q{2010-04-12}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.markdown"
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"examples/missing_translation_logger.rb",
|
36
36
|
"fast_gettext.gemspec",
|
37
37
|
"lib/fast_gettext.rb",
|
38
|
+
"lib/fast_gettext/VERSION",
|
38
39
|
"lib/fast_gettext/mo_file.rb",
|
39
40
|
"lib/fast_gettext/po_file.rb",
|
40
41
|
"lib/fast_gettext/storage.rb",
|
@@ -49,6 +50,12 @@ Gem::Specification.new do |s|
|
|
49
50
|
"lib/fast_gettext/translation_repository/mo.rb",
|
50
51
|
"lib/fast_gettext/translation_repository/po.rb",
|
51
52
|
"lib/fast_gettext/translation_repository/yaml.rb",
|
53
|
+
"lib/fast_gettext/vendor/README.rdoc",
|
54
|
+
"lib/fast_gettext/vendor/empty.mo",
|
55
|
+
"lib/fast_gettext/vendor/iconv.rb",
|
56
|
+
"lib/fast_gettext/vendor/mofile.rb",
|
57
|
+
"lib/fast_gettext/vendor/poparser.rb",
|
58
|
+
"lib/fast_gettext/vendor/string.rb",
|
52
59
|
"spec/aa_unconfigued_spec.rb",
|
53
60
|
"spec/fast_gettext/mo_file_spec.rb",
|
54
61
|
"spec/fast_gettext/storage_spec.rb",
|
@@ -61,6 +68,9 @@ Gem::Specification.new do |s|
|
|
61
68
|
"spec/fast_gettext/translation_repository/yaml_spec.rb",
|
62
69
|
"spec/fast_gettext/translation_repository_spec.rb",
|
63
70
|
"spec/fast_gettext/translation_spec.rb",
|
71
|
+
"spec/fast_gettext/vendor/fake_load_path/iconv.rb",
|
72
|
+
"spec/fast_gettext/vendor/iconv_spec.rb",
|
73
|
+
"spec/fast_gettext/vendor/string_spec.rb",
|
64
74
|
"spec/fast_gettext_spec.rb",
|
65
75
|
"spec/locale/de/LC_MESSAGES/test.mo",
|
66
76
|
"spec/locale/de/test.po",
|
@@ -71,16 +81,7 @@ Gem::Specification.new do |s|
|
|
71
81
|
"spec/locale/yaml/de.yml",
|
72
82
|
"spec/locale/yaml/en.yml",
|
73
83
|
"spec/locale/yaml/notfound.yml",
|
74
|
-
"spec/spec_helper.rb"
|
75
|
-
"spec/vendor/fake_load_path/iconv.rb",
|
76
|
-
"spec/vendor/iconv_spec.rb",
|
77
|
-
"spec/vendor/string_spec.rb",
|
78
|
-
"vendor/README.rdoc",
|
79
|
-
"vendor/empty.mo",
|
80
|
-
"vendor/iconv.rb",
|
81
|
-
"vendor/mofile.rb",
|
82
|
-
"vendor/poparser.rb",
|
83
|
-
"vendor/string.rb"
|
84
|
+
"spec/spec_helper.rb"
|
84
85
|
]
|
85
86
|
s.homepage = %q{http://github.com/grosser/fast_gettext}
|
86
87
|
s.rdoc_options = ["--charset=UTF-8"]
|
@@ -90,9 +91,6 @@ Gem::Specification.new do |s|
|
|
90
91
|
s.test_files = [
|
91
92
|
"spec/spec_helper.rb",
|
92
93
|
"spec/aa_unconfigued_spec.rb",
|
93
|
-
"spec/vendor/fake_load_path/iconv.rb",
|
94
|
-
"spec/vendor/iconv_spec.rb",
|
95
|
-
"spec/vendor/string_spec.rb",
|
96
94
|
"spec/fast_gettext_spec.rb",
|
97
95
|
"spec/fast_gettext/translation_repository_spec.rb",
|
98
96
|
"spec/fast_gettext/translation_repository/mo_spec.rb",
|
@@ -102,6 +100,9 @@ Gem::Specification.new do |s|
|
|
102
100
|
"spec/fast_gettext/translation_repository/base_spec.rb",
|
103
101
|
"spec/fast_gettext/translation_repository/po_spec.rb",
|
104
102
|
"spec/fast_gettext/translation_repository/chain_spec.rb",
|
103
|
+
"spec/fast_gettext/vendor/fake_load_path/iconv.rb",
|
104
|
+
"spec/fast_gettext/vendor/iconv_spec.rb",
|
105
|
+
"spec/fast_gettext/vendor/string_spec.rb",
|
105
106
|
"spec/fast_gettext/translation_spec.rb",
|
106
107
|
"spec/fast_gettext/mo_file_spec.rb",
|
107
108
|
"spec/fast_gettext/storage_spec.rb",
|
data/lib/fast_gettext.rb
CHANGED
@@ -2,13 +2,13 @@ require 'fast_gettext/mo_file'
|
|
2
2
|
require 'fast_gettext/storage'
|
3
3
|
require 'fast_gettext/translation'
|
4
4
|
require 'fast_gettext/translation_repository'
|
5
|
-
require
|
5
|
+
require 'fast_gettext/vendor/string'
|
6
6
|
|
7
7
|
module FastGettext
|
8
8
|
include FastGettext::Storage
|
9
9
|
extend self
|
10
10
|
|
11
|
-
VERSION = File.read( File.join(File.dirname(__FILE__),'
|
11
|
+
VERSION = File.read( File.join(File.dirname(__FILE__), 'fast_gettext', 'VERSION') ).strip
|
12
12
|
LOCALE_REX = /^[a-z]{2}$|^[a-z]{2}_[A-Z]{2}$/
|
13
13
|
NAMESPACE_SEPERATOR = '|'
|
14
14
|
|
@@ -27,4 +27,4 @@ module FastGettext
|
|
27
27
|
def add_text_domain(name,options)
|
28
28
|
translation_repositories[name] = TranslationRepository.build(name,options)
|
29
29
|
end
|
30
|
-
end
|
30
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
0.5.1
|
data/lib/fast_gettext/mo_file.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'fast_gettext/vendor/mofile'
|
2
2
|
module FastGettext
|
3
3
|
# Responsibility:
|
4
4
|
# - abstract mo files for Mo Repository
|
@@ -36,7 +36,7 @@ module FastGettext
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.empty
|
39
|
-
MoFile.new(File.join(File.dirname(__FILE__),'
|
39
|
+
MoFile.new(File.join(File.dirname(__FILE__),'vendor','empty.mo'))
|
40
40
|
end
|
41
41
|
|
42
42
|
private
|
@@ -64,4 +64,4 @@ module FastGettext
|
|
64
64
|
if plurals then split_plurals(plurals) else [] end
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
data/lib/fast_gettext/po_file.rb
CHANGED
@@ -5,10 +5,10 @@ module FastGettext
|
|
5
5
|
# TODO refactor...
|
6
6
|
class PoFile
|
7
7
|
def self.to_mo_file(file)
|
8
|
-
require
|
8
|
+
require 'fast_gettext/vendor/poparser'
|
9
9
|
mo_file = FastGettext::GetText::MOFile.new
|
10
10
|
FastGettext::GetText::PoParser.new.parse(File.read(file),mo_file)
|
11
11
|
MoFile.new(mo_file)
|
12
12
|
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 3
|
9
|
+
version: 0.5.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Grosser
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-12 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- examples/missing_translation_logger.rb
|
48
48
|
- fast_gettext.gemspec
|
49
49
|
- lib/fast_gettext.rb
|
50
|
+
- lib/fast_gettext/VERSION
|
50
51
|
- lib/fast_gettext/mo_file.rb
|
51
52
|
- lib/fast_gettext/po_file.rb
|
52
53
|
- lib/fast_gettext/storage.rb
|
@@ -61,6 +62,12 @@ files:
|
|
61
62
|
- lib/fast_gettext/translation_repository/mo.rb
|
62
63
|
- lib/fast_gettext/translation_repository/po.rb
|
63
64
|
- lib/fast_gettext/translation_repository/yaml.rb
|
65
|
+
- lib/fast_gettext/vendor/README.rdoc
|
66
|
+
- lib/fast_gettext/vendor/empty.mo
|
67
|
+
- lib/fast_gettext/vendor/iconv.rb
|
68
|
+
- lib/fast_gettext/vendor/mofile.rb
|
69
|
+
- lib/fast_gettext/vendor/poparser.rb
|
70
|
+
- lib/fast_gettext/vendor/string.rb
|
64
71
|
- spec/aa_unconfigued_spec.rb
|
65
72
|
- spec/fast_gettext/mo_file_spec.rb
|
66
73
|
- spec/fast_gettext/storage_spec.rb
|
@@ -73,6 +80,9 @@ files:
|
|
73
80
|
- spec/fast_gettext/translation_repository/yaml_spec.rb
|
74
81
|
- spec/fast_gettext/translation_repository_spec.rb
|
75
82
|
- spec/fast_gettext/translation_spec.rb
|
83
|
+
- spec/fast_gettext/vendor/fake_load_path/iconv.rb
|
84
|
+
- spec/fast_gettext/vendor/iconv_spec.rb
|
85
|
+
- spec/fast_gettext/vendor/string_spec.rb
|
76
86
|
- spec/fast_gettext_spec.rb
|
77
87
|
- spec/locale/de/LC_MESSAGES/test.mo
|
78
88
|
- spec/locale/de/test.po
|
@@ -84,15 +94,6 @@ files:
|
|
84
94
|
- spec/locale/yaml/en.yml
|
85
95
|
- spec/locale/yaml/notfound.yml
|
86
96
|
- spec/spec_helper.rb
|
87
|
-
- spec/vendor/fake_load_path/iconv.rb
|
88
|
-
- spec/vendor/iconv_spec.rb
|
89
|
-
- spec/vendor/string_spec.rb
|
90
|
-
- vendor/README.rdoc
|
91
|
-
- vendor/empty.mo
|
92
|
-
- vendor/iconv.rb
|
93
|
-
- vendor/mofile.rb
|
94
|
-
- vendor/poparser.rb
|
95
|
-
- vendor/string.rb
|
96
97
|
has_rdoc: true
|
97
98
|
homepage: http://github.com/grosser/fast_gettext
|
98
99
|
licenses: []
|
@@ -126,9 +127,6 @@ summary: A simple, fast and threadsafe implementation of GetText
|
|
126
127
|
test_files:
|
127
128
|
- spec/spec_helper.rb
|
128
129
|
- spec/aa_unconfigued_spec.rb
|
129
|
-
- spec/vendor/fake_load_path/iconv.rb
|
130
|
-
- spec/vendor/iconv_spec.rb
|
131
|
-
- spec/vendor/string_spec.rb
|
132
130
|
- spec/fast_gettext_spec.rb
|
133
131
|
- spec/fast_gettext/translation_repository_spec.rb
|
134
132
|
- spec/fast_gettext/translation_repository/mo_spec.rb
|
@@ -138,6 +136,9 @@ test_files:
|
|
138
136
|
- spec/fast_gettext/translation_repository/base_spec.rb
|
139
137
|
- spec/fast_gettext/translation_repository/po_spec.rb
|
140
138
|
- spec/fast_gettext/translation_repository/chain_spec.rb
|
139
|
+
- spec/fast_gettext/vendor/fake_load_path/iconv.rb
|
140
|
+
- spec/fast_gettext/vendor/iconv_spec.rb
|
141
|
+
- spec/fast_gettext/vendor/string_spec.rb
|
141
142
|
- spec/fast_gettext/translation_spec.rb
|
142
143
|
- spec/fast_gettext/mo_file_spec.rb
|
143
144
|
- spec/fast_gettext/storage_spec.rb
|