Menu

Do not show I18n missing translation tooltips in production

Problem:
Lots of stuff does not need any translation, so we simply leave it untranslated (e.g. firstname shows as Firstname). But this leaves ugly “missing translation” spans in out html.
Instead of entering senseless translations for everything thats missing, we simply deactivate the tooltips in production, while also avoiding raising/rescuing theses MissingTranslation errors to improve performance(rescue/raise is not cheap).

3 thoughts on “Do not show I18n missing translation tooltips in production”

many thanks for this solution it helped me alot translating my current project
but it is missing one trick
the default variable should be only the last word of translatation part
so we need to add one line after declare defualt variable
default = default.split(“.”).last