Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
708 additions
and
829 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Declare your gem's dependencies in i18n-country-translations.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# jquery-rails is used by the dummy application | ||
gem "jquery-rails" | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
|
||
# To use debugger | ||
# gem 'ruby-debug19', :require => 'ruby-debug' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,29 @@ | ||
= I18nCountryTranslations | ||
|
||
This project rocks and uses MIT-LICENSE. | ||
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. | ||
|
||
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. | ||
|
||
== Installation | ||
|
||
Add to your Gemfile: | ||
|
||
gem 'i18n-country-translations', :git => 'git@github.com:onomojo/i18n-country-translations.git' | ||
|
||
|
||
|
||
You can easily start adding country translations to the locales with help from this script: https://gist.github.com/2128684 | ||
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. | ||
So far only en-US.yml and es.yml have them added. | ||
|
||
|
||
|
||
|
||
== Contributors | ||
Brian McQuay - http://www.onomojo.com | ||
|
||
== License | ||
MIT or GPL | ||
|
||
== Special thanks | ||
https://github.com/svenfuchs/rails-i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
$:.push File.expand_path("../lib", __FILE__) | ||
|
||
# Maintain your gem's version: | ||
require "i18n-country-translations/version" | ||
require "i18n_country_translations/version" | ||
|
||
# Describe your gem and declare its dependencies: | ||
Gem::Specification.new do |s| | ||
s.name = "i18n-country-translations" | ||
s.version = I18nCountryTranslations::VERSION | ||
s.authors = ["TODO: Your name"] | ||
s.email = ["TODO: Your email"] | ||
s.homepage = "TODO" | ||
s.summary = "TODO: Summary of I18nCountryTranslations." | ||
s.description = "TODO: Description of I18nCountryTranslations." | ||
s.authors = ["Brian McQuay"] | ||
s.email = ["brian@onomojo.com"] | ||
s.homepage = "https://github.com/onomojo/i18n-country-translations" | ||
s.summary = "I18n Country Translations" | ||
s.description = "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." | ||
|
||
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"] | ||
s.test_files = Dir["test/**/*"] | ||
|
||
s.add_dependency "rails", "~> 3.2.2" | ||
|
||
s.add_development_dependency "sqlite3" | ||
s.add_development_dependency "rspec-rails", ">= 2.7.0" | ||
s.add_development_dependency "i18n-spec", ">= 0.1.1" | ||
s.add_development_dependency "spork", "~> 1.0rc" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
module I18nCountryTranslations | ||
end | ||
require 'i18n_country_translations' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'i18n_country_translations/railtie' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require 'rails' | ||
|
||
module I18nCountryTranslations | ||
class Railtie < ::Rails::Railtie #:nodoc: | ||
initializer 'i18n-country-translations' do |app| | ||
I18nCountryTranslations::Railtie.instance_eval do | ||
pattern = pattern_from app.config.i18n.available_locales | ||
|
||
add("rails/locale/#{pattern}.yml") | ||
end | ||
end | ||
|
||
protected | ||
|
||
def self.add(pattern) | ||
files = Dir[File.join(File.dirname(__FILE__), '../..', pattern)] | ||
I18n.load_path.concat(files) | ||
end | ||
|
||
def self.pattern_from(args) | ||
array = Array(args || []) | ||
array.blank? ? '*' : "{#{array.join ','}}" | ||
end | ||
end | ||
end |
File renamed without changes.
Oops, something went wrong.