Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix README (Russian & English) #11

Merged
merged 4 commits into from
Mar 24, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2011 Kirill Lazarev
Copyright (c) 2011-2012 Kirill Lazarev

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
95 changes: 27 additions & 68 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -1,108 +1,67 @@
== numbers_and_words

Convert numbers to words using the I18n library.

Перевод чисел в слова при помощи библиотеки I18n.

= If you don’t speak Russian
== Supported Languages / Языки

Convert numbers to words using I18n library.
* English
* Русский

== Support languages
== Examples / Примеры

* Russian
* English
I18n.with_locale(:en) { 42.to_words }
=> "forty-two"

== Примеры
I18n.with_locale(:ru) { 42.to_words }
=> "сорок два"

21.to_words
=> "twenty-one"
=> "двадцать один"

231.to_words
=> "two hundred thirty-one"
=> "двести тридцать один"

4030.to_words
=> "four thousand thirty"
=> "четыре тысячи тридцать"

1000100.to_words
=> "one million one hundred"
=> "один миллион сто"

1000000000000000000000000000000000.to_words
=> "one decillion"
=> "один дециллион"

[1, 2, 3].to_words
=> "[one, two, three]"
=> "[один, два, три]"

[11, 22, 133].to_words
=> ["eleven", "twenty-two", "one hundred thirty-three"]
=> ["одиннадцать", "двадцать два", "сто тридцать три"]

== Requirements / Требования

== Examples
* Ruby 1.8.7 (compatible with/совместимость с Ruby 1.9, JRuby and/и Rubinius);
* I18n 0.5.0 (earlier versions not tested/рание версии не тестировались);

21.to_words
=> "twenty-one"

231.to_words
=> "two hundred thirty-one"

4030.to_words
=> "four thousand thirty"

1000100.to_words
=> "one million one hundred"

1000000000000000000000000000000000.to_words
=> "one decillion"

[1, 2, 3].to_words
=> ["one", "two", "three"]

[11, 22, 133].to_words
=> ["eleven", "twenty-two", "one hundred thirty-three"]

== Требования
* Ruby 1.8.7 (совместимость с Ruby 1.9, JRuby и Rubinius);
* I18n 0.5.0 (рание версии не тестировались);
* Для тестирования библиотеки вам понадобится RSpec.
== Установка
Для установки:
== Installation / Установка

gem install numbers_and_words

=== Ruby on Rails
Существует два варианта использования numbers_and_words вместе с Rails:

1. Установка gem

==== Rails 3
В файле Gemfile сделайте ссылку на gem numbers_and_words:

gem 'numbers_and_words'

Чтобы установить gem, используйте команду

bundle install

==== Rails 2
В файле config/environment.rb сделайте ссылку на gem numbers_and_words:

Rails::Initializer.run do |config|
config.gem 'numbers_and_words'
end

Чтобы установить gem, используйте команду

rake gems:install.

2. Установка плагина

Для того, чтобы установить numbers_and_words как плагин к Rails, используйте команду

script/plugin install git://github.com/kslazarev/numbers_and_words.git
== License / Лицензия

==== Использование в irb
MIT License

require 'numbers_and_words'
== Bugs and Language Support / Поправки и Новые Языки

== Автор
Fork the project. Make your feature addition or bug fix with tests. Send a pull request. Bonus points for topic branches.

Для сообщений об ошибках, обнаруженных неточностях и предложений:
== Contact / Автор

* "Кирилл Лазарев" (mailto:k.s.lazarev@gmail.com)