Commit Graph

112 Commits

Author SHA1 Message Date
Anne Johnson
acb4b46076 Update i18n guide to cover :zero key support in pluralization [ci skip] 2017-02-26 16:02:08 -05:00
Erol Fornoles
36176c51d3
Fix typo in I18n Guide [ci skip] 2017-02-17 16:38:38 +08:00
Rich Seviora
d4ddf7b72f Added warning for reserved YAML keywords.
Update i18n.md

Addressed Feedback
2017-01-30 15:02:01 -08:00
Hisashi Kamezawa
bb8e892ea0 update links of pluralization in i18n guide 2017-01-18 17:31:52 +09:00
Jari Jokinen
864ef6be9e Add instructions for available_locales [skip ci] 2017-01-04 12:39:30 +02:00
bogdanvlviv
5faa9a235c Add missing + around a some literals.
Mainly around `nil`

[ci skip]
2016-10-27 00:27:47 +03:00
Rasmus Kjellberg
e49444797e [ci skip] Broken links in documentation fix 2016-08-30 20:02:46 +02:00
Ian C. Anderson
fbaa5e390f i18n documentation for required belongs_to message
When you don't explicitly provide `optional: true` to a `belongs_to`
definition, rails adds a validation to ensure presence of the
`belongs_to` validation.

However, when the validation is added, it is added with a message key of
`:required`, which was not documented in the "Translations for Active
Record Models" section of the i18n guides.

Here are the lines that add the `:required` message:
c3e3577f9d/activerecord/lib/active_record/associations/builder/belongs_to.rb (L136-L138)

This commit adds the "non-optional association" validation to the table,
so rails users know how to override the message for this validation. The
default message is "must exist".
2016-08-17 18:19:59 -04:00
Malcolm Locke
97b5341d6a List names of error interpolation variables. 2016-08-05 11:39:47 +12:00
Kazuhiro NISHIYAMA
bd6d2ec604 Fix broken link 2016-07-15 21:31:33 +09:00
Vipul A M
1c030578d6
- ✂️ space in code to match previous defaults.
- Grammar edits.
2016-05-23 18:51:52 -07:00
Prathamesh Sonpatki
983fa3b29f
Update i18n guide about how to change locale and translations paths [ci skip]
- config/application.rb no longer has comments about how to specify load paths
  or change default locale after
  https://github.com/rails/rails/commit/28dcadc0140dfdeb.
2016-05-22 21:44:31 +08:00
Greg Molnar
71a3e6634c remove obsolete i18n links from guides [ci skip] 2016-03-10 17:01:03 +01:00
Mehmet Emin İNAÇ
804b4092e8 Fix small typo in Rails guides [ci skip] 2016-02-15 16:09:11 +02:00
David English
fc027e1faf corrects a typo 2015-12-21 18:07:49 -08:00
Genadi Samokovarov
c29fbd3c7a ApplicationRecord documentation pass
This is a pass over the documentation which fills the missing gaps of
`ApplicationRecord`.

[ci skip]
2015-12-17 11:56:35 +01:00
James Coleman
981fa97320 Clarify i18n active[model/record] key differences
I spent a decent amount of time the other day trying to figure out why my active model including class wasn't generating the properly localized validation messages, and a note like this would have saved me a lot of time.
2015-11-08 15:34:32 -05:00
tanmay3011
148d1217a1 [ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel sound 2015-10-06 23:34:05 +05:30
Thiago Augusto
c4c70322c4 Update i18n.md [ci skip] 2015-09-22 13:22:53 -03:00
Avner Cohen
aecfc9360f Update documentation to remove 'desirable' suggestion for what is not a clear cut approach 2015-09-16 11:58:43 +03:00
yui-knk
7a74d81916 [ci skip] Make clear what this method is
In this sentence, there are three candidates of `this method`

* default_url_options
* url_for
* helper method(s)

so make it clear.
2015-06-24 00:27:53 +09:00
Xavier Noria
7789dfe779 i18n guide: warn about default_url_options caching and locale selectors [ci skip] 2015-06-15 21:41:08 +02:00
Robin Dupret
27eccc27cb A few documentation tweaks [ci skip]
[Robin Dupret & Shunsuke Aida]
2015-06-07 14:53:24 +02:00
Evan Prothro
984a4db3c3 Enhance the "Passing Variables to Translations" part
Add more information about passing variables to translation definitions
and also merge this part with the "Interpolation" one as the latter
didn't bring any new information. Moreover, each one was referring to
the other for further information.

[ci skip]
2015-05-04 15:43:08 +02:00
Evan Prothro
eaa4378586 Updates various prose to the i18n guide
[ci skip]
2015-05-04 15:43:08 +02:00
Jon Atack
6345f31fbf Fix typos and improve the documentation
This is a squash of the following commits, from first to last:

-

Fix minor, random things I’ve come across lately that individually
did not seem worth making a PR for, so I saved them for one commit.

One common error is using “it’s” (which is an abbreviation of “it is”)
when the possessive “its” should be used for indicating possession.

-

Changes include the name of a test, so remove the `[skip ci]` (thanks @senny).

-

Line wrap the changes at 80 chars and add one more doc fix.

-

Add a missing line wrap in the Contributing to Ruby on Rails Guide.

-

Line wrap the `TIP` section in the Contributing to Ruby on Rails Guide as well.

Rendering the guide locally with `bundle exec rake guides:generate` did
not show any change in on-screen formatting after adding the line wrap.

The HTML generated is (extra line added to illustrate where the line
wrap takes place):

    <div class="info"><p>Please squash your commits into a single commit
when appropriate. This

    simplifies future cherry picks and also keeps the git log
clean.</p></div>

-

Squash commits.
2015-04-15 16:25:24 +05:30
Mehmet Emin İNAÇ
75c32edd9d change REQUEST_URI to PATH_INFO
request.env['REQUEST_URI'] returns full URI of the resource
request.env['PATH_INFO'] returns only path of the resource
2015-04-04 21:16:58 +03:00
Christian Ress
cd67d7eaa8 Added missing closing brace in sample code for safe HTML translations
Closes #19321. [ci skip]
2015-03-13 12:43:24 -03:00
Richard Venneman
29165739d9 Remove reference to workingwithrails.com since it is being retired 2015-02-27 22:18:53 +01:00
Bart
c2f59f37c6 Fix code sample for custom exception handler [ci skip] 2015-02-19 15:22:27 +01:00
Robin Dupret
1747c4e2ce Tiny documentation edits [ci skip] 2015-02-15 19:19:04 +01:00
Carlos Ramirez III
e17260ca91 Document lazy lookup behavior for controllers
Pull request #7082 added lazy lookup to controllers using the translate
method, but the documentation still stated that it was available for
views only.

[ci skip]
2015-02-03 21:03:41 -05:00
Wojciech Wnętrzak
3d78c8f59e Add missing options to Error Message Interpolation guide [CI skip] 2015-01-21 09:45:18 +01:00
Jared Fine
780be39955 Underscore typo [ci skip] 2015-01-16 15:08:52 -05:00
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Xavier Noria
7702974281 warn about reading guides in GitHub
References #18148.
2014-12-23 23:32:50 +01:00
yui-knk
61b39c0e39 [ci skip] fix class name 2014-11-29 10:06:40 +09:00
Gaurav Sharma
c6a06e8844 [ci skip] removing ruby-i18n.org/wiki link that is not available and using “gems” instead of plugins 2014-10-09 17:07:58 +05:30
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