Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to specs

  • Loading branch information...
commit c38307e53dc0acadcbccff49259b48cfca9644ca 1 parent 005232b
@juggy authored
View
3  .gitignore
@@ -1 +1,2 @@
-.DS_Store
+.DS_Store
+pkg
View
6 Gemfile
@@ -0,0 +1,6 @@
+source "http://rubygems.org"
+
+group :development do
+ gem "bundler", "~> 1.0.0"
+ gem "jeweler", "~> 1.5.2"
+end
View
16 Gemfile.lock
@@ -0,0 +1,16 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ git (1.2.5)
+ jeweler (1.5.2)
+ bundler (~> 1.0.0)
+ git (>= 1.2.5)
+ rake
+ rake (0.8.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.0)
+ jeweler (~> 1.5.2)
View
22 README.md
@@ -1,6 +1,6 @@
-# RemoteI18n #
+# Remote I18n #
-RemoteI18n helps developer export translated messages from a Rails server to a Javascript/HTML client application. More and more we need to use templates in javascript to create new HTML segments, but when you are building an I18n application you need to make sure that those segments contains the right language. This is what this project is for. For now it bundle the Rails translations into different javascript file ready for consumption.
+Remote I18n helps developer export translated messages from a Rails server to a Javascript/HTML client application. More and more we need to use templates in javascript to create new HTML segments, but when you are building an I18n application you need to make sure that those segments contains the right language. This is what this project is for. For now it bundle the Rails translations into different javascript file ready for consumption.
## Getting started
*For Rails 3 only*
@@ -15,21 +15,21 @@ RemoteI18n helps developer export translated messages from a Rails server to a J
end
The configuration can't be simpler
- - _name_ is the name of the resulting file in /public/javascripts
- - _i18n_path_ is the path to use in the Rails i18n module
- - _only_ is to specify languages, by default it is all configured ones
+- _name_ is the name of the resulting file in /public/javascripts
+- _i18n_path_ is the path to use in the Rails i18n module
+- _only_ is to specify languages, by default it is all configured ones
The output of this configuration would be:
- - /public/javascripts/date.en.js
- - /public/javascripts/date.fr-CA.js
- - /public/javascripts/errors.en.js
- - /public/javascripts/errors.fr-CA.js
+ - /public/javascripts/date.en.js
+ - /public/javascripts/date.fr-CA.js
+ - /public/javascripts/errors.en.js
+ - /public/javascripts/errors.fr-CA.js
In Javascript the _T_ object is created to access the translations:
- blank_error = T.errors.message.blank;
- january = T.date.month_names[1];
+ blank_error = T.errors.message.blank;
+ january = T.date.month_names[1];
## More Details
View
30 Rakefile
@@ -1,10 +1,26 @@
+require 'rubygems'
+require 'bundler'
+begin
+ Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+ $stderr.puts e.message
+ $stderr.puts "Run `bundle install` to install missing gems"
+ exit e.status_code
+end
+require 'rake'
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "remote_i18n/version"
-
-task :build do
- system "gem build remote_i18n.gemspec"
+
+require 'jeweler'
+Jeweler::Tasks.new do |gem|
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
+ gem.name = "remote_i18n"
+ gem.homepage = "http://github.com/juggy/remote_i18n"
+ gem.license = "MIT"
+ gem.summary = %Q{I18n for Javascript with Rails}
+ gem.description = %Q{RemoteI18n helps developer export translated messages from a Rails server to a Javascript/HTML client application. More and more we need to use templates in javascript to create new HTML segments, but when you are building an I18n application you need to make sure that those segments contains the right language. This is what this project is for. For now it bundle the Rails translations into different javascript file ready for consumption.}
+ gem.version = RemoteI18n::Version::STRING
+ gem.email = "julien@porkepic.com"
+ gem.authors = ["Julien Guimont"]
end
-
-task :release => :build do
- system "gem push remote_i18n-#{RemoteI18n::Version::STRING}"
-end
+Jeweler::RubygemsDotOrgTasks.new
View
24 remote_i18n.gemspec
@@ -1,24 +0,0 @@
-# -*- encoding: utf-8 -*-
-lib = File.expand_path('../lib/', __FILE__)
-$:.unshift lib unless $:.include?(lib)
-
-require 'remote_i18n/version'
-
-Gem::Specification.new do |s|
- s.name = "remote_i18n"
- s.version = RemoteI18n::Version::STRING
- s.platform = Gem::Platform::RUBY
- s.authors = ["Julien Guimont"]
- s.email = ["julien@porkepic.com"]
- s.extra_rdoc_files = [
- "LICENSE.md",
- "README.md"
- ]
- s.homepage = "http://github.com/juggy/remote_i18n"
- s.summary = "Remotely export rails translations to a javascript file"
-
- s.required_rubygems_version = ">= 1.3.6"
-
- s.files = Dir.glob("{lib}/**/*")
- s.require_path = 'lib'
-end
Please sign in to comment.
Something went wrong with that request. Please try again.