Better error message for missing translations #880

Closed
pehlert opened this Issue Feb 25, 2014 · 2 comments

Comments

Projects
None yet
3 participants

pehlert commented Feb 25, 2014

Hi all,

I am fairly new to LocomotiveCMS and this took me much longer to figure out than it would have been necessary. I am using the translate filter to localise my content.

However, when a translation is missing in the database, the user is confronted with the following exception, instead of a meaningful error message or an inline notice (like Rails does it):

NoMethodError in Locomotive::Public::PagesController#show

undefined method `values' for nil:NilClass
Rails.root: /Users/pascal/Projects/xxx

locomotive_cms (2.4.1) lib/locomotive/liquid/filters/translate.rb:19:in `translate'

I am very surprised that apparently nobody has noticed this issue before, which is why I'd like to hear your comments first before working on a patch. However, my strong suggestion is to just go with the Rails approach and show an inline element for missing translations à la <span class="translation-missing">Translation missing for key: 'my_translation_key'</span>

Looking forward to hear your opinion.

glebe commented Mar 19, 2014

Faced the same issue here ( #893 )
What I think would be useful is handling it in 2 ways:

1.Create translation keys from translations.yml upon deploy from wagon
2. Create additional tab (or just create blank translation keys and mark them appropriately) for missing translation keys found in templates so that they could be filled right away in cms

Owner

did commented Apr 1, 2014

very annoying behavior indeed. fixed in the master branch.

did closed this Apr 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment