i18n_manylang_patch 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +39 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/i18n_manylang_patch.gemspec +19 -0
- data/lib/i18n_manylang_patch.rb +5 -0
- data/lib/i18n_manylang_patch/config.rb +14 -0
- data/lib/i18n_manylang_patch/i18n_manylang_patch.rb +34 -0
- data/lib/i18n_manylang_patch/version.rb +3 -0
- data/pkg/i18n_manylang_patch-0.0.2.gem +0 -0
- metadata +63 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in i18n_manylang_patch.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem "i18n"
|
7
|
+
|
8
|
+
group :development, :test do
|
9
|
+
gem "bundler", "1.2.3"
|
10
|
+
gem "jeweler", "1.8.3"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :text do
|
14
|
+
gem "shoulda", ">= 0"
|
15
|
+
end
|
16
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
i18n_manylang_patch (0.0.2)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (3.2.11)
|
10
|
+
i18n (~> 0.6)
|
11
|
+
multi_json (~> 1.0)
|
12
|
+
git (1.2.5)
|
13
|
+
i18n (0.6.1)
|
14
|
+
jeweler (1.8.3)
|
15
|
+
bundler (~> 1.0)
|
16
|
+
git (>= 1.2.5)
|
17
|
+
rake
|
18
|
+
rdoc
|
19
|
+
json (1.7.7)
|
20
|
+
multi_json (1.6.1)
|
21
|
+
rake (10.0.3)
|
22
|
+
rdoc (3.12.1)
|
23
|
+
json (~> 1.4)
|
24
|
+
shoulda (3.1.1)
|
25
|
+
shoulda-context (~> 1.0)
|
26
|
+
shoulda-matchers (~> 1.2)
|
27
|
+
shoulda-context (1.0.0)
|
28
|
+
shoulda-matchers (1.3.0)
|
29
|
+
activesupport (>= 3.0.0)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
bundler (= 1.2.3)
|
36
|
+
i18n
|
37
|
+
i18n_manylang_patch!
|
38
|
+
jeweler (= 1.8.3)
|
39
|
+
shoulda
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 masanao.matsubara
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# I18nManylangPatch
|
2
|
+
|
3
|
+
aad i18n gem search many lang
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'i18n_manylang_patch'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install i18n_manylang_patch
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'i18n_manylang_patch/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "i18n_manylang_patch"
|
8
|
+
gem.version = I18nManylangPatch::VERSION
|
9
|
+
gem.authors = ["baban"]
|
10
|
+
gem.email = ["babanba.n@gmail.com"]
|
11
|
+
gem.description = %q{This gem add translate language i18n gem}
|
12
|
+
gem.summary = %q{This gem add translate language i18n gem}
|
13
|
+
gem.homepage = "https://github.com/baban/i18n_manylang_patch"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module I18n
|
4
|
+
class<< self
|
5
|
+
alias :translate_old :translate
|
6
|
+
def translate(*args)
|
7
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
8
|
+
key = args.shift
|
9
|
+
backend = config.backend
|
10
|
+
locale = options.delete(:locale) || config.locale
|
11
|
+
handling = options.delete(:throw) && :throw || options.delete(:raise) && :raise # TODO deprecate :raise
|
12
|
+
|
13
|
+
raise I18n::ArgumentError if key.is_a?(String) && key.empty?
|
14
|
+
if key.is_a?(Array)
|
15
|
+
result = catch(:exception) do
|
16
|
+
key.map { |k| backend.translate(locale, k, options) }
|
17
|
+
end
|
18
|
+
else
|
19
|
+
locales = [locale,:en]
|
20
|
+
result = -> {
|
21
|
+
locales.map do |locale|
|
22
|
+
catch(:exception) do
|
23
|
+
ret = backend.translate(locale, key, options)
|
24
|
+
return ret if ret.is_a?(String)
|
25
|
+
ret
|
26
|
+
end
|
27
|
+
end.first
|
28
|
+
}.call
|
29
|
+
end
|
30
|
+
result.is_a?(MissingTranslation) ? handle_exception(handling, result, locale, key, options) : result
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: i18n_manylang_patch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- baban
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-03 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: This gem add translate language i18n gem
|
15
|
+
email:
|
16
|
+
- babanba.n@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- Gemfile.lock
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- i18n_manylang_patch.gemspec
|
28
|
+
- lib/i18n_manylang_patch.rb
|
29
|
+
- lib/i18n_manylang_patch/config.rb
|
30
|
+
- lib/i18n_manylang_patch/i18n_manylang_patch.rb
|
31
|
+
- lib/i18n_manylang_patch/version.rb
|
32
|
+
- pkg/i18n_manylang_patch-0.0.2.gem
|
33
|
+
homepage: https://github.com/baban/i18n_manylang_patch
|
34
|
+
licenses: []
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
hash: -1333797120776321028
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
hash: -1333797120776321028
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.8.10
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: This gem add translate language i18n gem
|
63
|
+
test_files: []
|