Use i18n-t instead of v-html directive (#1676)

Use i18n-t component to avoid v-html directive
and to make localization easier
This commit is contained in:
Jany 2023-03-24 08:13:46 +00:00 committed by GitHub
parent 3a475ce210
commit 3a5e912a6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -82,7 +82,8 @@
"pipeline_path": { "pipeline_path": {
"path": "Pipeline path", "path": "Pipeline path",
"default": "By default: .woodpecker/*.yml -> .woodpecker.yml -> .drone.yml", "default": "By default: .woodpecker/*.yml -> .woodpecker.yml -> .drone.yml",
"desc": "Path to your pipeline config (for example <span class=\"bg-gray-300 dark:bg-dark-700 rounded-md px-1\">my/path/</span>). Folders should end with a <span class=\"bg-gray-300 dark:bg-dark-700 rounded-md px-1\">/</span>." "desc": "Path to your pipeline config (for example {0}). Folders should end with a {1}.",
"desc_path_example": "my/path/"
}, },
"allow_pr": { "allow_pr": {
"allow": "Allow Pull Requests", "allow": "Allow Pull Requests",

View file

@ -15,8 +15,12 @@
:placeholder="$t('repo.settings.general.pipeline_path.default')" :placeholder="$t('repo.settings.general.pipeline_path.default')"
/> />
<template #description> <template #description>
<!-- eslint-disable-next-line vue/no-v-html --> <i18n-t keypath="repo.settings.general.pipeline_path.desc" tag="p" class="text-sm text-color-alt">
<p class="text-sm text-color-alt" v-html="$t('repo.settings.general.pipeline_path.desc')" /> <span class="bg-gray-300 dark:bg-dark-700 rounded-md px-1">{{
$t('repo.settings.general.pipeline_path.desc_path_example')
}}</span>
<span class="bg-gray-300 dark:bg-dark-700 rounded-md px-1">/</span>
</i18n-t>
</template> </template>
</InputField> </InputField>