Skip to content

Commit

Permalink
use v-html to use link in translations
Browse files Browse the repository at this point in the history
  • Loading branch information
ETLaurent committed Aug 14, 2023
1 parent f999f20 commit e46df1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 31 deletions.
10 changes: 4 additions & 6 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"import": "Import",
"importType": "Import {{ type }}",
"importModalDescriptionStart": "Importing content requires a zip file. See our",
"importModalDescriptionLink": "guide to importing content",
"importModalDescriptionEnd": "in Apostrophe.",
"export": "Export",
"exporting": "Exporting",
"exportModalDescription": "You've selected {{ count }} {{ type }} for export",
Expand All @@ -13,5 +8,8 @@
"exportModalIncludeRelated": "Include related documents",
"exportModalIncludeChildren": "Include children of this page",
"exportModalIncludeRelatedSettings": "Related Documents Settings",
"exportModalNoRelatedTypes": "No Related Types"
"exportModalNoRelatedTypes": "No Related Types",
"import": "Import",
"importType": "Import {{ type }}",
"importModalDescription": "Importing content requires a zip file. See our <a href=\"https://v3.docs.apostrophecms.org/\" target=\"_blank\">guide to importing content</a> in Apostrophe."
}
5 changes: 1 addition & 4 deletions modules/@apostrophecms/import-export-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
improve: '@apostrophecms/page',

utilityOperations (self) {
// TODO: change to `self.options.shareDocsDisableImport === true` as set in the ticket?
if (self.options.import === false) {
return {};
}
Expand All @@ -13,9 +12,7 @@ module.exports = {
label: 'aposImportExport:import',
modalOptions: {
title: 'aposImportExport:importType',
descriptionStart: 'aposImportExport:importModalDescriptionStart',
descriptionLink: 'aposImportExport:importModalDescriptionLink',
descriptionEnd: 'aposImportExport:importModalDescriptionEnd',
description: 'aposImportExport:importModalDescription',
confirmationButton: 'aposImportExport:importType',
modal: 'AposImportModal'
},
Expand Down
5 changes: 1 addition & 4 deletions modules/@apostrophecms/import-export-piece-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
cascades: [ 'batchOperations' ],

utilityOperations (self) {
// TODO: change to `self.options.shareDocsDisableImport === true` as set in the ticket?
if (self.options.import === false) {
return {};
}
Expand All @@ -15,9 +14,7 @@ module.exports = {
label: 'aposImportExport:import',
modalOptions: {
title: 'aposImportExport:importType',
descriptionStart: 'aposImportExport:importModalDescriptionStart',
descriptionLink: 'aposImportExport:importModalDescriptionLink',
descriptionEnd: 'aposImportExport:importModalDescriptionEnd',
description: 'aposImportExport:importModalDescription',
confirmationButton: 'aposImportExport:importType',
modal: 'AposImportModal'
},
Expand Down
24 changes: 7 additions & 17 deletions ui/apos/components/AposImportModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
>
{{ $t(title, { type: $t(labels.plural) }) }}
</h2>
<p class="apos-import__description">
{{ $t(descriptionStart) }}
<a
href="https://v3.docs.apostrophecms.org/"
target="_blank"
>{{ $t(descriptionLink) }}</a>
{{ $t(descriptionEnd) }}
</p>
<!-- eslint-disable vue/no-v-html -->
<p
class="apos-import__description"
v-html="$t(description)"
/>
<!-- eslint-enable vue/no-v-html -->
<AposFile
class="apos-import__file"
allowed-extensions=".zip"
Expand Down Expand Up @@ -70,15 +68,7 @@ export default {
type: String,
required: true
},
descriptionStart: {
type: String,
required: true
},
descriptionLink: {
type: String,
required: true
},
descriptionEnd: {
description: {
type: String,
required: true
},
Expand Down

0 comments on commit e46df1b

Please sign in to comment.