Module | I18nSimpleBackendTestSetup |
In: |
vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb
|
# File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 28 28: def add_datetime_translations 29: @backend.store_translations 'de''de', { 30: :date => { 31: :formats => { 32: :default => "%d.%m.%Y", 33: :short => "%d. %b", 34: :long => "%d. %B %Y", 35: }, 36: :day_names => %w(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag), 37: :abbr_day_names => %w(So Mo Di Mi Do Fr Sa), 38: :month_names => %w(Januar Februar März April Mai Juni Juli August September Oktober November Dezember).unshift(nil), 39: :abbr_month_names => %w(Jan Feb Mar Apr Mai Jun Jul Aug Sep Okt Nov Dez).unshift(nil), 40: :order => [:day, :month, :year] 41: }, 42: :time => { 43: :formats => { 44: :default => "%a, %d. %b %Y %H:%M:%S %z", 45: :short => "%d. %b %H:%M", 46: :long => "%d. %B %Y %H:%M", 47: }, 48: :am => 'am', 49: :pm => 'pm' 50: }, 51: :datetime => { 52: :distance_in_words => { 53: :half_a_minute => 'half a minute', 54: :less_than_x_seconds => { 55: :one => 'less than 1 second', 56: :other => 'less than {{count}} seconds' 57: }, 58: :x_seconds => { 59: :one => '1 second', 60: :other => '{{count}} seconds' 61: }, 62: :less_than_x_minutes => { 63: :one => 'less than a minute', 64: :other => 'less than {{count}} minutes' 65: }, 66: :x_minutes => { 67: :one => '1 minute', 68: :other => '{{count}} minutes' 69: }, 70: :about_x_hours => { 71: :one => 'about 1 hour', 72: :other => 'about {{count}} hours' 73: }, 74: :x_days => { 75: :one => '1 day', 76: :other => '{{count}} days' 77: }, 78: :about_x_months => { 79: :one => 'about 1 month', 80: :other => 'about {{count}} months' 81: }, 82: :x_months => { 83: :one => '1 month', 84: :other => '{{count}} months' 85: }, 86: :about_x_years => { 87: :one => 'about 1 year', 88: :other => 'about {{count}} year' 89: }, 90: :over_x_years => { 91: :one => 'over 1 year', 92: :other => 'over {{count}} years' 93: } 94: } 95: } 96: } 97: end
def backend_reset_translations!
I18n::Backend::Simple::ClassMethods.send :class_variable_set, :@@translations, {}
end
# File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 23 23: def backend_get_translations 24: # I18n::Backend::Simple::ClassMethods.send :class_variable_get, :@@translations 25: @backend.instance_variable_get :@translations 26: end
# File vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb, line 11 11: def setup_backend 12: # backend_reset_translations! 13: @backend = I18n::Backend::Simple.new 14: @backend.store_translations 'en', :foo => {:bar => 'bar', :baz => 'baz'} 15: @locale_dir = File.dirname(__FILE__) + '/locale' 16: end