From 705aacb981ab36d309320659bfeb800f22380e58 Mon Sep 17 00:00:00 2001 From: Arnold Roa Date: Thu, 11 May 2017 09:49:28 -0500 Subject: [PATCH 1/2] return a hash on model attributes --- lib/gettext_i18n_rails/model_attributes_finder.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gettext_i18n_rails/model_attributes_finder.rb b/lib/gettext_i18n_rails/model_attributes_finder.rb index f45f08e8..fd5d3e36 100644 --- a/lib/gettext_i18n_rails/model_attributes_finder.rb +++ b/lib/gettext_i18n_rails/model_attributes_finder.rb @@ -18,6 +18,7 @@ def store_model_attributes(options) end end f.puts "#DO NOT MODIFY! AUTOMATICALLY GENERATED FILE!" + f.puts "{}" end rescue puts "[Error] Attribute extraction failed. Removing incomplete file (#{file})" From d901367dd820719098a6802ded96ee83bcebbc5c Mon Sep 17 00:00:00 2001 From: Arnold Roa Date: Thu, 11 May 2017 09:56:30 -0500 Subject: [PATCH 2/2] fixes to README --- Readme.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 112dba28..c8765952 100644 --- a/Readme.md +++ b/Readme.md @@ -31,18 +31,25 @@ gem 'ruby_parser', :require => false, :group => :development Add the first language using: ```Bash -rake gettext:add_language[XX] +rake gettext:add_language[xx] ``` or ```Bash -LANGUAGE=[XX] rake gettext:add_language +LANGUAGE=[xx] rake gettext:add_language ``` -where XX is the [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 2-letter code for the language you want to create. +where `xx` is the lowercased [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 2-letter code for the language you want to create. -This will also create the `locale` directory (where the translations are being stored) and run `gettext:find` to find any strings marked for translation. +for example: + +```Bash +rake gettext:add_language[es] +``` + + +This will also create the `locales` directory (where the translations are being stored) and run `gettext:find` to find any strings marked for translation. You can, of course, add more languages using the same command. @@ -64,7 +71,7 @@ And in your application: ```Ruby # app/controllers/application_controller.rb class ApplicationController < ... - before_filter :set_gettext_locale + before_action :set_gettext_locale ``` Translating