Commit Graph

74 Commits

Author SHA1 Message Date
Xavier Noria a8eb601831 i18n guide: clarify interpolation rules in _html keys [ci skip] 2014-09-10 19:25:31 +02:00
Zachary Scott 7a3192e760 Merge pull request #16097 from nishantmodak/correct_md
correct markdown usage [ci skip]
2014-07-08 14:57:44 -07:00
Nishant Modak da5ac71885 correct markdown usage [ci skip] 2014-07-09 01:32:44 +05:30
Robin Dupret c2d96d14ec Update Rails versions [ci skip]
As discussed in #15304, we need to automate this process but for now,
having out-of-date versions is not ideal.

Since master targets 4.2.0, let's also update references to the last 4.1
version to 4.2.0.

Finally, let's remove mentions to versions when this is not needed. The
guides cover the features of the current version anyway.

[Juanito Fatas + Robin Dupret]
2014-07-07 14:22:25 +02:00
Mauro George d5e691a36e Pluralize params 2014-06-03 18:58:16 -03:00
Mauro George f5ae493299 Add default_i18n_subject to the guides
[ci skip]
2014-06-03 18:41:07 -03:00
Joshua Cody d5f2c5c20e Include label value in i18n attribute lookup
Previously, only the object and method name from the label tag were
used when looking up the translation for a label. If a value is
given for the label, this ought to be additionally used. The
following:

    # form.html.erb
    <%= form_for @post do |f| %>
      <%= f.label :type, value: "long" %>
    <% end %>

    # en.yml
    en:
      activerecord:
        attributes:
          post/long: "Long-form Post"

Used to simply return "long", but now it will return "Long-form
Post".
2014-05-06 14:37:28 -05:00
Kyle Heironimus 2c99e58208 [skip ci] Reorder i18n guide
Currently, the section called "How to store your custom translations"
has several subheadings that make no sense, such as "Translations for
ActiveRecord models." These make more sense under the "Overview of the
I18n API Features" section. I moved the "How to store..." section down
to the more appropriate sub-headings "Using Different Backends" and
"Using Different Exception Handlers" and removed the "Customize your
i18n setup" header.
2014-04-16 14:26:47 -05:00
Mike MacDonald 19b2bcc76d [ci skip] Avoid suggesting dangerous code in i18n guide
Calling `to_sym` on user input opens apps up to Denial of Service attacks, via the symbol table being expanded to consume vast swathes of memory.

It is a fairly common configuration to have DNS configured such that all subdomains route to your Rails app, in which case an attacker visits `www1.foo.com`, `www2.foo.com`, and so on until something gives.

It is far less likely to have this problem with TLDs, so that change was only for consistency.
2014-04-15 21:19:00 -04:00
Marcel Morgan 2ddbe87e7a Update documentation to use Rails.application instead
References to ``AppName::Application` removed in favour of ``Rails.application``
as generated with a new rails 4.1 app.

[ci skip]
2014-04-13 05:52:04 -05:00
Nikolay Shebanov 3f70c69437 Fix default_url_options example in i18n guide [ci skip] 2014-04-03 05:46:44 +04:00
sukolsak 69ba49dd85 Fix a grammatical error in the i18n guide [ci skip] 2014-03-12 15:03:04 -07:00
Xavier Noria e00ab2dab9 Revert "Don't symbolize tainted data." [ci skip]
Reason: i18n whitelists now locales without passing through symbols,
see https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L278.
Therefore, this snippet is no longer a good practice.

This reverts commit ec0664a6eb.
2014-02-11 17:18:19 +01:00
devlin zed ec0664a6eb Don't symbolize tainted data.
`I18n.locale=` symbolizes its argument, so passing it `params[:locale]`
allows one to DOS your application by visiting `...?locale=` URLS
repeatedly, with unique values, until the never-GCed symbols monopolize
the available memory.
2014-02-11 10:44:45 -05:00
edogawaconan b10f45ce75 Missing closing parenthesis. 2014-02-04 11:46:59 +09:00
T.J. Schuck 72bb3fc297 Change all "can not"s to the correct "cannot". 2014-01-03 17:02:31 -05:00
Vijay Dev a3b1105ada Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
Vijay Dev 1406630b21 Revert "Fix on-site markdown rendering [ci skip]"
This reverts commit 427db6b9d2.

[ci skip]
2013-12-19 22:50:25 +05:30
Vijay Dev f858691744 Revert "Underscore in markdown should be escaped with backslash [ci skip]"
This reverts commit b58f3a6417.

Reason: Discussion in b58f3a6417

[ci skip]
2013-12-19 22:50:17 +05:30
Ivan e838fa068f Added `absence` parameter to pluralization table
Added `absence` parameter to table in section `5.1.2 Error Message Interpolation`.
2013-12-16 10:13:35 +03:00
Harshad Sabne 427db6b9d2 Fix on-site markdown rendering [ci skip] 2013-11-28 00:03:51 +05:30
Harshad Sabne b58f3a6417 Underscore in markdown should be escaped with backslash [ci skip]
In the absence of proper escaping the first link was getting messed up and remaining part of the sentence (2nd link) was not displayed in the rendered markdown on the website though it was displaying correctly in the repository markdown file.
2013-11-26 23:25:34 +05:30
Harshad Sabne a4bba9ce8d Globalize has moved to a new repository
From (svenfuchs/globalize3) to (globalize/globalize)
2013-11-25 11:25:13 +05:30
Xavier Noria 17c29a0df0 Merge remote-tracking branch 'docrails/master'
Conflicts:
	activesupport/lib/active_support/core_ext/hash/deep_merge.rb
	activesupport/lib/active_support/core_ext/hash/keys.rb
2013-11-24 20:00:24 +01:00
Jacob Evan Shreve c796cc2ba7 Added a missing close parenthesis to i18n.md 2013-11-21 22:18:17 -05:00
Harshad Sabne deeeaef6d2 Fix broken Wikipedia link. 2013-11-13 20:48:40 +05:30
Vijay Dev 216ec8d559 Merge branch 'master' of github.com:rails/docrails 2013-11-07 23:32:47 +05:30
Derek Prior 0e41b0a87a Clarify HTML Safe Translations [ci-skip]
I think it's confusing to say "Use them in views without escaping." We
use all keys in views without escaping - the escaping is done for us
automatically _unless_ we call html_safe or the key ends in _html.
2013-11-05 11:16:04 -05:00
Jay Hayes 614b203e1d Fixes typo 2013-10-20 19:51:19 -05:00
Jay Hayes da1d2fb483 Update I18n guide to note the additional features of the `translate` view helper 2013-10-19 10:33:47 -05:00
Grayson Wright 52f3717569 [Documentation] Add a missing validation to I18n docs
The guide was missing a description of the error message
interpolation for validates_numericality_of with
the :only_integer option.
2013-09-24 17:07:57 -04:00
Juanito Fatas 1355956d6f [ci skip] Fix links in section 5.3 of i18n.md
Now all links point to the correct line number.
2013-09-10 01:48:51 +08:00
Juanito Fatas 451f433205 [ci skip] Add missing setting locale code snippet.
This is for 3 Internationalizing your Application of i18n.md.

Missing the code as mentioned in 2.3, setting locale.

Without this, the example to add config/locales/pirate.yml will not work.
2013-09-10 01:48:44 +08:00
Juanito Fatas 0096b1535d [ci skip] Change link name of Rails i18n wiki.
Actually it's Ruby i18n link.
2013-09-09 14:12:02 +08:00
Paul Nikitochkin 2c8bc2cdcd Use Ruby on Rails Coding Conventions for code examples in the guides
* Indent after private/protected
* Ruby >= 1.9 syntax for hashes
* Prefer method { do_stuff } instead of method{do_stuff} for single-line blocks.

[ci skip]
2013-09-06 21:42:29 +03:00
Xavier Noria b77f25cb84 cleans the guides sources from fancy non-ASCII stuff 2013-08-23 17:59:11 +02:00
Sadjow Leão 23c5d6d9ad Add plural form example for AR I18n section [ci skip] 2013-08-13 00:06:03 -03:00
Iain Beeston 78f953dff8 Updated the guide to say that the localisation file for validation messages is in activemodel, not activerecord 2013-08-03 21:39:46 +10:00
Wojciech Wnętrzak ce757c4c7e Added missing closing bracket for markdown url in guides [ci skip] 2013-08-01 12:21:21 +02:00
Ankit Gupta 4509f9eaed Fixing the broken URL [skip ci] 2013-07-29 14:24:55 +01:00
Vijay Dev 69e7e6ba89 Merge branch 'master' of github.com:rails/docrails 2013-07-06 00:08:40 +05:30
Mihail Evsyukov 867138aa99 Specify request method in guides [ci skip] 2013-07-04 23:45:58 +03:00
Robin Dupret 82551712b3 Complete a sentence in i18n guide's introduction
Add a list of what will be covered into this guide
2013-06-30 12:34:46 +02:00
Wouter van Lelyveld 8c0fc98214 Fixing links to accept_language plugin/middleware 2013-06-27 09:18:52 +02:00
Rajarshi Das 931df6da30 fix the path of action view from actionpack/lib/action_view => actionview/lib/action_view 2013-06-21 16:56:43 +05:30
Sunny Ripert 70b302b189 Remove double spaces in code examples 2013-05-28 14:38:02 +02:00
Prathamesh Sonpatki 730dd1a96b Github -> GitHub [ci skip] 2013-05-05 17:56:24 +05:30
hughkelsey 3c530dbc77 Added missing ')' on routing_filter link 2013-04-23 12:29:11 -07:00
Yves Senn c918298c8e describe Action Mailer I18n subject lookup 2013-04-04 13:22:12 +02:00
Carlos Antonio da Silva 2bca2f6418 Revert "updating i18n guide with locale config location."
This reverts commit 4690290891.
2013-01-22 09:28:07 -02:00