1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

13 commits

Author SHA1 Message Date
Rafael Mendonça França
7815fe4634 Merge pull request #19421 from jcoyne/translate_defaults_with_nil
Strip nils out of default translations. Fixes #19419
2015-03-20 18:00:01 -03:00
Ulisses Almeida
362557eb41 Fix regression when passing a value different of String.
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.
2015-02-26 19:04:00 -03:00
Rafael Mendonça França
d76bf34b04 Merge pull request #17676 from tigrish/fix_custom_i18n_exception_handler_regression
Fix I18n regression introduced by #13832
2015-01-05 14:35:50 -03:00
Justin Coyne
fab50c130b Unsafe default translations should not be marked html_safe
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
2015-01-02 17:07:01 -06:00
Christopher Dell
4dbce79e95 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.
2014-11-19 16:33:50 +01:00
Rajarshi Das
ab2ace6bbe fix the undefined method content_tag #15245
not required include ActionView::Helpers::TagHelper in test as well
2014-09-06 12:09:01 +05:30
Akira Matsuda
1a299b6ca6 Missing ActiveSupport require for calling String#first 2014-08-14 01:06:34 +09:00
Carlos Antonio da Silva
c4c5801bd9 Fix assertion order and ✂️ extra spaces 2014-05-13 12:09:11 -03:00
Josep Jaume Rey
6caf3ab51b Dup options hash to prevent modifications
`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.
2014-05-13 14:13:36 +02:00
Kassio Borges
433628a45c Rails config for raise on missing translations
Add a config to setup whether raise exception for missing translation or
not.
2014-01-27 08:03:46 -02:00
Shota Fukumori (sora_h)
c1d5477b63 Escalate missing error when :raise is true
Before ec16ba75a5,
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
2013-12-05 09:20:58 +09:00
Michael Koziarski
0c7ac34aed Stop using i18n's built in HTML error handling.
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
2013-12-02 16:42:16 -08:00
Piotr Sarnacki
0d6e8edc2a Move actionpack/lib/action_view* into actionview/lib 2013-06-20 17:23:15 +02:00
Renamed from actionpack/lib/action_view/helpers/translation_helper.rb (Browse further)