| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
`I18n.translate` helper will wrap the missing translation keys
in a <span> tag only if `debug_missing_translation` configuration has
a truthy value. Default value is `true`. For example in `application.rb`:
# in order to turn off missing key wrapping
config.action_view.debug_missing_translation = false
|
|
|
|
|
|
| |
It's already represented in the key name. Demonstrate with a test.
Also test that the default isn't output.
|
| |
|
|
|
|
| |
supported by I18n.
|
|
|
|
| |
missing. Fixes #19967
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documentation previously stated that calling `translate(".foo")` was
equivalent to calling `I18n.translate("people.index.foo")` which is
incorrect due to the various other functions of the `translate` view
helper. This has been fixed.
Additionally, a note about forcing the view helper to re-raise
exceptions was added to the section detailing the handling of missing
translations.
Other cleanup includes:
* Consistent formatting of code
* Stop indenting bulleted list as a code sample
* Tighten some of the language
* Wrap at 80 characters.
|
|
|
|
|
|
|
|
|
|
|
| |
4.2.1 introduced a change to the way `translate`/`t` works with an
option of `default: [[]]`. In 4.2.0, this would give a default value of
`[]`, but in 4.2.1, it leads to a missing translation.
`default: [[]]` is again allowed for cases where a default of `[]` is
needed.
This addresses GitHub issue 19640.
|
|
|
|
| |
Strip nils out of default translations. Fixes #19419
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous version of rails(4.2.0) you can pass objects
to the default option of translation helper.
For example:
```ruby
t('foo', default: 1)
```
But on rails 4.2.1 version this kind of use stopped to work,
because started only to accept String types.
Now with this fix we can use orther value types on this
helper again.
|
|\
| |
| |
| |
| |
| | |
tigrish/fix_custom_i18n_exception_handler_regression
Fix I18n regression introduced by #13832
|
| |
| |
| |
| | |
Previously, when the `:raise` options was set to `false`, it would get overwritten to `true`, preventing custom exception handlers to be used.
|
|/
|
|
|
|
| |
Previously default translation keys that didn't end in `_html`, but came
after a missing key that ended in `_html` were being returned as
html_safe. Now they are not. Fixes #18257
|
|
|
|
| |
not required include ActionView::Helpers::TagHelper in test as well
|
| |
|
| |
|
|
|
|
| |
`options[:default]` and `options[:raise]` can be mistakenly added to the `options` hash. This can be a problem if you're reusing the same object.
|
|
|
|
|
| |
Add a config to setup whether raise exception for missing translation or
not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before ec16ba75a5493b9da972eea08bae630eba35b62f,
ActionView::Helpers::TranslationHelper#translate has raised errors with
specifying options[:raise] to true.
This should work by this fix:
begin
t(:"translations.missing", raise: true)
rescue I18n::MissingTranslationData
p :hello!
end
|
|
|
|
|
|
|
|
|
| |
i18n doesn't depend on active support which means it can't use our html_safe
code to do its escaping when generating the spans. Rather than try to sanitize
the output from i18n, just revert to our old behaviour of rescuing the error
and constructing the tag ourselves.
Fixes: CVE-2013-4491
|
|
|