russian 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.1.2 - 4.11.2008
2
+
3
+ Fixed I18n.load_path ordering, translations shipped with russian gem will no longer overwrite your own translations (thanks Dmitrij Smalko for bugreport).
4
+
5
+ Поправлено добавление переводов russian в I18n.load_path, теперь переводы из russian не будут замещать ваши собственные переводы (спасибо Dmitrij Smalko за обнаружение ошибки).
6
+
1
7
  === 0.1.1 - 24.11.2008
2
8
 
3
9
  Added number.human.storage_units translation key (Rails Edge).
@@ -273,7 +273,7 @@ end
273
273
  @person = Person.find(1)
274
274
  # => #<Person id: 1, name: "Дональд Кнут">
275
275
 
276
- <%= link_to(@person.name, person_path %>
276
+ <%= link_to(@person.name, person_path(@person)) %>
277
277
  # => <a href="/person/1-donald-knut">Дональд Кнут</a>
278
278
  </code></pre>
279
279
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rubygems/specification'
5
5
  require 'date'
6
6
 
7
7
  GEM = "russian"
8
- GEM_VERSION = "0.1.1"
8
+ GEM_VERSION = "0.1.2"
9
9
  AUTHOR = "Yaroslav Markin"
10
10
  EMAIL = "yaroslav@markin.net"
11
11
  HOMEPAGE = "http://github.com/yaroslav/russian/"
data/TODO CHANGED
@@ -9,7 +9,4 @@ TODO
9
9
 
10
10
  Questionable
11
11
  ============
12
- * integration spec coverage for actionview locale
13
- * integration spec coverage for activerecord locale
14
- * integration spec coverage for activesupport locale
15
12
  * integration specs for rails hacks
@@ -25,7 +25,7 @@ module Russian
25
25
  module VERSION
26
26
  MAJOR = 0
27
27
  MINOR = 1
28
- TINY = 1
28
+ TINY = 2
29
29
 
30
30
  STRING = [MAJOR, MINOR, TINY].join('.')
31
31
  end
@@ -48,9 +48,10 @@ module Russian
48
48
  # Init Russian i18n: set custom backend, set default locale to Russian locale, load all translations
49
49
  # shipped with library.
50
50
  def init_i18n
51
+ old_load_path = I18n.load_path
51
52
  I18n.backend = Russian.i18n_backend_class.new
52
53
  I18n.default_locale = LOCALE
53
- locale_files.each { |file| I18n.load_path << file }
54
+ I18n.load_path = locale_files + old_load_path
54
55
  end
55
56
 
56
57
  # See I18n::translate
@@ -0,0 +1,4 @@
1
+ ru:
2
+ date:
3
+ formats:
4
+ default: "override"
@@ -37,6 +37,12 @@ describe Russian do
37
37
  I18n.t(:foo, :locale => :'en').should == "bar"
38
38
  end
39
39
 
40
+ it "should keep existing :ru translations while switching backends" do
41
+ I18n.load_path << File.join(File.dirname(__FILE__), 'fixtures', 'ru.yml')
42
+ Russian.init_i18n
43
+ I18n.t(:'date.formats.default', :locale => :'ru').should == "override"
44
+ end
45
+
40
46
  it "should set default locale to Russian locale" do
41
47
  Russian.init_i18n
42
48
  I18n.default_locale.should == Russian.locale
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Markin
@@ -9,7 +9,7 @@ autorequire: russian
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-24 00:00:00 +03:00
12
+ date: 2008-12-04 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -85,6 +85,7 @@ files:
85
85
  - lib/vendor/i18n_label/uninstall.rb
86
86
  - spec/fixtures
87
87
  - spec/fixtures/en.yml
88
+ - spec/fixtures/ru.yml
88
89
  - spec/i18n
89
90
  - spec/i18n/locale
90
91
  - spec/i18n/locale/datetime_spec.rb