<script type="text/javascript">
  {% if not is_sphinx %}
  {{ waffle.wafflejs() }}
  {% endif %}
  {% if waffle.flag('static-i18njs') %}
  {{ inlinei18n(request.locale) }}
  {% endif %}
  // This represents the site configuration
  window.mdn = {
    build: '{{ BUILD_ID_JS }}',
    // Properties and settings for CKEditor will go here
    ckeditor: {},
    // Feature test results and methods will be placed here
    features: {},
    // Ensures gettext always returns something, is always set
    gettext: function(x) { return x; },
    // The path to media (images, CSS, JS) in MDN
    mediaPath: '{{ MEDIA_URL }}',
    // Optimizely API
    optimizely: window['optimizely'] || [],
    // Wiki-specific settings will be placed here
    wiki: {
      autosuggestTitleUrl: '{{ url('wiki.autosuggest_documents') }}'
    }
  };
</script>

<script type="text/javascript">
    (function(win) {
        'use strict';

        {% if not is_sphinx %}
            {{ waffle.wafflejs() }}
        {% endif %}
        {% if waffle.flag('static-i18njs') %}
            {{ inlinei18n(request.locale) }}
        {% endif %}

        // This represents the site configuration
        win.mdn = {
            build: '{{ BUILD_ID_JS }}',
            // Properties and settings for CKEditor will go here
            ckeditor: {},
            // Feature test results and methods will be placed here
            features: {},
            // The path to media (images, CSS, JS) in MDN
            mediaPath: '{{ MEDIA_URL }}',
            // Optimizely API
            optimizely: win['optimizely'] || [],
            // Wiki-specific settings will be placed here
            wiki: {
                autosuggestTitleUrl: '{{ url('wiki.autosuggest_documents') }}'
            }
        };

        // Ensures gettext always returns something, is always set
        win.gettext = function(x) {
            return x;
        }
    })(window);
</script>

Move gettext() to global where it should be
Move gettext() to global where it should be
