From efb8a7a7b928c8075a20ea46d9ac657ef56a7faa Mon Sep 17 00:00:00 2001 From: Christopher Arrowsmith Date: Thu, 22 Sep 2011 01:18:22 +0100 Subject: Changed "en-UK" to "en-GB" Signed-off-by: Christopher Arrowsmith --- railties/guides/source/i18n.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 81d2ba9a56..45a069b0a3 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -91,7 +91,7 @@ This means, that in the +:en+ locale, the key _hello_ will map to the _Hello wor The I18n library will use *English* as a *default locale*, i.e. if you don't set a different locale, +:en+ will be used for looking up translations. -NOTE: The i18n library takes a *pragmatic approach* to locale keys (after "some discussion":http://groups.google.com/group/rails-i18n/browse_thread/thread/14dede2c7dbe9470/80eec34395f64f3c?hl=en), including only the _locale_ ("language") part, like +:en+, +:pl+, not the _region_ part, like +:en-US+ or +:en-UK+, which are traditionally used for separating "languages" and "regional setting" or "dialects". Many international applications use only the "language" element of a locale such as +:cs+, +:th+ or +:es+ (for Czech, Thai and Spanish). However, there are also regional differences within different language groups that may be important. For instance, in the +:en-US+ locale you would have $ as a currency symbol, while in +:en-UK+, you would have £. Nothing stops you from separating regional and other settings in this way: you just have to provide full "English - United Kingdom" locale in a +:en-UK+ dictionary. Various "Rails I18n plugins":http://rails-i18n.org/wiki such as "Globalize2":https://github.com/joshmh/globalize2/tree/master may help you implement it. +NOTE: The i18n library takes a *pragmatic approach* to locale keys (after "some discussion":http://groups.google.com/group/rails-i18n/browse_thread/thread/14dede2c7dbe9470/80eec34395f64f3c?hl=en), including only the _locale_ ("language") part, like +:en+, +:pl+, not the _region_ part, like +:en-US+ or +:en-GB+, which are traditionally used for separating "languages" and "regional setting" or "dialects". Many international applications use only the "language" element of a locale such as +:cs+, +:th+ or +:es+ (for Czech, Thai and Spanish). However, there are also regional differences within different language groups that may be important. For instance, in the +:en-US+ locale you would have $ as a currency symbol, while in +:en-GB+, you would have £. Nothing stops you from separating regional and other settings in this way: you just have to provide full "English - United Kingdom" locale in a +:en-GB+ dictionary. Various "Rails I18n plugins":http://rails-i18n.org/wiki such as "Globalize2":https://github.com/joshmh/globalize2/tree/master may help you implement it. The *translations load path* (+I18n.load_path+) is just a Ruby Array of paths to your translation files that will be loaded automatically and available in your application. You can pick whatever directory and translation file naming scheme makes sense for you. -- cgit v1.2.3 From 17ba60a724aad508327bf52212335420f4d81364 Mon Sep 17 00:00:00 2001 From: Waynn Lue Date: Fri, 23 Sep 2011 00:25:37 -0700 Subject: pluralize "locales" since that's what's used in other parts of the document, and add a missing "on" --- railties/guides/source/i18n.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/i18n.textile b/railties/guides/source/i18n.textile index 45a069b0a3..2d4cc13571 100644 --- a/railties/guides/source/i18n.textile +++ b/railties/guides/source/i18n.textile @@ -8,7 +8,7 @@ So, in the process of _internationalizing_ your Rails application you have to: * Ensure you have support for i18n * Tell Rails where to find locale dictionaries -* Tell Rails how to set, preserve and switch locale +* Tell Rails how to set, preserve and switch locales In the process of _localizing_ your application you'll probably want to do the following three things: @@ -16,7 +16,7 @@ In the process of _localizing_ your application you'll probably want to do the f * Abstract strings in your application into keyed dictionaries -- e.g. flash messages, static text in your views, etc. * Store the resulting dictionaries somewhere -This guide will walk you through the I18n API and contains a tutorial how to internationalize a Rails application from the start. +This guide will walk you through the I18n API and contains a tutorial on how to internationalize a Rails application from the start. endprologue. -- cgit v1.2.3 From 4b9b2f3d048906337d936ec6b85cd13a92b51448 Mon Sep 17 00:00:00 2001 From: Chris Kimpton Date: Mon, 26 Sep 2011 08:06:41 +0200 Subject: add some notes on setup for Active Record tests --- railties/guides/source/contributing_to_ruby_on_rails.textile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties') diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 30714e7e18..20263b1b37 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -120,6 +120,12 @@ The test suite of Active Record attempts to run four times, once for SQLite3, on WARNING: If you're working with Active Record code, you _must_ ensure that the tests pass for at least MySQL, PostgreSQL, and SQLite3. Subtle differences between the various adapters have been behind the rejection of many patches that looked OK when tested only against MySQL. +h5. Set up Database Configuration + +The Acitve Record test suite requires a custom config file: +activerecord/test/config.yml+ . An example is provided: +activerecord/test/config.example.yml+ - copy this and amend as needed for your environment. + +The SQLite3 config should work "as is". + h5. SQLite3 The gem +sqlite3-ruby+ does not belong to the "db" group indeed, if you followed the instructions above you're ready. This is how you run the Active Record test suite only for SQLite3: -- cgit v1.2.3 From d47c2c4620f0580390d2009dc8dedc07b9f4c3bd Mon Sep 17 00:00:00 2001 From: Chris Kimpton Date: Mon, 26 Sep 2011 08:17:28 +0200 Subject: Clarify that the Active Record config should just work automatically --- railties/guides/source/contributing_to_ruby_on_rails.textile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 20263b1b37..678df55d51 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -122,7 +122,11 @@ WARNING: If you're working with Active Record code, you _must_ ensure that the t h5. Set up Database Configuration -The Acitve Record test suite requires a custom config file: +activerecord/test/config.yml+ . An example is provided: +activerecord/test/config.example.yml+ - copy this and amend as needed for your environment. +The Acitve Record test suite requires a custom config file: +activerecord/test/config.yml+ . +An example is provided: +activerecord/test/config.example.yml+ - copy this and amend as needed for your environment. + +The above should happen automatically - so this section may be removed when the underlying issue that causes the file to be +missing/corrupt is resolved. The SQLite3 config should work "as is". -- cgit v1.2.3 From 51cc6e4f1cc17c461544a4b099deff5a579978c9 Mon Sep 17 00:00:00 2001 From: Chris Kimpton Date: Mon, 26 Sep 2011 09:21:12 +0200 Subject: Fixed typo that I added - doh. --- railties/guides/source/contributing_to_ruby_on_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index 678df55d51..dafeb8d85e 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -122,7 +122,7 @@ WARNING: If you're working with Active Record code, you _must_ ensure that the t h5. Set up Database Configuration -The Acitve Record test suite requires a custom config file: +activerecord/test/config.yml+ . +The Active Record test suite requires a custom config file: +activerecord/test/config.yml+ . An example is provided: +activerecord/test/config.example.yml+ - copy this and amend as needed for your environment. The above should happen automatically - so this section may be removed when the underlying issue that causes the file to be -- cgit v1.2.3 From 94ed1e24956c5d6d3482517d10134938d37e837d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hock=20Isaza?= Date: Mon, 26 Sep 2011 16:34:42 -0500 Subject: Alert about the new Bundler require for asset gems If you are coming from a Rails 3.0 application, you won't have the correct Bundler require statement. This will cause the gems under the `assets` group not to be available in the development and production environment. I think this is related to the issue #39 in rails-sass https://github.com/rails/sass-rails/issues/39 --- railties/guides/source/asset_pipeline.textile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index 586a9f46eb..3428c09bcd 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -247,9 +247,9 @@ h4. Preprocessing The file extensions used on an asset determine what preprocessing is applied. When a controller or a scaffold is generated with the default Rails gemset, a CoffeeScript file and a SCSS file are generated in place of a regular JavaScript and CSS file. The example used before was a controller called "projects", which generated an +app/assets/javascripts/projects.js.coffee+ and a +app/assets/stylesheets/projects.css.scss+ file. When these files are requested, they are processed by the processors provided by the +coffee-script+ and +sass-rails+ gems and then sent back to the browser as JavaScript and CSS respectively. - Additional layers of pre-processing can be requested by adding other extensions, where each extension is processed in a right-to-left manner. These should be used in the order the processing should be applied. For example, a stylesheet called +app/assets/stylesheets/projects.css.scss.erb+ is first processed as ERB, then SCSS and finally served as CSS. The same applies to a JavaScript file -- +app/assets/javascripts/projects.js.coffee.erb+ is processed as ERB, CoffeeScript and served as JavaScript. + Keep in mind that the order of these pre-processors is important. For example, if you called your JavaScript file +app/assets/javascripts/projects.js.erb.coffee+ then it is processed with the CoffeeScript interpreter first, which wouldn't understand ERB and therefore you would run into problems. h3. In Development @@ -636,3 +636,22 @@ group :assets do gem 'uglifier' end + +If you use the +assets+ group with Bundler, please make sure that your +config/application.rb+ has the following Bundler require statement. + + +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require *Rails.groups(:assets => %w(development test)) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end + + +Instead of the old Rails 3.0 one + + +# If you have a Gemfile, require the gems listed there, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(:default, Rails.env) if defined?(Bundler) + \ No newline at end of file -- cgit v1.2.3 From a775853d6aabaadcd343b2f61bcbc7c7e2c59363 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 28 Sep 2011 00:00:50 +0530 Subject: copy edit d47c2c4 --- railties/guides/source/contributing_to_ruby_on_rails.textile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile index dafeb8d85e..5848172510 100644 --- a/railties/guides/source/contributing_to_ruby_on_rails.textile +++ b/railties/guides/source/contributing_to_ruby_on_rails.textile @@ -122,13 +122,7 @@ WARNING: If you're working with Active Record code, you _must_ ensure that the t h5. Set up Database Configuration -The Active Record test suite requires a custom config file: +activerecord/test/config.yml+ . -An example is provided: +activerecord/test/config.example.yml+ - copy this and amend as needed for your environment. - -The above should happen automatically - so this section may be removed when the underlying issue that causes the file to be -missing/corrupt is resolved. - -The SQLite3 config should work "as is". +The Active Record test suite requires a custom config file: +activerecord/test/config.yml+. An example is provided in +activerecord/test/config.example.yml+ which can be copied and used as needed for your environment. h5. SQLite3 -- cgit v1.2.3