From 1c94d89c6dcecf8f7622faa1c9aa4f46f8af30f4 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 7 Feb 2012 14:48:27 -0500 Subject: [PATCH] added I18n support --- README.markdown | 16 ++++++++++++++++ bootstrap_forms.gemspec | 2 +- lib/bootstrap_forms.rb | 2 +- lib/bootstrap_forms/{railtie.rb => engine.rb} | 6 +----- 4 files changed, 19 insertions(+), 7 deletions(-) rename lib/bootstrap_forms/{railtie.rb => engine.rb} (53%) diff --git a/README.markdown b/README.markdown index bb5d3d0..f88b4f9 100644 --- a/README.markdown +++ b/README.markdown @@ -156,6 +156,22 @@ You can add as many options to any form helper tag. If they are interpreted by B +Internationalization/Custom Errors +---------------------------------- +As of `1.0.2`, `bootstrap_forms` supports I18n! More support is being added, but you can change the error header and cancel button like this: + +```yaml +# config/locales/en.yml +en: + bootstrap_forms: + errors: + header: 'Your %{model} is wrong!' + buttons: + cancel: 'Forget it!' +``` + +Obviously you can also change to a different `lang.yml` file and use the same syntax. + Contributing ------------ I'm pretty dam active on github. Fork and submit a pull request. Most of my pull requests are merged the same day. Make sure you: diff --git a/bootstrap_forms.gemspec b/bootstrap_forms.gemspec index b4cb1fc..8ee6eb9 100644 --- a/bootstrap_forms.gemspec +++ b/bootstrap_forms.gemspec @@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__) Gem::Specification.new do |s| s.name = "bootstrap_forms" - s.version = "1.0.1" + s.version = "1.0.2" s.author = "Seth Vargo" s.email = "sethvargo@gmail.com" s.homepage = "https://github.com/sethvargo/bootstrap_forms" diff --git a/lib/bootstrap_forms.rb b/lib/bootstrap_forms.rb index fd3ce00..baa0e00 100644 --- a/lib/bootstrap_forms.rb +++ b/lib/bootstrap_forms.rb @@ -1 +1 @@ -require 'bootstrap_forms/railtie' if defined?(Rails) \ No newline at end of file +require 'bootstrap_forms/engine' if defined?(Rails) \ No newline at end of file diff --git a/lib/bootstrap_forms/railtie.rb b/lib/bootstrap_forms/engine.rb similarity index 53% rename from lib/bootstrap_forms/railtie.rb rename to lib/bootstrap_forms/engine.rb index bb283df..b2398b3 100644 --- a/lib/bootstrap_forms/railtie.rb +++ b/lib/bootstrap_forms/engine.rb @@ -1,11 +1,7 @@ module BootstrapForms - class Railtie < ::Rails::Railtie + class Engine < ::Rails::Engine config.after_initialize do |app| require 'bootstrap_forms/initializer' end - - initializer 'bootstrap_forms.initialize' do |app| - - end end end \ No newline at end of file