Is there a way to prevent .translation_missing class from appearing in views if the language is english? Since the english text is correct I don’t need to translate it.
Right now I added styles to mask span.translation_missing if the locale is default span, but I’d rather want it to not appear at all if the locale is :en
Update: Just to be clear, I do translations in .erb files, so say <%= t "Menu item" %> becomes <span class="translation_missing">Menu item<span> which is overkill. I just need it to leave the original string alone for :en locale
I don’t think there is a way to do this through the standard methods, but you could just add a patch like this:
Alternatively, if you don’t want to use a patch, you can also define your own method and catch the exception yourself:
See also this answer.
(I’ve updated both answers to return the translation string rather thank blank/nil.)