fast_gettext 0.5.8 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown
CHANGED
@@ -52,6 +52,7 @@ From mo files (traditional/default)
|
|
52
52
|
|
53
53
|
Or po files (less maintenance than mo)
|
54
54
|
FastGettext.add_text_domain('my_app',:path=>'locale', :type=>:po)
|
55
|
+
# :ignore_fuzzy => true to silence warnings
|
55
56
|
|
56
57
|
Or yaml files (use I18n syntax/indentation)
|
57
58
|
FastGettext.add_text_domain('my_app',:path=>'config/locales', :type=>:yaml)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.9
|
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.9"
|
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-
|
12
|
+
s.date = %q{2010-09-16}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.markdown"
|
@@ -72,6 +72,7 @@ Gem::Specification.new do |s|
|
|
72
72
|
"spec/fast_gettext/vendor/iconv_spec.rb",
|
73
73
|
"spec/fast_gettext/vendor/string_spec.rb",
|
74
74
|
"spec/fast_gettext_spec.rb",
|
75
|
+
"spec/fuzzy_locale/de/test.po",
|
75
76
|
"spec/locale/de/LC_MESSAGES/test.mo",
|
76
77
|
"spec/locale/de/test.po",
|
77
78
|
"spec/locale/en/LC_MESSAGES/plural_test.mo",
|
data/lib/fast_gettext/po_file.rb
CHANGED
@@ -4,10 +4,10 @@ module FastGettext
|
|
4
4
|
# - abstract po files for Po Repository
|
5
5
|
# TODO refactor...
|
6
6
|
class PoFile
|
7
|
-
def self.to_mo_file(file)
|
7
|
+
def self.to_mo_file(file, options={})
|
8
8
|
require 'fast_gettext/vendor/poparser'
|
9
9
|
mo_file = FastGettext::GetText::MOFile.new
|
10
|
-
FastGettext::GetText::PoParser.new.parse(File.read(file),mo_file)
|
10
|
+
FastGettext::GetText::PoParser.new.parse(File.read(file), mo_file, !options[:ignore_fuzzy])
|
11
11
|
MoFile.new(mo_file)
|
12
12
|
end
|
13
13
|
end
|
@@ -7,10 +7,10 @@ module FastGettext
|
|
7
7
|
# - provide access to translations in po files
|
8
8
|
class Po < Mo
|
9
9
|
protected
|
10
|
-
def find_and_store_files(name,options)
|
10
|
+
def find_and_store_files(name, options)
|
11
11
|
require 'fast_gettext/po_file'
|
12
|
-
find_files_in_locale_folders("#{name}.po",options[:path]) do |locale,file|
|
13
|
-
@files[locale] = PoFile.to_mo_file(file)
|
12
|
+
find_files_in_locale_folders("#{name}.po", options[:path]) do |locale,file|
|
13
|
+
@files[locale] = PoFile.to_mo_file(file, options)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -26,4 +26,16 @@ describe 'FastGettext::TranslationRepository::Po' 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
|
+
|
30
|
+
describe 'fuzzy' do
|
31
|
+
it "should warn on fuzzy by default" do
|
32
|
+
$stderr.should_receive(:print).at_least(:once)
|
33
|
+
FastGettext::TranslationRepository.build('test',:path=>File.join('spec','fuzzy_locale'),:type=>:po)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should ignore fuzzy when told to do so" do
|
37
|
+
$stderr.should_not_receive(:print)
|
38
|
+
FastGettext::TranslationRepository.build('test',:path=>File.join('spec','fuzzy_locale'),:type=>:po, :ignore_fuzzy => true)
|
39
|
+
end
|
40
|
+
end
|
29
41
|
end
|
@@ -0,0 +1,22 @@
|
|
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
|
+
#, fuzzy
|
7
|
+
msgid ""
|
8
|
+
msgstr ""
|
9
|
+
"Project-Id-Version: version 0.0.1\n"
|
10
|
+
"POT-Creation-Date: 2009-02-26 19:50+0100\n"
|
11
|
+
"PO-Revision-Date: 2009-02-18 14:53+0100\n"
|
12
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14
|
+
"MIME-Version: 1.0\n"
|
15
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16
|
+
"Content-Transfer-Encoding: 8bit\n"
|
17
|
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
18
|
+
|
19
|
+
#: app/helpers/translation_helper.rb:3
|
20
|
+
# fuzzy
|
21
|
+
msgid "%{relative_time} ago"
|
22
|
+
msgstr "vor %{relative_time}"
|
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
|
+
- 9
|
9
|
+
version: 0.5.9
|
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-
|
17
|
+
date: 2010-09-16 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- spec/fast_gettext/vendor/iconv_spec.rb
|
85
85
|
- spec/fast_gettext/vendor/string_spec.rb
|
86
86
|
- spec/fast_gettext_spec.rb
|
87
|
+
- spec/fuzzy_locale/de/test.po
|
87
88
|
- spec/locale/de/LC_MESSAGES/test.mo
|
88
89
|
- spec/locale/de/test.po
|
89
90
|
- spec/locale/en/LC_MESSAGES/plural_test.mo
|