Fix missing translation for field codes [SCI-7765] (#4826)

This commit is contained in:
ajugo 2023-01-16 10:21:10 +01:00 committed by GitHub
parent 0747f414eb
commit 1e01d1f2b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -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();

View file

@ -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)

View file

@ -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'