Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Stringer committed Mar 2, 2017
2 parents 229ee94 + 4f0331d commit 842d8d9
Show file tree
Hide file tree
Showing 90 changed files with 1,140 additions and 796 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## What I tried to do

* Fill this out!

## What I expected to happen

* Fill this out!

## What actually happened

* Fill this out!

## Versions of i18n, rails, and anything else you think is neccessary

* Fill this out!

----

Bonus points for providing an application or a small code example which reproduces the issue.

Thanks! :heart:
47 changes: 41 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
before_install:
- gem install bundler

rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- ree
- 2.1.8
- 2.2.4
- 2.3.1
- ruby-head
- rbx
- jruby

gemfile:
- ci/Gemfile.no-rails
- ci/Gemfile.rails-2.3.x
- ci/Gemfile.rails-3.x
- Gemfile
- gemfiles/Gemfile.rails-3.2.x
- gemfiles/Gemfile.rails-4.0.x
- gemfiles/Gemfile.rails-4.1.x
- gemfiles/Gemfile.rails-4.2.x
- gemfiles/Gemfile.rails-5.0.x
- gemfiles/Gemfile.rails-master

matrix:
exclude:
# Rails 5+ requires Ruby >= 2.2.2
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.rails-master
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-master
- rvm: 2.1.8
gemfile: gemfiles/Gemfile.rails-master
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.rails-5.0.x
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-5.0.x
- rvm: 2.1.8
gemfile: gemfiles/Gemfile.rails-5.0.x
# activesupport has a dependency on json, which does not build on this version
- rvm: ruby-head
gemfile: gemfiles/Gemfile.rails-4.1.x
# activesupport has a dependency on json, which does not build on this version
- rvm: ruby-head
gemfile: gemfiles/Gemfile.rails-4.2.x
allow_failures:
- rvm: 2.2
- rvm: rbx
- rvm: jruby
fast_finish: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# master

* `Hash#slice` ignores non existing keys.

# 0.7.0

* Drop support to Ruby 1.8.7 / REE
* Drop support to Rails 2.3 / 3.0 / 3.1
* Remove deprecated stuff:
- Setting `:default_exception_hander` Symbol to `I18n.exception_handler`.
- `normalize_translation_keys` in favor of `normalize_keys`.
- `:rescue_format` option on the exception handler.
- `enforce_available_locales` now defaults to true with no deprecation message.
1 change: 0 additions & 1 deletion Gemfile

This file was deleted.

8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gemspec

gem 'mocha'
gem 'test_declarative'
gem 'rake'
gem 'minitest'
21 changes: 17 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
PATH
remote: .
specs:
i18n (0.8.0.beta1)

GEM
remote: https://rubygems.org/
specs:
mocha (0.9.9)
rake
rake (0.8.7)
test_declarative (0.0.4)
metaclass (0.0.4)
minitest (5.10.1)
mocha (1.2.1)
metaclass (~> 0.0.1)
rake (11.3.0)
test_declarative (0.0.5)

PLATFORMS
java
ruby

DEPENDENCIES
i18n!
minitest
mocha
rake
test_declarative

BUNDLED WITH
1.13.6
61 changes: 19 additions & 42 deletions README.textile → README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
h1. Ruby I18n
# Ruby I18n

!https://secure.travis-ci.org/svenfuchs/i18n.png?branch=master(Build Status)!:http://travis-ci.org/svenfuchs/i18n
[![Build Status](https://api.travis-ci.org/svenfuchs/i18n.svg?branch=master)](https://travis-ci.org/svenfuchs/i18n)

Ruby Internationalization and localization solution.

Expand All @@ -22,7 +22,7 @@ Pluggable features:
* Cache
* Pluralization: lambda pluralizers stored as translation data
* Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
* Gettext support
* [Gettext support](https://github.com/svenfuchs/i18n/wiki/Gettext)
* Translation metadata

Alternative backends:
Expand All @@ -31,43 +31,20 @@ Alternative backends:
* ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
* KeyValue (uses active_support/json and cannot store procs)

For more information and lots of resources see: "http://ruby-i18n.org/wiki":http://ruby-i18n.org/wiki
For more information and lots of resources see [the 'Resources' page on the wiki](https://github.com/svenfuchs/i18n/wiki/Resources).

h2. Installation
## Installation

```
gem install i18n
```

h4. Rails version warning

On Rails < 2.3.6 the method I18n.localize will fail with MissingInterpolationArgument (issue "20":http://github.com/svenfuchs/i18n/issues/issue/20). Upgrade to Rails 2.3.6 or higher (2.3.8 preferably) is recommended.

h3. Installation on Rails < 2.3.5 (deprecated)

Up to version 2.3.4 Rails will not accept i18n gems > 0.1.3. There is an unpacked
gem inside of active_support/lib/vendor which gets loaded unless gem 'i18n', '~> 0.1.3'.
This requirement is relaxed in "6da03653":http://github.com/rails/rails/commit/6da03653

The new i18n gem can be loaded from vendor/plugins like this:

<pre>
def reload_i18n!
raise "Move to i18n version 0.2.0 or greater" if Rails.version > "2.3.4"

$:.grep(/i18n/).each { |path| $:.delete(path) }
I18n::Backend.send :remove_const, "Simple"
$: << Rails.root.join('vendor', 'plugins', 'i18n', 'lib').to_s
end
</pre>

Then you can `reload_i18n!` inside an i18n initializer.

h2. Tests
## Tests

You can run tests both with

* `rake test` or just `rake`
* run any test file directly, e.g. `ruby -Ilib -Itest test/api/simple_test.rb`
* run all tests with `ruby -Ilib -Itest test/all.rb`
* run any test file directly, e.g. `ruby -Ilib:test test/api/simple_test.rb`

You can run all tests against all Gemfiles with

Expand All @@ -85,21 +62,21 @@ as test methods) in test cases with different setups.
You can find the test cases that enforce the API in test/api. And you can find
the API definition test methods in test/api/tests.

All other test cases (e.g. as defined in test/backend, test/core\_ext) etc.
All other test cases (e.g. as defined in test/backend, test/core_ext) etc.
follow the usual test setup and should be easy to grok.

h2. Authors
## Authors

* "Sven Fuchs":http://www.artweb-design.de
* "Joshua Harvey":http://www.workingwithrails.com/person/759-joshua-harvey
* "Stephan Soller":http://www.arkanis-development.de
* "Saimon Moore":http://saimonmoore.net
* "Matt Aimonetti":http://railsontherun.com
* [Sven Fuchs](http://www.artweb-design.de)
* [Joshua Harvey](http://www.workingwithrails.com/person/759-joshua-harvey)
* [Stephan Soller](http://www.arkanis-development.de)
* [Saimon Moore](http://saimonmoore.net)
* [Matt Aimonetti](https://matt.aimonetti.net/)

h2. Contributors
## Contributors

http://github.com/svenfuchs/i18n/contributors
https://github.com/svenfuchs/i18n/graphs/contributors

h2. License
## License

MIT License. See the included MIT-LICENSE file.
18 changes: 2 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
require 'bundler/gem_tasks'
require 'rake/testtask'

task :default => [:test]

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = "#{File.dirname(__FILE__)}/test/all.rb"
t.pattern = "test/**/*_test.rb"
t.verbose = true
t.warning = true
end
Rake::Task['test'].comment = "Run all i18n tests"

# require "rake/gempackagetask"
# require "rake/clean"
# CLEAN << "pkg" << "doc" << "coverage" << ".yardoc"
#
# Rake::GemPackageTask.new(eval(File.read("i18n.gemspec"))) { |pkg| }
#
# begin
# require "yard"
# YARD::Rake::YardocTask.new do |t|
# t.options = ["--output-dir=doc"]
# t.options << "--files" << ["CHANGELOG.textile", "contributors.txt", "MIT-LICENSE"].join(",")
# end
# rescue LoadError
# end
12 changes: 9 additions & 3 deletions benchmark/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ en:
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
# Used in date_select and datime_select.
order: [ :year, :month, :day ]
order:
- :year,
- :month,
- :day

time:
formats:
Expand Down Expand Up @@ -131,7 +134,10 @@ en:
month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
# Used in date_select and datime_select.
order: [ :year, :month, :day ]
order:
- :year
- :month
- :day

time:
formats:
Expand All @@ -145,4 +151,4 @@ en:
array:
words_connector: ", "
two_words_connector: " and "
last_word_connector: ", and "
last_word_connector: ", and "
26 changes: 11 additions & 15 deletions benchmark/run.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/bin/ruby
#!/usr/bin/ruby
$:.unshift File.expand_path('../../lib', __FILE__)

require 'bundler/setup'
require 'i18n'
require 'benchmark'
require 'yaml'

DATA_STORES = ARGV.delete("-ds")
N = (ARGV.shift || 1000).to_i
YAML_HASH = YAML.load_file(File.expand_path("example.yml", File.dirname(__FILE__)))

Expand All @@ -16,20 +16,16 @@ module Backends
include I18n::Backend::InterpolationCompiler
end.new

if DATA_STORES
require 'rubygems'
require File.expand_path('../../test/test_setup/active_record', __FILE__)
require File.expand_path('../../test/test_setup/rufus_tokyo', __FILE__)

Test.setup_active_record
ActiveRecord = I18n::Backend::ActiveRecord.new if defined?(::ActiveRecord)

Test.setup_rufus_tokyo
TokyoCabinet = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new("*"), true) if defined?(::Rufus::Tokyo)
begin
require 'active_support'
KeyValue = I18n::Backend::KeyValue.new({}, true)
puts "Running KeyValue with ActiveSupport #{ActiveSupport::VERSION::STRING}"
rescue LoadError
puts 'Skipping KeyValue since ActiveSupport could not be loaded.'
end
end

ORDER = %w(Simple Interpolation ActiveRecord TokyoCabinet)
ORDER = %w(Simple Interpolation KeyValue)
ORDER.map!(&:to_sym) if RUBY_VERSION > '1.9'

module Benchmark
Expand Down Expand Up @@ -62,7 +58,7 @@ def self.measure_objects(n, &blk)
puts "=> #{backend_name}\n\n"

Benchmark.rt "store", 1 do
I18n.backend.store_translations *(YAML_HASH.to_a.first)
I18n.backend.store_translations(*YAML_HASH.to_a.first)
end

I18n.backend.translate :en, :first
Expand Down Expand Up @@ -114,4 +110,4 @@ def self.measure_objects(n, &blk)
end

puts "Running memoized benchmarks with N = #{N}\n\n"
(ORDER & Backends.constants).each(&benchmarker)
(ORDER & Backends.constants).each(&benchmarker)
5 changes: 0 additions & 5 deletions ci/Gemfile.no-rails

This file was deleted.

14 changes: 0 additions & 14 deletions ci/Gemfile.no-rails.lock

This file was deleted.

9 changes: 0 additions & 9 deletions ci/Gemfile.rails-2.3.x

This file was deleted.

Loading

0 comments on commit 842d8d9

Please sign in to comment.