russian 0.2.7 → 0.6.0

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.
Files changed (49) hide show
  1. data/CHANGELOG +24 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +1 -1
  4. data/README.textile +136 -139
  5. data/Rakefile +4 -49
  6. data/TODO +0 -6
  7. data/lib/russian.rb +18 -39
  8. data/lib/russian/action_view_ext/helpers/date_helper.rb +15 -9
  9. data/lib/russian/active_model_ext/custom_error_message.rb +70 -0
  10. data/lib/russian/locale/actionview.yml +100 -50
  11. data/lib/russian/locale/activemodel.yml +50 -0
  12. data/lib/russian/locale/activerecord.yml +24 -24
  13. data/lib/russian/locale/datetime.rb +39 -0
  14. data/lib/russian/locale/datetime.yml +9 -5
  15. data/lib/russian/locale/pluralization.rb +28 -0
  16. data/lib/russian/locale/transliterator.rb +17 -0
  17. data/lib/russian/russian_rails.rb +8 -0
  18. data/lib/russian/version.rb +9 -0
  19. data/russian.gemspec +26 -0
  20. data/spec/locale_spec.rb +5 -87
  21. data/spec/russian_spec.rb +5 -23
  22. metadata +70 -69
  23. data/init.rb +0 -3
  24. data/lib/russian/active_record_ext/custom_error_message.rb +0 -163
  25. data/lib/russian/active_support_ext/parameterize.rb +0 -31
  26. data/lib/russian/backend/advanced.rb +0 -134
  27. data/lib/russian/locale/pluralize.rb +0 -25
  28. data/lib/vendor/i18n/MIT-LICENSE +0 -20
  29. data/lib/vendor/i18n/README.textile +0 -20
  30. data/lib/vendor/i18n/Rakefile +0 -5
  31. data/lib/vendor/i18n/i18n.gemspec +0 -27
  32. data/lib/vendor/i18n/lib/i18n.rb +0 -199
  33. data/lib/vendor/i18n/lib/i18n/backend/simple.rb +0 -214
  34. data/lib/vendor/i18n/lib/i18n/exceptions.rb +0 -53
  35. data/lib/vendor/i18n/test/all.rb +0 -5
  36. data/lib/vendor/i18n/test/i18n_exceptions_test.rb +0 -100
  37. data/lib/vendor/i18n/test/i18n_test.rb +0 -125
  38. data/lib/vendor/i18n/test/locale/en.rb +0 -1
  39. data/lib/vendor/i18n/test/locale/en.yml +0 -3
  40. data/lib/vendor/i18n/test/simple_backend_test.rb +0 -568
  41. data/lib/vendor/i18n_label/README.textile +0 -38
  42. data/lib/vendor/i18n_label/Rakefile +0 -11
  43. data/lib/vendor/i18n_label/init.rb +0 -1
  44. data/lib/vendor/i18n_label/install.rb +0 -1
  45. data/lib/vendor/i18n_label/lib/i18n_label.rb +0 -23
  46. data/lib/vendor/i18n_label/spec/i18n_label_spec.rb +0 -20
  47. data/lib/vendor/i18n_label/spec/spec_helper.rb +0 -10
  48. data/lib/vendor/i18n_label/tasks/i18n_label_tasks.rake +0 -4
  49. data/lib/vendor/i18n_label/uninstall.rb +0 -1
@@ -1,38 +0,0 @@
1
- h1. I18nLabel
2
-
3
- Since labels don't use I18n in Rails 2.2 (I was too late in submitting the
4
- patch), we'd have to make due with a plugin.
5
-
6
- Installation and configuration consists of 1 easy steps:
7
-
8
- # Run:
9
-
10
- ./script/plugin install git://github.com/iain/i18n_label.git
11
-
12
-
13
- h1. Example
14
-
15
- In your translation file:
16
-
17
- en-US:
18
- activerecord:
19
- attributes:
20
- topic:
21
- name: A nice name
22
-
23
- In your view:
24
-
25
- <% form_for @topic do |f| %>
26
- <%= f.label :name %>
27
- <% end %>
28
-
29
- The result is:
30
-
31
- &lt;label for="topic_name">A nice name</label> (please ignore the minor problem with html in github)
32
-
33
-
34
-
35
- For more information about where to put your translations,
36
- visit "my blog":http://iain.nl/2008/09/translating-activerecord/
37
-
38
- Copyright (c) 2008 "Iain Hecker":http://iain.nl/, released under the MIT license
@@ -1,11 +0,0 @@
1
- require 'rake'
2
- require 'spec/rake/spectask'
3
-
4
- desc 'Default: run specs.'
5
- task :default => :spec
6
-
7
- desc 'Run the specs'
8
- Spec::Rake::SpecTask.new(:spec) do |t|
9
- t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
10
- t.spec_files = FileList['spec/**/*_spec.rb']
11
- end
@@ -1 +0,0 @@
1
- require File.dirname(__FILE__) + '/lib/i18n_label.rb'
@@ -1 +0,0 @@
1
- File.readlines(File.dirname(__FILE__)+'/README.textile').each { |line| puts line }
@@ -1,23 +0,0 @@
1
- # Just replace the method...
2
- module ActionView
3
- module Helpers
4
- class InstanceTag
5
- def to_label_tag(text = nil, options = {})
6
- options = options.stringify_keys
7
- name_and_id = options.dup
8
- add_default_name_and_id(name_and_id)
9
- options.delete("index")
10
- options["for"] ||= name_and_id["id"]
11
- if text.blank?
12
- content = method_name.humanize
13
- if object.class.respond_to?(:human_attribute_name)
14
- content = object.class.human_attribute_name(method_name)
15
- end
16
- else
17
- content = text.to_s
18
- end
19
- label_tag(name_and_id["id"], content, options)
20
- end
21
- end
22
- end
23
- end
@@ -1,20 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- # give a model to play with
4
- class Reply < ActiveRecord::Base
5
- attr_accessor :title
6
- end
7
-
8
- describe ActionView::Helpers do
9
-
10
- # NOTE gives deprication warning in RSpec 1.1.4:
11
- # Modules will no longer be automatically included in RSpec version 1.1.4. Called from ./spec/i18n_label_spec.rb:15
12
- it "label should make a call to human_attribute_name" do
13
- Reply.should_receive(:human_attribute_name).with('title').and_return("translated title")
14
- reply = mock_model(Reply)
15
- fields_for(reply) do |f|
16
- f.label(:title).should == "<label for=\"reply_title\">translated title</label>"
17
- end
18
- end
19
-
20
- end
@@ -1,10 +0,0 @@
1
- begin
2
- require File.dirname(__FILE__) + '/../../../../spec/spec_helper'
3
- rescue LoadError
4
- puts "You need to install rspec in your base app"
5
- exit
6
- end
7
-
8
- plugin_spec_dir = File.dirname(__FILE__)
9
- ActiveRecord::Base.logger = Logger.new(plugin_spec_dir + "/debug.log")
10
-
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :i18n_label do
3
- # # Task goes here
4
- # end
@@ -1 +0,0 @@
1
- puts "Bye!"