Skip to content

Commit

Permalink
Partial back-port of c2d96d1 [ci skip]
Browse files Browse the repository at this point in the history
[Juanito Fatas + Robin Dupret]
  • Loading branch information
robin850 committed Jul 7, 2014
1 parent f699a69 commit 0dc6ebc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions guides/source/_welcome.html.erb
Expand Up @@ -15,10 +15,10 @@
</p>
<% end %>
<p>
The guides for Rails 4.0.x are available at <a href="http://guides.rubyonrails.org/v4.0.6/">http://guides.rubyonrails.org/v4.0.6/</a>.
The guides for Rails 4.0.x are available at <a href="http://guides.rubyonrails.org/v4.0.8/">http://guides.rubyonrails.org/v4.0.8/</a>.
</p>
<p>
The guides for Rails 3.2.x are available at <a href="http://guides.rubyonrails.org/v3.2.18/">http://guides.rubyonrails.org/v3.2.18/</a>.
The guides for Rails 3.2.x are available at <a href="http://guides.rubyonrails.org/v3.2.19/">http://guides.rubyonrails.org/v3.2.19/</a>.
</p>
<p>
The guides for Rails 2.3.x are available at <a href="http://guides.rubyonrails.org/v2.3.11/">http://guides.rubyonrails.org/v2.3.11/</a>.
Expand Down
16 changes: 8 additions & 8 deletions guides/source/command_line.md
Expand Up @@ -62,7 +62,7 @@ With no further work, `rails server` will run our new shiny Rails app:
$ cd commandsapp
$ bin/rails server
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-08-07 02:00:01] INFO WEBrick 1.3.1
Expand Down Expand Up @@ -290,7 +290,7 @@ If you wish to test out some code without changing any data, you can do that by
```bash
$ bin/rails console --sandbox
Loading development environment in sandbox (Rails 4.0.0)
Loading development environment in sandbox (Rails 4.1.4)
Any modifications you make will be rolled back on exit
irb(main):001:0>
```
Expand Down Expand Up @@ -377,13 +377,13 @@ About your application's environment
Ruby version 1.9.3 (x86_64-linux)
RubyGems version 1.3.6
Rack version 1.3
Rails version 4.1.1
Rails version 4.1.4
JavaScript Runtime Node.js (V8)
Active Record version 4.1.1
Action Pack version 4.1.1
Action View version 4.1.1
Action Mailer version 4.1.1
Active Support version 4.1.1
Active Record version 4.1.4
Action Pack version 4.1.4
Action View version 4.1.4
Action Mailer version 4.1.4
Active Support version 4.1.4
Middleware Rack::Sendfile, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x007ffd131a7c88>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag
Application root /home/foobar/commandsapp
Environment development
Expand Down
4 changes: 2 additions & 2 deletions guides/source/debugging_rails_applications.md
Expand Up @@ -279,7 +279,7 @@ Make sure you have started your web server with the option `--debugger`:
```bash
$ rails server --debugger
=> Booting WEBrick
=> Rails 4.1.1 application starting on http://0.0.0.0:3000
=> Rails 4.1.4 application starting on http://0.0.0.0:3000
=> Debugger enabled
...
```
Expand Down Expand Up @@ -535,7 +535,7 @@ TIP: You can use the debugger while using `rails console`. Just remember to `req

```
$ rails console
Loading development environment (Rails 4.1.1)
Loading development environment (Rails 4.1.4)
>> require "debugger"
=> []
>> author = Author.first
Expand Down
4 changes: 2 additions & 2 deletions guides/source/i18n.md
Expand Up @@ -438,11 +438,11 @@ TIP: Right now you might need to add some more date/time formats in order to mak

### Inflection Rules For Other Locales

Rails 4.0 allows you to define inflection rules (such as rules for singularization and pluralization) for locales other than English. In `config/initializers/inflections.rb`, you can define these rules for multiple locales. The initializer contains a default example for specifying additional rules for English; follow that format for other locales as you see fit.
Rails allows you to define inflection rules (such as rules for singularization and pluralization) for locales other than English. In `config/initializers/inflections.rb`, you can define these rules for multiple locales. The initializer contains a default example for specifying additional rules for English; follow that format for other locales as you see fit.

### Localized Views

Rails 2.3 introduces another convenient localization feature: localized views (templates). Let's say you have a _BooksController_ in your application. Your _index_ action renders content in `app/views/books/index.html.erb` template. When you put a _localized variant_ of this template: `index.es.html.erb` in the same directory, Rails will render content in this template, when the locale is set to `:es`. When the locale is set to the default locale, the generic `index.html.erb` view will be used. (Future Rails versions may well bring this _automagic_ localization to assets in `public`, etc.)
Let's say you have a _BooksController_ in your application. Your _index_ action renders content in `app/views/books/index.html.erb` template. When you put a _localized variant_ of this template: `index.es.html.erb` in the same directory, Rails will render content in this template, when the locale is set to `:es`. When the locale is set to the default locale, the generic `index.html.erb` view will be used. (Future Rails versions may well bring this _automagic_ localization to assets in `public`, etc.)

You can make use of this feature, e.g. when working with a large amount of static content, which would be clumsy to put inside YAML or Ruby dictionaries. Bear in mind, though, that any change you would like to do later to the template must be propagated to all of them.

Expand Down

0 comments on commit 0dc6ebc

Please sign in to comment.