Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Template lookup now respect default locale and I18n fallbacks.
Given the following templates: mailer/demo.html.erb mailer/demo.en.html.erb mailer/demo.pt.html.erb Before this change for a locale that doesn't have its related file the `mailer/demo.html.erb` will be rendered even if `en` is the default locale. Now `mailer/demo.en.html.erb` has precedence over the file without locale. Also, it is possible to give a fallback. mailer/demo.pt.html.erb mailer/demo.pt-BR.html.erb So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be rendered given the right I18n fallback configuration. Fixes #11884.
- Loading branch information
1 parent
d9b080b
commit ecb1981bfd3ffaca3a3efd110fc85380ece8191d
Showing
6 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
* Template lookup now respect default locale and I18n fallbacks. | ||
|
||
Given the following templates: | ||
|
||
mailer/demo.html.erb | ||
mailer/demo.en.html.erb | ||
mailer/demo.pt.html.erb | ||
|
||
Before this change for a locale that doesn't have its related file the `mailer/demo.html.erb` will | ||
be rendered even if `en` is the default locale. | ||
|
||
Now `mailer/demo.en.html.erb` has precedence over the file without locale. | ||
|
||
Also, it is possible to give a fallback. | ||
|
||
mailer/demo.pt.html.erb | ||
mailer/demo.pt-BR.html.erb | ||
|
||
So if the locale is `pt-PT`, `mailer/demo.pt.html.erb` will be rendered given the right I18n | ||
fallback configuration. | ||
|
||
*Rafael Mendonça França* | ||
|
||
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md) for previous changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implicit with locale DE-AT TEXT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Implicit with locale DE HTML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters