Problems with I18n.translations after upgrading to 2.3.0.beta9

סיכום מבוסס בינה מלאכותית

The user amotl reports a blank page issue on https://community.hiveeyes.org/ after upgrading to 2.3.0.beta9, with a JavaScript error indicating I18n.translations[I18n.currentLocale()].js.composer is undefined. The locale is set to en_US, but only en exists in I18n.translations. gerhard suggests switching the default locale to en or ensuring theme components include the required translation keys. amotl identifies DiscoTOC as the culprit, a theme component not deactivated via app.yml. gerhard clarifies that theme components must be updated in safe mode. amotl confirms updating the theme component resolved the issue, and amotl thanks the community for the swift help, noting the site is now operational and ready to install the Knowledge Base plugin.

Dear Discourse team,

we are currently trying to solve a problem on https://community.hiveeyes.org/. After upgrading to 2.3.0.beta9, the Discourse page stays blank - probably like Blank topics page when interface language is German - while the Javascript console yields the runtime error

TypeError: I18n.translations[I18n.currentLocale(...)].js.composer is undefined

After checking things a bit, it turns out that

I18n.currentLocale()
"en_US"

but it looks like en_US is not defined when looking at I18n.translations

I18n.translations
{
  en: Object { js: {…} }
}

Bummer!

Everything works fine when switching my personal account to plain “English” after navigating to https://community.hiveeyes.org/?safe_mode=no_custom, but we fear everyone will have “English (United States)” in her interface settings which was also the default setting for me. We also deactivated all plugins to make sure its not one of them who is the culprit.

Does someone have an idea what we have been running into here?

With kind regards,
Andreas.

Easiest solution: Switch the default locale to English (en instead of en_US).
Or make sure that your plugins and theme (components) ensure that the js.composer key actually exist. We recently fixed a similar issue in DiscoTOC - automatic table of contents - #82.

It really looks like DiscoTOC is also responsible here, as it this very line which raises the error

I18n.translations[I18n.currentLocale()].js.composer.contains_dtoc = I18n.t(themePrefix("topic_will_contain_a_table_of_contents"));

However, I don’t quite get it because I believed to have it deactivated from the list of plugins in containers/app.yml.

DiscoTOC is a theme component. You need to update it in safe mode.

Ah, it’s a theme component! I should probably update this and everything will be fine again. Sorry for the noise and thanks for bringing me on track!

That’s it! Of course it wasn’t in the list of plugins and updating the theme component as you suggested worked like a charm. Currently rebuilding with plugins activated.

Thank you so much!

Did we ever mention how awesome the whole Discourse team and community actually is?

With your help, we have been able to revive https://community.hiveeyes.org/ quickly after the last upgrade had some minor hiccups and we are now ready to start with https://meta.discourse.org/t/knowledge-base-plugin/115288 on https://community.hiveeyes.org/k/ – installing this plugin was the reason for the upgrade/rebuild.

Thanks again, @gerhard, @tobiaseigen, @angus and all others!