i18n-country-translations 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,29 @@
1
+ = I18nCountryTranslations
2
+
3
+ I18n Country Translations - The purpose of this gem is to simply provide country translations. The gem is intended to be easy to combine with other gems that require i18n country translations so we can have common i18n country translation gem.
4
+
5
+ If you're doing anything with country names and translations, there's no need to reinvent the wheel and add your own translations. Just use this gem's country translations and skip the hassle of having to add and manage each country translation for each locale.
6
+
7
+ == Installation
8
+
9
+ Add to your Gemfile:
10
+
11
+ gem 'i18n-country-translations', :git => 'git@github.com:onomojo/i18n-country-translations.git'
12
+
13
+
14
+
15
+ You can easily start adding country translations to the locales with help from this script: https://gist.github.com/2128684
16
+ It will generate a new yml file that contains the country translations for the locale specified. Take the contents of this file and move it into the correct locale file.
17
+ So far only en-US.yml and es.yml have them added.
18
+
19
+
20
+
21
+
22
+ == Contributors
23
+ Brian McQuay - http://www.onomojo.com
24
+
25
+ == License
26
+ MIT or GPL
27
+
28
+ == Special thanks
29
+ https://github.com/svenfuchs/rails-i18n
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ require 'rake'
8
+ require 'rake/testtask'
9
+ require 'rbconfig'
10
+
11
+ task :test => 'test:all'
12
+
13
+ require 'rspec/core'
14
+ require 'rspec/core/rake_task'
15
+ RSpec::Core::RakeTask.new(:spec) do |spec|
16
+ spec.pattern = FileList['spec/**/*_spec.rb']
17
+ end
18
+
19
+ RSpec::Core::RakeTask.new("spec:unit") do |spec|
20
+ spec.pattern = 'spec/unit/**/*_spec.rb'
21
+ end
22
+
23
+ RSpec::Core::RakeTask.new("spec:integration") do |spec|
24
+ spec.pattern = 'spec/integration/**/*_spec.rb'
25
+ end
26
+
27
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
28
+ spec.pattern = 'spec/**/*_spec.rb'
29
+ spec.rcov = true
30
+ end
31
+
32
+ #require 'i18n-spec/tasks' # needs to be loaded after rspec
33
+
34
+ task :default => :spec
@@ -0,0 +1 @@
1
+ require 'i18n_country_translations'
@@ -0,0 +1 @@
1
+ require 'i18n_country_translations/railtie'
@@ -0,0 +1,25 @@
1
+ require 'rails'
2
+
3
+ module I18nCountryTranslations
4
+ class Railtie < ::Rails::Railtie #:nodoc:
5
+ initializer 'i18n-country-translations' do |app|
6
+ I18nCountryTranslations::Railtie.instance_eval do
7
+ pattern = pattern_from app.config.i18n.available_locales
8
+
9
+ add("rails/locale/#{pattern}.yml")
10
+ end
11
+ end
12
+
13
+ protected
14
+
15
+ def self.add(pattern)
16
+ files = Dir[File.join(File.dirname(__FILE__), '../..', pattern)]
17
+ I18n.load_path.concat(files)
18
+ end
19
+
20
+ def self.pattern_from(args)
21
+ array = Array(args || [])
22
+ array.blank? ? '*' : "{#{array.join ','}}"
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ module I18nCountryTranslations
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :i18n-country-translations do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: i18n-country-translations
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Brian McQuay
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-26 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70165225362100 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70165225362100
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec-rails
27
+ requirement: &70165225361600 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 2.7.0
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70165225361600
36
+ - !ruby/object:Gem::Dependency
37
+ name: i18n-spec
38
+ requirement: &70165225361140 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 0.1.1
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *70165225361140
47
+ - !ruby/object:Gem::Dependency
48
+ name: spork
49
+ requirement: &70165225360680 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0rc
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70165225360680
58
+ description: The purpose of this gem is to simply provide country translations. The
59
+ gem is intended to be easy to combine with other gems that require i18n country
60
+ translations so we can have common i18n country translation gem.
61
+ email:
62
+ - brian@onomojo.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - lib/i18n-country-translations.rb
68
+ - lib/i18n_country_translations/railtie.rb
69
+ - lib/i18n_country_translations/version.rb
70
+ - lib/i18n_country_translations.rb
71
+ - lib/tasks/i18n-country-translations_tasks.rake
72
+ - MIT-LICENSE
73
+ - Rakefile
74
+ - README.rdoc
75
+ homepage: https://github.com/onomojo/i18n-country-translations
76
+ licenses: []
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 1.8.10
96
+ signing_key:
97
+ specification_version: 3
98
+ summary: I18n Country Translations
99
+ test_files: []