hyperstack icon indicating copy to clipboard operation
hyperstack copied to clipboard

Adds smarter lookup and fallback to I18n#t helper method

Open adamcreekroad opened this issue 3 years ago • 0 comments

Fixes #410

This adds fallback lookup to the I18n#t helper method available for components. It first checks the full namespace as it did before, but also will then look without the components namespace (if applicable), then lookup just the key provided, and finally return the key titleized if the translation is missing (this mimics the server-side behavior in views).

One thing to add - I had to manually perform the titleize call, because hyper-operation patches String#titleize to return itself with no modification.

adamcreekroad avatar Apr 30 '21 16:04 adamcreekroad