diff --git a/app/javascript/vue/label_template/insert_field_dropdown.vue b/app/javascript/vue/label_template/insert_field_dropdown.vue index 492963528..163f0c5df 100644 --- a/app/javascript/vue/label_template/insert_field_dropdown.vue +++ b/app/javascript/vue/label_template/insert_field_dropdown.vue @@ -134,6 +134,11 @@ }, mounted() { $.get(this.labelTemplate.attributes.urls.fields, (result) => { + result.default.map((value) => { + value.key = this.i18n.t(`label_templates.default_columns.${value.key}`) + return value; + }); + this.fields = result; this.$nextTick(() => { $('[data-toggle="tooltip"]').tooltip(); diff --git a/app/services/label_templates/tag_service.rb b/app/services/label_templates/tag_service.rb index 5da28d119..310d7d437 100644 --- a/app/services/label_templates/tag_service.rb +++ b/app/services/label_templates/tag_service.rb @@ -3,10 +3,10 @@ module LabelTemplates class TagService DEFAULT_COLUMNS = [ - { key: I18n.t('label_templates.default_columns.item_id'), tag: '{{ITEM_ID}}' }, - { key: I18n.t('label_templates.default_columns.name'), tag: '{{NAME}}' }, - { key: I18n.t('label_templates.default_columns.added_on'), tag: '{{ADDED_ON}}' }, - { key: I18n.t('label_templates.default_columns.added_by'), tag: '{{ADDED_BY}}' } + { key: 'item_id', tag: '{{ITEM_ID}}' }, + { key: 'name', tag: '{{NAME}}' }, + { key: 'added_on', tag: '{{ADDED_ON}}' }, + { key: 'added_by', tag: '{{ADDED_BY}}' } ].freeze def initialize(team) diff --git a/config/locales/en.yml b/config/locales/en.yml index a0e3ac946..cdb093058 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -852,6 +852,7 @@ en: unsupported_key: "Key %{key} is not supported by this label template renderer." column_not_found: "This Label template contains placeholders for inventory columns that are not present in this Inventory. Some data might not be printed on the label. Please check the label preview and label template before printing." logo_not_supported: "The company logo cannot be printed on the label, as it is not set up in your SciNote. Please upload company logo in Settings." + logo_params_error: 'Failed to parse logo parameters!' index: head_title: 'Label templates' search_templates: 'Filter templates'