Skip to content

Instantly share code, notes, and snippets.

@daniel-rikowski
Last active May 7, 2017 15:55
Show Gist options
  • Save daniel-rikowski/0dc50fe88b6d6f2309eaf33af16a6d92 to your computer and use it in GitHub Desktop.
Save daniel-rikowski/0dc50fe88b6d6f2309eaf33af16a6d92 to your computer and use it in GitHub Desktop.
de:
customer: Kunde
welcome: Willkommen, %{user}
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'i18n', '0.8.1' # Broken
# gem 'i18n', '0.8.0' # Works
end
class Customer
def to_s
I18n.translate(:customer)
end
end
I18n.available_locales = %w(de de-DE)
I18n.locale = 'de-DE'
I18n.load_path = [File.join(__dir__, 'de.yml')]
I18n::Backend::Simple.include(I18n::Backend::Fallbacks)
I18n::Locale::Tag.implementation = I18n::Locale::Tag::Simple
puts I18n.translate(:welcome, user: Customer.new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment