Blank topics page when interface language is German

Since this morning, I’m getting a blank page when I visit meta.discouse.org as long as I’m using German as interface language. I can’t test this anywhere else right now (try.discourse.org doesn’t allow users to change the interface language), but it’s definitely a problem here on meta.

Steps to reproduce:

  • Go to the user preferences
  • Change the interface language to “de”
  • Go back to the topic list and refresh the page

It seems to work with “ru”, but it looks like “fr” doesn’t work either.

4 Likes

Getting the error Cannot set property ‘bugs’ of undefined’,

I18n.translations.en.js.filters.bugs = { title: "Bugs", help: "Open Bugs" };

Yeah, that error has been there for ages. :wink:
Must be something else.

I just updated my forum and everything works fine there. Everything works properly in my development environment too.

1 Like

Meta seems to be using this customization to create the ‘Bug’ and ‘Features’ nav items.

<script>
Discourse.ExternalNavItem = Discourse.NavItem.extend({
    href: function() {
        return this.get('href');
    }
    .property('href')
});

Discourse.NavItem.reopenClass({
    buildList: function(category, args) {
        var list = this._super(category, args);
        if (!category) {
             I18n.translations.en.js.filters.bugs = {
                title: "Bugs",
                help: "Open Bugs"
            };
            I18n.translations.en.js.filters.features = {
                title: "Features",
                help: "Open Feature Requests"
            };
            list.push(Discourse.ExternalNavItem.create({
                href: '/category/bug?order=op_likes&status=open',
                name: 'bugs'
            }));
            list.push(Discourse.ExternalNavItem.create({
                href: '/category/feature?order=op_likes&status=open',
                name: 'features'
            }));
        }
        return list;
    }
});
</script>

When I add that as a customization to the head section of my site I get similar results to what I’m seeing on meta when I change the locale to ‘fr’ or ‘de’. Moving the ‘bugs’ and ‘features’ translations out of the buildList function seems to solve the problem.

3 Likes

Ahhhh at last I know what happened here will fix

1 Like

The pattern I used for adding a localization from a site customization was incorrect.

Instead of:

  I18n.translations.en.js.filters.bugs = { title: "Bugs", help: "Open Bugs" };
  I18n.translations.en.js.filters.features = { title: "Features", help: "Open Feature Requests" };

Should have been

  I18n.translations[I18n.locale].js.filters.bugs = { title: "Bugs", help: "Open Bugs" };
  I18n.translations[I18n.locale].js.filters.features = { title: "Features", help: "Open Feature Requests" };
5 Likes

OK, this works, but I did notices some hebrew glitches a unread is not translated properly and @simon it looks like 1.2k has the k in the wrong side on front page

2 Likes