Always enable localization fallback

(Gerhard Schlager) #1

First of all I’d like to say the localization fallback implemented by @riking is great.
But, as it is now, it’s really hard to debug localization problems, since the fallback isn’t used in development mode. So, Discourse behaves completely different in some situations while in development mode. Is this really necessary or can we always use the fallback?

For example, I was looking into the bug “Search help doesn’t work for some locales” and had to enable the fallback by manually editing the following lines.

Sidekiq / sending Email digests fails: MissingTranslationData
(Kane York) #2

This behavior was requested by @sam and I didn’t totally get the reasoning behind it. Can you explain it again?

(Sam Saffron) #3

Sorry for the blast from the past but the idea is that in dev we want to catch this stuff earlier so we would prefer to fail earlier :slight_smile:

(Angus McLeod) #4

Note: The logic preventing the fallback from working in development is now here:
discourse/js_locale_helper.rb at master · discourse/discourse · GitHub

To test the fallback in development, you need to:

  • comment out that first condition, i.e. if Rails.env.development?
  • rm -rf tmp and reload