     templateFn = ($el, $attrs) ->
         maxFileSize = $config.get("maxUploadFileSize", null)
         maxFileSize = sizeFormat(maxFileSize) if maxFileSize
-        maxFileSizeMsg = if maxFileSize then $translation.instant("ATTACHMENT.MAX_UPLOAD_SIZE") else ""
+        maxFileSizeMsg = if maxFileSize then $translate.instant("ATTACHMENT.MAX_UPLOAD_SIZE") else ""
         maxFileSize = 4000
         ctx = {
             type: $attrs.type

        template: templateFn
    }

module.directive("tgAttachments", ["$tgConfig", "$tgConfirm", "$tgTemplate", AttachmentsDirective])


AttachmentDirective = ($template, $compile, $translate) ->

        return not item.is_deprecated


AttachmentsDirective = ($config, $confirm, $templates, $translate) ->
    template = $templates.get("attachment/attachments.html", true)

    link = ($scope, $el, $attrs, $ctrls) ->
