Skip to content

Commit

Permalink
Translate tags modify modal
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenvn committed Sep 16, 2020
1 parent d74d212 commit 321cd01
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 13 deletions.
31 changes: 21 additions & 10 deletions src/components/projects/modals/TagModifyModal.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-card :tile="$vuetify.breakpoint.smAndDown">
<v-card-title class="modal__title">
{{ t("tags.create.title") }}
{{ t(`tags.${type}.title`) }}

<v-spacer />

Expand All @@ -11,7 +11,7 @@
</v-card-title>

<v-card-subtitle>
{{ t("tags.create.desc") }}
{{ t(`tags.${type}.desc`) }}
</v-card-subtitle>

<v-card-text>
Expand All @@ -26,8 +26,8 @@
v-model="fields.name.value"
:rules="fields.name.rules"
:error-messages="fields.name.error"
label="Name"
placeholder="Name of the tag"
:label="t('tags.modify.fields.name.label')"
:placeholder="t('tags.modify.fields.name.placeholder')"
outlined
required
/>
Expand All @@ -39,8 +39,8 @@
v-model="fields.color.value"
:rules="fields.color.rules"
:error-messages="fields.color.error"
label="Color"
placeholder="Color of the tag"
:label="t('tags.modify.fields.color.label')"
:placeholder="t('tags.modify.fields.color.placeholder')"
outlined
required
/>
Expand All @@ -58,8 +58,8 @@
v-model="fields.description.value"
:rules="fields.description.rules"
:error-messages="fields.description.error"
label="Description"
placeholder="Description of the tag"
:label="t('tags.modify.fields.description.label')"
:placeholder="t('tags.modify.fields.description.placeholder')"
outlined
required
/>
Expand Down Expand Up @@ -135,12 +135,23 @@ export default class ModifyTagModal extends Vue {
*/
get previewTag(): Tag {
return {
name: this.fields.name.value || "Tag preview",
description: this.fields.description.value || "This is a preview tag",
name: this.fields.name.value || this.t("tags.modify.preview.name"),
description: this.fields.description.value || this.t("tags.modify.preview.description"),
color: this.fields.color.value
} as Tag;
}
/**
* If the modal is used for "create" or "modify".
*/
get type() {
if (this.payload.tag) {
return "modify";
} else {
return "create";
}
}
/**
* When the component is created.
*/
Expand Down
30 changes: 27 additions & 3 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,40 @@
"unmatched": {
"title": "No repositories found for the given parameters",
"desc": "Try changing some parameters."
},
"manager": {
"title": "Repository Manager",
"success": "Repositories have been successfully updated"
}
},

"tags": {
"search": "Search for a tag",
"delete": "Are you sure you want to delete this tag? This cannot be undone!",
"create": {
"button": "New tag",
"title": "Create a new tag",
"desc": "Todo: some description here"
"button": "New tag"
},
"modify": {
"title": "New tag",
"desc": "Create a new global G2 tag.",
"preview": {
"name": "Tag preview",
"desc": "This is a preview tag"
},
"fields": {
"name": {
"label": "Name",
"placeholder": "Name of the tag"
},
"color": {
"label": "Color",
"placeholder": "Color of the tag"
},
"description": {
"label": "Description",
"placeholder": "Description of the tag"
}
}
},
"info": {
"title": "Available tags",
Expand Down

0 comments on commit 321cd01

Please sign in to comment.