             err.origError = e
             grunt.fail.warn err
 
-        if not 'i18n' of @options
+        config = {}
+        config.options = @options()
+
+        if not config.options.i18n?
             err = new Error(
                 'You need to configure an `i18n` object in your target'+
                 ' options. See here: https://github.com/SnijderC/'+
                 'grunt-i18n-pug/blob/master/README.md'
             )
             grunt.fail.fatal err
-
 
         gettextFilter = (context) ->
             (text, options) ->

        for locale in i18nConfig.locales
            # Make a duplicate of config (i.e. not byref)
            _config = _.cloneDeep(config)
            # Register __(), __n(), etc. in pugs data namespace
            i18nConfig.register = _config.options.data
            # Configure i18n
            i18n.configure i18nConfig
            # Set the locale
            _config.options.data.setLocale(locale)

            # add a gettext filter
            _config.options.filters = {

                return context.__mf(text)

        # Get raw config (unparsed configuration)
        config.files = grunt.config.getRaw(
            # Most commonly `i18n_pug.[target]` or `i18n_pug`
            if @target.length then "#{@name}.#{@target}" else @name
        ).files
        # Find the i18n settings object in the options and preserve it
        i18nConfig = config.options.i18n
        # Remove options not supported by grunt-contrib-pug from config
