Raise on missing translations (unify controllers and views)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Raise on missing translations (unify controllers and views)

Kevin Sjöberg
I'm on a mission to unify the logic for raise_on_missing_translation between controllers and views. Currently this is scoped to ActionView. I'm proposing that we move the config option to the I18n scope, giving us config.i18n.raise_on_missing_translations and thus deprecating config.action_view.raise_on_missing_translations. We then update AbstractController#translate and TranslationHelper#translate to use the new config option and raise errors accordingly.

Since I'm not usually contributing to Rails I might overlook some technical or architectural aspects of the problem. Would love some feedback on the approach I'm taking. If all sounds good, I will begin working on a pull request.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Raise on missing translations (unify controllers and views)

Rafael Mendonça França
I'm positive to adding such generic option.

I18n already have the `transalate!` method to raise an error if the translation is missing maybe we should use it in the Rails wrappers?

On Mon, May 23, 2016 at 7:59 PM Kevin Sjöberg <[hidden email]> wrote:
I'm on a mission to unify the logic for raise_on_missing_translation between controllers and views. Currently this is scoped to ActionView. I'm proposing that we move the config option to the I18n scope, giving us config.i18n.raise_on_missing_translations and thus deprecating config.action_view.raise_on_missing_translations. We then update AbstractController#translate and TranslationHelper#translate to use the new config option and raise errors accordingly.

Since I'm not usually contributing to Rails I might overlook some technical or architectural aspects of the problem. Would love some feedback on the approach I'm taking. If all sounds good, I will begin working on a pull request.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Raise on missing translations (unify controllers and views)

Brian Salomaki
I just found this issue after noticing that raise_on_missing_translations wasn't working for a call to translate within app/mailers.

Kevin, did you make any progress on the pull request? I didn't find anything in Github.

-brian

On Monday, May 23, 2016 at 6:13:48 PM UTC-5, Rafael Mendonça França wrote:
I'm positive to adding such generic option.

I18n already have the `transalate!` method to raise an error if the translation is missing maybe we should use it in the Rails wrappers?

On Mon, May 23, 2016 at 7:59 PM Kevin Sjöberg <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="EFqEgb2KAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">kev.s...@...> wrote:
I'm on a mission to unify the logic for raise_on_missing_translation between controllers and views. Currently this is scoped to ActionView. I'm proposing that we move the config option to the I18n scope, giving us config.i18n.raise_on_missing_translations and thus deprecating config.action_view.raise_on_missing_translations. We then update AbstractController#translate and TranslationHelper#translate to use the new config option and raise errors accordingly.

Since I'm not usually contributing to Rails I might overlook some technical or architectural aspects of the problem. Would love some feedback on the approach I'm taking. If all sounds good, I will begin working on a pull request.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="EFqEgb2KAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-co...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="EFqEgb2KAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
Visit this group at <a href="https://groups.google.com/group/rubyonrails-core" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/rubyonrails-core&#39;;return true;">https://groups.google.com/group/rubyonrails-core.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
F D
Reply | Threaded
Open this post in threaded view
|

Re: Raise on missing translations (unify controllers and views)

F D
PR for this feature https://github.com/rails/rails/pull/31571

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.