From 15bb1d59c873357c0dc1f837d97a2aa3e5981c71 Mon Sep 17 00:00:00 2001 From: Michael Hagar Date: Wed, 22 Jul 2020 07:55:20 -0500 Subject: [PATCH] fix minor typos --- guides/source/i18n.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/source/i18n.md b/guides/source/i18n.md index 82fb587ab3..d6ab5b0e33 100644 --- a/guides/source/i18n.md +++ b/guides/source/i18n.md @@ -261,7 +261,7 @@ end With this approach you will not get a `Routing Error` when accessing your resources such as `http://localhost:3001/books` without a locale. This is useful for when you want to use the default locale when one is not specified. -Of course, you need to take special care of the root URL (usually "homepage" or "dashboard") of your application. A URL like `http://localhost:3001/nl` will not work automatically, because the `root to: "books#index"` declaration in your `routes.rb` doesn't take locale into account. (And rightly so: there's only one "root" URL.) +Of course, you need to take special care of the root URL (usually "homepage" or "dashboard") of your application. A URL like `http://localhost:3001/nl` will not work automatically, because the `root to: "dashboard#index"` declaration in your `routes.rb` doesn't take locale into account. (And rightly so: there's only one "root" URL.) You would probably need to map URLs like these: @@ -954,7 +954,7 @@ errors.attributes.name.blank errors.messages.blank ``` -This way you can provide special translations for various error messages at different points in your models inheritance chain and in the attributes, models, or default scopes. +This way you can provide special translations for various error messages at different points in your model's inheritance chain and in the attributes, models, or default scopes. #### Error Message Interpolation @@ -1159,7 +1159,7 @@ I18n.exception_handler = I18n::JustRaiseExceptionHandler.new This would re-raise only the `MissingTranslationData` exception, passing all other input to the default exception handler. -However, if you are using `I18n::Backend::Pluralization` this handler will also raise `I18n::MissingTranslationData: translation missing: en.i18n.plural.rule` exception that should normally be ignored to fall back to the default pluralization rule for English locale. To avoid this you may use additional check for translation key: +However, if you are using `I18n::Backend::Pluralization` this handler will also raise `I18n::MissingTranslationData: translation missing: en.i18n.plural.rule` exception that should normally be ignored to fall back to the default pluralization rule for English locale. To avoid this you may use an additional check for the translation key: ```ruby if exception.is_a?(MissingTranslation) && key.to_s != 'i18n.plural.rule'