rich_i18n 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/CHANGELOG +19 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +269 -0
- data/Rakefile +42 -0
- data/VERSION +1 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/rich/i18n.rb +11 -0
- data/lib/rich/i18n/actionpack.rb +4 -0
- data/lib/rich/i18n/actionpack/action_controller/dispatcher.rb +12 -0
- data/lib/rich/i18n/actionpack/action_view/base.rb +13 -0
- data/lib/rich/i18n/actionpack/action_view/sanitizor.rb +61 -0
- data/lib/rich/i18n/core.rb +8 -0
- data/lib/rich/i18n/core/array.rb +8 -0
- data/lib/rich/i18n/core/array/merging.rb +29 -0
- data/lib/rich/i18n/core/enriched_string.rb +28 -0
- data/lib/rich/i18n/core/enumerable/methods.rb +16 -0
- data/lib/rich/i18n/core/erb.rb +6 -0
- data/lib/rich/i18n/core/erb/output.rb +22 -0
- data/lib/rich/i18n/core/hash.rb +6 -0
- data/lib/rich/i18n/core/nil_class.rb +8 -0
- data/lib/rich/i18n/core/object.rb +6 -0
- data/lib/rich/i18n/core/object/output.rb +20 -0
- data/lib/rich/i18n/core/string.rb +10 -0
- data/lib/rich/i18n/core/string/enrichments.rb +68 -0
- data/lib/rich/i18n/core/string/inflections.rb +42 -0
- data/lib/rich/i18n/core/string/internationalization.rb +82 -0
- data/lib/rich/i18n/core/symbol.rb +6 -0
- data/lib/rich/i18n/core/symbol/internationalization.rb +16 -0
- data/lib/rich/i18n/engine.rb +31 -0
- data/lib/rich/i18n/formtastic.rb +51 -0
- data/lib/rich_i18n.rb +5 -0
- data/locales/nl.yml +14 -0
- data/rails/init.rb +1 -0
- data/tasks/rich_i18n_tasks.rake +11 -0
- data/test/core/string/inflections_test.rb +42 -0
- data/test/core/string/internationalization_test.rb +23 -0
- data/test/engine_test.rb +20 -0
- data/test/locales/nl/internationalization_test.rb +47 -0
- data/test/setup.rb +14 -0
- data/test/test_helper.rb +5 -0
- data/uninstall.rb +1 -0
- metadata +136 -0
data/lib/rich_i18n.rb
ADDED
data/locales/nl.yml
ADDED
data/rails/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "rich_i18n"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
namespace :rich_i18n do
|
3
|
+
Rake::TestTask.new do |t|
|
4
|
+
t.libs << "test"
|
5
|
+
t.verbose = false
|
6
|
+
t.test_files = FileList.new("vendor/plugins/rich_i18n/test/**/*.rb") do |list|
|
7
|
+
# list.exclude "foo.rb"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
Rake::Task["rich_i18n:test"].comment = "Run the rich_i18n plugin tests"
|
11
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "test_helper.rb"))
|
2
|
+
|
3
|
+
module Rich
|
4
|
+
module I18n
|
5
|
+
module Test
|
6
|
+
module Core
|
7
|
+
module String
|
8
|
+
|
9
|
+
class InflectionsTest < ActiveSupport::TestCase
|
10
|
+
setup do
|
11
|
+
include Setup
|
12
|
+
end
|
13
|
+
|
14
|
+
test "upcase_first" do
|
15
|
+
assert_equal "" , "".upcase_first
|
16
|
+
assert_equal "E9s", "e9s".upcase_first
|
17
|
+
assert_equal "E9S", "E9S".upcase_first
|
18
|
+
end
|
19
|
+
|
20
|
+
test "cp_case" do
|
21
|
+
assert_equal "BTW" , "btw".cp_case("VAT")
|
22
|
+
assert_equal "huis" , "huis".cp_case("house")
|
23
|
+
assert_equal "Welkom thuis" , "Welkom thuis".cp_case("Welcome home")
|
24
|
+
assert_equal "Welkom bij CodeHero.es", "welkom bij CodeHero.es".cp_case("Welcome at CodeHero.es")
|
25
|
+
end
|
26
|
+
|
27
|
+
test "upcase_first!" do
|
28
|
+
assert_equal nil , "".upcase_first!
|
29
|
+
assert_equal "E9s", "e9s".upcase_first!
|
30
|
+
assert_equal nil , "E9s".upcase_first!
|
31
|
+
end
|
32
|
+
|
33
|
+
# test "pluralize!" do
|
34
|
+
# assert true
|
35
|
+
# end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "test_helper.rb"))
|
2
|
+
|
3
|
+
module Rich
|
4
|
+
module I18n
|
5
|
+
module Test
|
6
|
+
module Core
|
7
|
+
module String
|
8
|
+
|
9
|
+
class InternationalizationTest < ActiveSupport::TestCase
|
10
|
+
setup do
|
11
|
+
include Setup
|
12
|
+
end
|
13
|
+
|
14
|
+
# test "t" do
|
15
|
+
# assert true
|
16
|
+
# end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/test/engine_test.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "test_helper"
|
2
|
+
|
3
|
+
module Rich
|
4
|
+
module I18n
|
5
|
+
module Test
|
6
|
+
|
7
|
+
class EngineTest < ActiveSupport::TestCase
|
8
|
+
setup do
|
9
|
+
include Setup
|
10
|
+
I18n.locale = ::Rich::I18n::Engine.init(Locales::NL)
|
11
|
+
end
|
12
|
+
|
13
|
+
# test "something" do
|
14
|
+
# assert true
|
15
|
+
# end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "test_helper.rb"))
|
2
|
+
|
3
|
+
module Rich
|
4
|
+
module I18n
|
5
|
+
module Test
|
6
|
+
module Locales
|
7
|
+
module NL
|
8
|
+
|
9
|
+
class InternationalizationTest < ActiveSupport::TestCase
|
10
|
+
setup do
|
11
|
+
include Setup
|
12
|
+
I18n.locale = ::Rich::I18n::Engine.init(self)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "dutch_translations" do
|
16
|
+
assert_equal "huis" , "house".t
|
17
|
+
assert_equal "straat", "street".t
|
18
|
+
assert_equal "vraag" , "question".t
|
19
|
+
assert_equal "vraag" , "word.question".t
|
20
|
+
end
|
21
|
+
|
22
|
+
test "dutch_cased_translations" do
|
23
|
+
assert_equal "meer" , "more".t
|
24
|
+
assert_equal "Huis" , "House".t
|
25
|
+
# assert_equal "Straten", "Streets".t
|
26
|
+
# assert_equal "VRAGEN" , "QUESTIONS".t
|
27
|
+
end
|
28
|
+
|
29
|
+
test "dutch_combined_translations" do
|
30
|
+
assert_equal "vraag & antwoord" , "question & answer".t
|
31
|
+
assert_equal "Vraag & antwoord" , "Question & answer".t
|
32
|
+
assert_equal "Man / Vrouw" , "Male / Female".t
|
33
|
+
assert_equal "één huis" , "one house".t
|
34
|
+
# assert_equal "Één huis" , "One house".t
|
35
|
+
# assert_equal "Meer huizen" , "More houses".t
|
36
|
+
# assert_equal "MEER STRATEN" , "MORE STREETS".t
|
37
|
+
# assert_equal "meer vragen" , "more questions".t
|
38
|
+
# assert_equal "meer vragen" , "more questions".t
|
39
|
+
# assert_equal "Vragen & Antwoorden", "Questions & Answers".t
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/test/setup.rb
ADDED
data/test/test_helper.rb
ADDED
data/uninstall.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# Uninstall hook code here
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rich_i18n
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
version: 1.0.3
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Paul Engel
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-07-22 00:00:00 +02:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: i18n
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: formtastic
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
type: :runtime
|
45
|
+
version_requirements: *id002
|
46
|
+
description: Rich-i18n is a module of E9s (http://github.com/archan937/e9s) which enriches I18n, Formtastic, the String and Symbol classes. This simplifies internationalization of your Rails application making a Rails developers life much easier.
|
47
|
+
email: paul.engel@holder.nl
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- README.textile
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- CHANGELOG
|
57
|
+
- MIT-LICENSE
|
58
|
+
- README.textile
|
59
|
+
- Rakefile
|
60
|
+
- VERSION
|
61
|
+
- init.rb
|
62
|
+
- install.rb
|
63
|
+
- lib/rich/i18n.rb
|
64
|
+
- lib/rich/i18n/actionpack.rb
|
65
|
+
- lib/rich/i18n/actionpack/action_controller/dispatcher.rb
|
66
|
+
- lib/rich/i18n/actionpack/action_view/base.rb
|
67
|
+
- lib/rich/i18n/actionpack/action_view/sanitizor.rb
|
68
|
+
- lib/rich/i18n/core.rb
|
69
|
+
- lib/rich/i18n/core/array.rb
|
70
|
+
- lib/rich/i18n/core/array/merging.rb
|
71
|
+
- lib/rich/i18n/core/enriched_string.rb
|
72
|
+
- lib/rich/i18n/core/enumerable/methods.rb
|
73
|
+
- lib/rich/i18n/core/erb.rb
|
74
|
+
- lib/rich/i18n/core/erb/output.rb
|
75
|
+
- lib/rich/i18n/core/hash.rb
|
76
|
+
- lib/rich/i18n/core/nil_class.rb
|
77
|
+
- lib/rich/i18n/core/object.rb
|
78
|
+
- lib/rich/i18n/core/object/output.rb
|
79
|
+
- lib/rich/i18n/core/string.rb
|
80
|
+
- lib/rich/i18n/core/string/enrichments.rb
|
81
|
+
- lib/rich/i18n/core/string/inflections.rb
|
82
|
+
- lib/rich/i18n/core/string/internationalization.rb
|
83
|
+
- lib/rich/i18n/core/symbol.rb
|
84
|
+
- lib/rich/i18n/core/symbol/internationalization.rb
|
85
|
+
- lib/rich/i18n/engine.rb
|
86
|
+
- lib/rich/i18n/formtastic.rb
|
87
|
+
- lib/rich_i18n.rb
|
88
|
+
- locales/nl.yml
|
89
|
+
- rails/init.rb
|
90
|
+
- tasks/rich_i18n_tasks.rake
|
91
|
+
- test/core/string/inflections_test.rb
|
92
|
+
- test/core/string/internationalization_test.rb
|
93
|
+
- test/engine_test.rb
|
94
|
+
- test/locales/nl/internationalization_test.rb
|
95
|
+
- test/setup.rb
|
96
|
+
- test/test_helper.rb
|
97
|
+
- uninstall.rb
|
98
|
+
has_rdoc: true
|
99
|
+
homepage: http://github.com/archan937/rich_i18n
|
100
|
+
licenses: []
|
101
|
+
|
102
|
+
post_install_message:
|
103
|
+
rdoc_options:
|
104
|
+
- --charset=UTF-8
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
version: "0"
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
requirements: []
|
124
|
+
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 1.3.7
|
127
|
+
signing_key:
|
128
|
+
specification_version: 3
|
129
|
+
summary: Enrichments (e9s) module for internationalization (i18n)
|
130
|
+
test_files:
|
131
|
+
- test/core/string/inflections_test.rb
|
132
|
+
- test/core/string/internationalization_test.rb
|
133
|
+
- test/engine_test.rb
|
134
|
+
- test/locales/nl/internationalization_test.rb
|
135
|
+
- test/setup.rb
|
136
|
+
- test/test_helper.rb
|