rich_pluralization 1.0.3 → 1.0.4

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/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  = Rich-pluralization CHANGELOG
2
2
 
3
+ == Version 1.0.4 (October 4, 2010)
4
+
5
+ * Using ActiveSupport::CoreExtensions::String::Inflections.pluralize (and singularize) when current locale is English
6
+
3
7
  == Version 1.0.3 (September 4, 2010)
4
8
 
5
9
  * Specified version (0.3.7) of the i18n gem dependency
@@ -187,18 +187,19 @@ i18n<br>
187
187
 
188
188
  h2. ToDo's
189
189
 
190
- * Complete the Dutch inflections
190
+ * Complete the Dutch and Spanish inflections
191
191
  * Most String inflection methods are also defined in rich_i18n (keep it DRY)
192
+ * Check whether to make Rich-pluralization compatible with Rails 3
192
193
 
193
- h2. E9s
194
+ h2. Enrichments
194
195
 
195
- E9s - "http://github.com/archan937/e9s":http://github.com/archan937/e9s
196
+ The all-in-one gem at - "http://codehero.es/rails_gems_plugins/e9s":http://codehero.es/rails_gems_plugins/e9s - "http://github.com/archan937/e9s":http://github.com/archan937/e9s
196
197
 
197
198
  h3. E9s modules
198
199
 
199
- * Rich-CMS - "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
200
- * Rich-i18n - "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
201
- * Rich-pluralization - "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
200
+ * Rich-CMS <br> "http://codehero.es/rails_gems_plugins/rich_cms":http://codehero.es/rails_gems_plugins/rich_cms <br> "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
201
+ * Rich-i18n <br> "http://codehero.es/rails_gems_plugins/rich_i18n":http://codehero.es/rails_gems_plugins/rich_i18n <br> "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
202
+ * Rich-pluralization <br> "http://codehero.es/rails_gems_plugins/rich_pluralization":http://codehero.es/rails_gems_plugins/rich_pluralization <br> "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
202
203
 
203
204
  h2. License
204
205
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -14,15 +14,19 @@ module Rich
14
14
  end
15
15
 
16
16
  def singularize(word)
17
- inflect :singulars, word
17
+ in_english? ? word.singularize : inflect(:singulars, word)
18
18
  end
19
19
 
20
20
  def pluralize(word, count = nil)
21
- count == 1 ? singularize(word) : inflect(:plurals, word)
21
+ count == 1 ? singularize(word) : (in_english? ? word.pluralize : inflect(:plurals, word))
22
22
  end
23
23
 
24
24
  private
25
25
 
26
+ def in_english?
27
+ I18n.locale.to_s == "en"
28
+ end
29
+
26
30
  [:singulars, :plurals, :irregulars, :uncountables].each do |type|
27
31
  define_method type do
28
32
  (Inflections.instance.send(type)[I18n.locale] || (type == :uncountables ? [] : {}))
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rich_pluralization}
8
- s.version = "1.0.3"
8
+ s.version = "1.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Engel"]
12
- s.date = %q{2010-09-30}
12
+ s.date = %q{2010-10-04}
13
13
  s.description = %q{Rich-pluralization is a module of E9s (http://github.com/archan937/e9s) which provides localized pluralization in combination with i18n. Doing this enables you to only translate words in singular form as the module pluralizes the translation for you.}
14
14
  s.email = %q{paul.engel@holder.nl}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rich_pluralization
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 3
10
- version: 1.0.3
9
+ - 4
10
+ version: 1.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Engel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-30 00:00:00 +02:00
18
+ date: 2010-10-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency