      *       * https://github.com/LotusTM/Kotsu/issues/45
     ###
     constructor: (@locales, @localesDir) ->
-      @gettext = new NodeGettext()
+      @gt = new NodeGettext()
 
       @locales.forEach (locale) =>
 

      # i18n functions
      # --------------

      ###*
      * Load string from current locale
      * @param {string} string          String, which should be loaded
      * @return {string} Translated string into current locale
      ###
      env.addGlobal 'gettext', (string) =>
        @gettext.gettext(string)

      ###*
       * Load string from specified domain
       * @param {string} domain = currentLocale Domain or locale, from which string should be loaded
       *                                        `en-US:other:inner` will load from `en-US/other/inner.po`
       *                                        `:other` will load from `{{currentLocale}}/other.po`
       * @param {string} string                 String, which should be loaded
       * @return {string} Translated string into specified locale
      ###
      env.addGlobal 'dgettext', (domain, string) =>
        @gettext.dgettext(@resolveDomain(domain), string)

      ###*
      * Load plural string from current locale
      * @param {string} string          String, which should be loaded
      * @param {string} pluralString    Plural form of string
      * @param {number} count           Count for detecting correct plural form
      * @return {string} Pluralized and translated into current locale string
      ###
      env.addGlobal 'ngettext', (string, pluralString, count) =>
        @gettext.ngettext(string, pluralString, count)

      ###*
       * Load plural string from specified domain
       * @param {string} domain = currentLocale Domain or locale, from which string should be loaded
       *                                        `en-US:other:inner` will load from `en-US/other/inner.po`
       *                                        `:other` will load from `{{currentLocale}}/other.po`
       * @param {string} string                 String, which should be loaded
       * @param {string} pluralString           Plural form of string
       * @param {number} count                  Count for detecting correct plural form
       * @return {string} Pluralized and translated into specified loca stringle
      ###
      env.addGlobal 'dngettext', (domain, string, pluralString, count) =>
        @gettext.dngettext(@resolveDomain(domain), string, pluralString, count)

      ###*
      * Load string of specific context from current locale
      * @param {string} context         Context of curret string
      * @param {string} string          String, which should be loaded
      * @return {string} Translated string into current locale
      ###
      env.addGlobal 'pgettext', (context, string) =>
        @gettext.pgettext(context, string)

      ###*
       * Load string of specific context from specified domain
       * @param {string} domain = currentLocale Domain or locale, from which string should be loaded
       *                                        `en-US:other:inner` will load from `en-US/other/inner.po`
       *                                        `:other` will load from `{{currentLocale}}/other.po`
       * @param {string} context                Context of curret string
       * @param {string} string                 String, which should be loaded
       * @return {string} Translated string into specified locale
      ###
      env.addGlobal 'dpgettext', (domain, context, string) =>
        @gettext.dpgettext(@resolveDomain(domain), context, string)

      ###*
      * Load plural string of specific context from current locale
      * @param {string} context         Context of curret string
      * @param {string} string          String, which should be loaded
      * @param {string} pluralString    Plural form of string
      * @param {number} count           Count for detecting correct plural form
      * @return {string} Pluralized and translated into current locale string
      ###
      env.addGlobal 'npgettext', (context, string, pluralString, count) =>
        @gettext.npgettext(context, string, pluralString, count)

      ###*
       * Load plural string of specific context from specified domain
       * @param {string} domain = currentLocale Domain or locale, from which string should be loaded
       *                                        `en-US:other:inner` will load from `en-US/other/inner.po`
       *                                        `:other` will load from `{{currentLocale}}/other.po`
       * @param {string} context                Context of curret string
       * @param {string} string                 String, which should be loaded
       * @param {string} pluralString           Plural form of string
       * @param {number} count                  Count for detecting correct plural form
       * @return {string} Pluralized and translated into specified loca stringle
      ###
      env.addGlobal 'dnpgettext', (domain, context, string, pluralString, count) =>
        @gettext.dnpgettext(@resolveDomain(domain), context, string, pluralString, count)

      return
          domain   = if domain == defaultDomain then locale else locale + ':' + domain
          messages = grunt.file.read(@localesDir + '/' + locale + '/' + filepath, { encoding: null })

          @gt.addTextdomain(domain, messages)

    resolveDomain: (domain) ->
      if domain.charAt(0) == ':' then @gt.textdomain() + domain else domain

    textdomain: (domain) ->
      @gt.textdomain(@resolveDomain(domain))

    ###*
    * Load string from current locale
    * @param {string} string String, which should be loaded
    * @return {string} Translated string into current locale
    ###
    gettext: (string) ->
      @gt.gettext(arguments...)

    ###*
     * Load string from specified domain
     * @param {string} domain Domain or locale, from which string should be loaded
     *                        `en-US:other:inner` will load from `en-US/other/inner.po`
     *                        `:other` will load from `{{currentLocale}}/other.po`
     * @param {string} string String, which should be loaded
     * @return {string} Translated string into specified locale
    ###
    dgettext: (domain, string) ->
      args = [arguments...]
      args.shift()
      @gt.dgettext(@resolveDomain(domain), args...)

    ###*
    * Load plural string from current locale
    * @param {string} string       String, which should be loaded
    * @param {string} pluralString Plural form of string
    * @param {number} count        Count for detecting correct plural form
    * @return {string} Pluralized and translated into current locale string
    ###
    ngettext: (string, pluralString, count) ->
      @gt.ngettext(arguments...)

    ###*
     * Load plural string from specified domain
     * @param {string} domain       Domain or locale, from which string should be loaded
     *                              `en-US:other:inner` will load from `en-US/other/inner.po`
     *                              `:other` will load from `{{currentLocale}}/other.po`
     * @param {string} string       String, which should be loaded
     * @param {string} pluralString Plural form of string
     * @param {number} count        Count for detecting correct plural form
     * @return {string} Pluralized and translated into specified locale string
    ###
    dngettext: (domain, string, pluralString, count) ->
      args = [arguments...]
      args.shift()
      @gt.dngettext(@resolveDomain(domain), args...)

    ###*
    * Load string of specific context from current locale
    * @param {string} context Context of curret string
    * @param {string} string  String, which should be loaded
    * @return {string} Translated string into current locale
    ###
    pgettext: (context, string) ->
      @gt.pgettext(arguments...)

    ###*
     * Load string of specific context from specified domain
     * @param {string} domain  Domain or locale, from which string should be loaded
     *                         `en-US:other:inner` will load from `en-US/other/inner.po`
     *                         `:other` will load from `{{currentLocale}}/other.po`
     * @param {string} context Context of curret string
     * @param {string} string  String, which should be loaded
     * @return {string} Translated string into specified locale
    ###
    dpgettext: (domain, context, string) ->
      args = [arguments...]
      args.shift()
      @gt.dpgettext(@resolveDomain(domain), args...)

    ###*
    * Load plural string of specific context from current locale
    * @param {string} context         Context of curret string
    * @param {string} string          String, which should be loaded
    * @param {string} pluralString    Plural form of string
    * @param {number} count           Count for detecting correct plural form
    * @return {string} Pluralized and translated into current locale string
    ###
    npgettext: (context, string, pluralString, count) ->
      @gt.npgettext(arguments...)

    ###*
     * Load plural string of specific context from specified domain
     * @param {string} domain       Domain or locale, from which string should be loaded
     *                              `en-US:other:inner` will load from `en-US/other/inner.po`
     *                              `:other` will load from `{{currentLocale}}/other.po`
     * @param {string} context      Context of curret string
     * @param {string} string       String, which should be loaded
     * @param {string} pluralString Plural form of string
     * @param {number} count        Count for detecting correct plural form
     * @return {string} Pluralized and translated into specified locale string
    ###
    dnpgettext: (domain, context, string, pluralString, count) ->
      args = [arguments...]
      args.shift()
      @gt.dnpgettext(@resolveDomain(domain), args...)

    installNunjucksGlobals: (env, currentLocale) ->

