mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
migration(vue-i18n): legacy mode off
This commit is contained in:
parent
bba1aa85c2
commit
ccc7298213
31 changed files with 156 additions and 159 deletions
|
@ -48,7 +48,7 @@ export default {
|
|||
errorFeedback() {
|
||||
if (this.serverError) return this.serverError
|
||||
else if (this.validation && this.validation.$errors.length) {
|
||||
return this.$i18n.t('form_errors.invalid_form')
|
||||
return this.$t('form_errors.invalid_form')
|
||||
} else return ''
|
||||
},
|
||||
},
|
||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
|||
errorFeedback() {
|
||||
if (this.serverError) return this.serverError
|
||||
else if (this.validation && this.validation.$errors.length) {
|
||||
return this.$i18n.t('form_errors.invalid_form')
|
||||
return this.$t('form_errors.invalid_form')
|
||||
} else return ''
|
||||
},
|
||||
},
|
||||
|
|
|
@ -119,7 +119,7 @@ export default {
|
|||
const err = this.error
|
||||
if (err) {
|
||||
if (err.$message) return err.$message
|
||||
return this.$i18n.t('form_errors.' + err.$validator, {
|
||||
return this.$t('form_errors.' + err.$validator, {
|
||||
value: err.$model,
|
||||
...err.$params,
|
||||
})
|
||||
|
|
|
@ -38,15 +38,13 @@ export default {
|
|||
parseValue(value) {
|
||||
const item = this.component
|
||||
if (item === 'FileItem') value = value.file ? value.file.name : null
|
||||
if (item === 'CheckboxItem') value = this.$i18n.t(value ? 'yes' : 'no')
|
||||
if (item === 'CheckboxItem') value = this.$t(value ? 'yes' : 'no')
|
||||
if (item === 'TextAreaItem') value = value.replaceAll('\n', '<br>')
|
||||
if (Array.isArray(value)) {
|
||||
value = value.length
|
||||
? value.join(this.$i18n.t('words.separator'))
|
||||
: null
|
||||
value = value.length ? value.join(this.$t('words.separator')) : null
|
||||
}
|
||||
if ([null, undefined, ''].includes(this.value))
|
||||
value = this.$i18n.t('words.none')
|
||||
value = this.$t('words.none')
|
||||
return value
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
:value="search"
|
||||
@input="$emit('update:search', $event)"
|
||||
:placeholder="
|
||||
$t('search.for', { items: $tc('items.' + itemsName, 2) })
|
||||
$t('search.for', { items: $t('items.' + itemsName, 2) })
|
||||
"
|
||||
:disabled="!items"
|
||||
/>
|
||||
|
@ -33,10 +33,12 @@
|
|||
<slot name="alert-message">
|
||||
<YIcon iname="exclamation-triangle" />
|
||||
{{
|
||||
$tc(
|
||||
$t(
|
||||
items === null ? 'items_verbose_count' : 'search.not_found',
|
||||
{
|
||||
items: $t('items.' + itemsName, 0),
|
||||
},
|
||||
0,
|
||||
{ items: $tc('items.' + itemsName, 0) },
|
||||
)
|
||||
}}
|
||||
</slot>
|
||||
|
|
|
@ -49,9 +49,13 @@
|
|||
label-size="sm"
|
||||
:label-for="id + '-search-input'"
|
||||
:invalid-feedback="
|
||||
$tc('search.not_found', 0, {
|
||||
items: $tc('items.' + itemsName, 0),
|
||||
})
|
||||
$t(
|
||||
'search.not_found',
|
||||
{
|
||||
items: $t('items.' + itemsName, 0),
|
||||
},
|
||||
0,
|
||||
)
|
||||
"
|
||||
:state="searchState"
|
||||
:disabled="disabled"
|
||||
|
@ -80,9 +84,13 @@
|
|||
<BDropdownText v-if="!criteria && availableOptions.length === 0">
|
||||
<YIcon iname="exclamation-triangle" />
|
||||
{{
|
||||
$tc('items_verbose_items_left', 0, {
|
||||
items: $tc('items.' + itemsName, 0),
|
||||
})
|
||||
$t(
|
||||
'items_verbose_items_left',
|
||||
{
|
||||
items: $t('items.' + itemsName, 0),
|
||||
},
|
||||
0,
|
||||
)
|
||||
}}
|
||||
</BDropdownText>
|
||||
</BDropdown>
|
||||
|
|
|
@ -6,6 +6,5 @@
|
|||
import { createI18n } from 'vue-i18n'
|
||||
|
||||
export default createI18n({
|
||||
// FIXME
|
||||
legacy: true,
|
||||
legacy: false,
|
||||
})
|
||||
|
|
|
@ -36,8 +36,8 @@ app.use(VueShowdownPlugin, {
|
|||
// FIXME find or wait for a better way
|
||||
app.config.globalProperties.$askConfirmation = function (message, props) {
|
||||
return this.$bvModal.msgBoxConfirm(message, {
|
||||
okTitle: this.$i18n.t('ok'),
|
||||
cancelTitle: this.$i18n.t('cancel'),
|
||||
okTitle: this.$t('ok'),
|
||||
cancelTitle: this.$t('cancel'),
|
||||
bodyBgVariant: 'warning',
|
||||
centered: true,
|
||||
bodyClass: [
|
||||
|
@ -58,8 +58,8 @@ app.config.globalProperties.$askMdConfirmation = function (
|
|||
props: { markdown, flavor: 'github', options: { headerLevelStart: 4 } },
|
||||
})
|
||||
return this.$bvModal['msgBox' + (ok ? 'Ok' : 'Confirm')](content, {
|
||||
okTitle: this.$i18n.t('yes'),
|
||||
cancelTitle: this.$i18n.t('cancel'),
|
||||
okTitle: this.$t('yes'),
|
||||
cancelTitle: this.$t('cancel'),
|
||||
headerBgVariant: 'warning',
|
||||
headerClass: store.state.theme ? 'text-white' : 'text-black',
|
||||
centered: true,
|
||||
|
|
|
@ -60,14 +60,14 @@ export default {
|
|||
},
|
||||
fields: {
|
||||
username: {
|
||||
label: this.$i18n.t('user_username'),
|
||||
label: this.$t('user_username'),
|
||||
props: {
|
||||
id: 'username',
|
||||
autocomplete: 'username',
|
||||
},
|
||||
},
|
||||
password: {
|
||||
label: this.$i18n.t('password'),
|
||||
label: this.$t('password'),
|
||||
props: {
|
||||
id: 'password',
|
||||
type: 'password',
|
||||
|
@ -109,7 +109,7 @@ export default {
|
|||
})
|
||||
.catch((err) => {
|
||||
if (err.name !== 'APIUnauthorizedError') throw err
|
||||
this.serverError = this.$i18n.t('wrong_password_or_username')
|
||||
this.serverError = this.$t('wrong_password_or_username')
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
|
@ -132,30 +132,30 @@ export default {
|
|||
|
||||
fields: {
|
||||
username: {
|
||||
label: this.$i18n.t('user_username'),
|
||||
label: this.$t('user_username'),
|
||||
props: {
|
||||
id: 'username',
|
||||
placeholder: this.$i18n.t('placeholder.username'),
|
||||
placeholder: this.$t('placeholder.username'),
|
||||
},
|
||||
},
|
||||
|
||||
fullname: {
|
||||
label: this.$i18n.t('user_fullname'),
|
||||
label: this.$t('user_fullname'),
|
||||
props: {
|
||||
id: 'fullname',
|
||||
placeholder: this.$i18n.t('placeholder.fullname'),
|
||||
placeholder: this.$t('placeholder.fullname'),
|
||||
},
|
||||
},
|
||||
|
||||
password: {
|
||||
label: this.$i18n.t('password'),
|
||||
description: this.$i18n.t('good_practices_about_admin_password'),
|
||||
label: this.$t('password'),
|
||||
description: this.$t('good_practices_about_admin_password'),
|
||||
descriptionVariant: 'warning',
|
||||
props: { id: 'password', placeholder: '••••••••', type: 'password' },
|
||||
},
|
||||
|
||||
confirmation: {
|
||||
label: this.$i18n.t('password_confirmation'),
|
||||
label: this.$t('password_confirmation'),
|
||||
props: {
|
||||
id: 'confirmation',
|
||||
placeholder: '••••••••',
|
||||
|
@ -180,7 +180,7 @@ export default {
|
|||
|
||||
async setUser() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_postinstall', { domain: this.domain }),
|
||||
this.$t('confirm_postinstall', { domain: this.domain }),
|
||||
)
|
||||
if (!confirmed) return
|
||||
this.performPostInstall()
|
||||
|
|
|
@ -157,26 +157,26 @@ export default {
|
|||
|
||||
fields: {
|
||||
domain: {
|
||||
label: this.$i18n.t('domain_name'),
|
||||
label: this.$t('domain_name'),
|
||||
props: {
|
||||
id: 'domain',
|
||||
placeholder: this.$i18n.t('placeholder.domain'),
|
||||
placeholder: this.$t('placeholder.domain'),
|
||||
},
|
||||
},
|
||||
|
||||
dynDomain: {
|
||||
label: this.$i18n.t('domain_name'),
|
||||
label: this.$t('domain_name'),
|
||||
props: {
|
||||
id: 'dyn-domain',
|
||||
placeholder: this.$i18n.t('placeholder.domain').split('.')[0],
|
||||
placeholder: this.$t('placeholder.domain').split('.')[0],
|
||||
type: 'domain',
|
||||
choices: ['nohost.me', 'noho.st', 'ynh.fr'],
|
||||
},
|
||||
},
|
||||
|
||||
dynDomainPassword: {
|
||||
label: this.$i18n.t('domain.add.dyn_dns_password'),
|
||||
description: this.$i18n.t('domain.add.dyn_dns_password_desc'),
|
||||
label: this.$t('domain.add.dyn_dns_password'),
|
||||
description: this.$t('domain.add.dyn_dns_password_desc'),
|
||||
props: {
|
||||
id: 'dyn-dns-password',
|
||||
placeholder: '••••••••',
|
||||
|
@ -185,7 +185,7 @@ export default {
|
|||
},
|
||||
|
||||
dynDomainPasswordConfirmation: {
|
||||
label: this.$i18n.t('password_confirmation'),
|
||||
label: this.$t('password_confirmation'),
|
||||
props: {
|
||||
id: 'dyn-dns-password-confirmation',
|
||||
placeholder: '••••••••',
|
||||
|
@ -194,10 +194,10 @@ export default {
|
|||
},
|
||||
|
||||
localDomain: {
|
||||
label: this.$i18n.t('domain_name'),
|
||||
label: this.$t('domain_name'),
|
||||
props: {
|
||||
id: 'dyn-domain',
|
||||
placeholder: this.$i18n.t('placeholder.domain').split('.')[0],
|
||||
placeholder: this.$t('placeholder.domain').split('.')[0],
|
||||
type: 'domain',
|
||||
choices: ['local', 'test'],
|
||||
},
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</BInputGroupPrepend>
|
||||
<BFormInput
|
||||
id="search-input"
|
||||
:placeholder="$t('search.for', { items: $tc('items.apps', 2) })"
|
||||
:placeholder="$t('search.for', { items: $t('items.apps', 2) })"
|
||||
:value="search"
|
||||
@input="updateQuery('search', $event)"
|
||||
/>
|
||||
|
@ -257,24 +257,24 @@ export default {
|
|||
|
||||
// Filtering options
|
||||
qualityOptions: [
|
||||
{ value: 'high_quality', text: this.$i18n.t('only_highquality_apps') },
|
||||
{ value: 'high_quality', text: this.$t('only_highquality_apps') },
|
||||
{
|
||||
value: 'decent_quality',
|
||||
text: this.$i18n.t('only_decent_quality_apps'),
|
||||
text: this.$t('only_decent_quality_apps'),
|
||||
},
|
||||
{ value: 'working', text: this.$i18n.t('only_working_apps') },
|
||||
{ value: 'all', text: this.$i18n.t('all_apps') },
|
||||
{ value: 'working', text: this.$t('only_working_apps') },
|
||||
{ value: 'all', text: this.$t('all_apps') },
|
||||
],
|
||||
categories: [
|
||||
{ text: this.$i18n.t('app_choose_category'), value: null },
|
||||
{ text: this.$i18n.t('all_apps'), value: 'all', icon: 'search' },
|
||||
{ text: this.$t('app_choose_category'), value: null },
|
||||
{ text: this.$t('all_apps'), value: 'all', icon: 'search' },
|
||||
// The rest is filled from api data
|
||||
],
|
||||
|
||||
// Custom install form
|
||||
customInstall: {
|
||||
field: {
|
||||
label: this.$i18n.t('url'),
|
||||
label: this.$t('url'),
|
||||
props: {
|
||||
id: 'custom-install',
|
||||
placeholder: 'https://some.git.forge.tld/USER/REPOSITORY',
|
||||
|
@ -321,11 +321,11 @@ export default {
|
|||
(cat) => cat.value === this.category,
|
||||
)
|
||||
if (category.subtags) {
|
||||
const subtags = [{ text: this.$i18n.t('all'), value: 'all' }]
|
||||
const subtags = [{ text: this.$t('all'), value: 'all' }]
|
||||
category.subtags.forEach((subtag) => {
|
||||
subtags.push({ text: subtag.title, value: subtag.id })
|
||||
})
|
||||
subtags.push({ text: this.$i18n.t('others'), value: 'others' })
|
||||
subtags.push({ text: this.$t('others'), value: 'others' })
|
||||
return subtags
|
||||
}
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ export default {
|
|||
const app = this.apps.find((app) => app.id === appId)
|
||||
if (!app.decent_quality) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_install_app_' + app.state),
|
||||
this.$t('confirm_install_app_' + app.state),
|
||||
)
|
||||
if (!confirmed) return
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ export default {
|
|||
// INSTALL CUSTOM APP
|
||||
async onCustomInstallClick() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_install_custom_app'),
|
||||
this.$t('confirm_install_custom_app'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ export default {
|
|||
{
|
||||
hasApplyButton: false,
|
||||
id: 'operations',
|
||||
name: this.$i18n.t('operations'),
|
||||
name: this.$t('operations'),
|
||||
},
|
||||
],
|
||||
validations: {},
|
||||
|
@ -467,7 +467,7 @@ export default {
|
|||
|
||||
const mainPermission = app.permissions[this.id + '.main']
|
||||
mainPermission.name = this.id + '.main'
|
||||
mainPermission.title = this.$i18n.t('permission_main')
|
||||
mainPermission.title = this.$t('permission_main')
|
||||
mainPermission.tileAvailable =
|
||||
mainPermission.url !== null && !mainPermission.url.startsWith('re:')
|
||||
form.labels.push({
|
||||
|
@ -507,7 +507,7 @@ export default {
|
|||
domain: app.settings.domain,
|
||||
alternativeTo: app.from_catalog.potential_alternative_to?.length
|
||||
? app.from_catalog.potential_alternative_to.join(
|
||||
this.$i18n.t('words.separator'),
|
||||
this.$t('words.separator'),
|
||||
)
|
||||
: null,
|
||||
description: DESCRIPTION
|
||||
|
@ -517,7 +517,7 @@ export default {
|
|||
app.manifest.packaging_format >= 2
|
||||
? {
|
||||
archs: Array.isArray(archs)
|
||||
? archs.join(this.$i18n.t('words.separator'))
|
||||
? archs.join(this.$t('words.separator'))
|
||||
: archs,
|
||||
ldap: ldap === 'not_relevant' ? null : ldap,
|
||||
sso: sso === 'not_relevant' ? null : sso,
|
||||
|
@ -647,7 +647,7 @@ export default {
|
|||
|
||||
async changeUrl() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_app_change_url'),
|
||||
this.$t('confirm_app_change_url'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
@ -663,7 +663,7 @@ export default {
|
|||
|
||||
async setAsDefaultDomain(undo = false) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_app_default'),
|
||||
this.$t('confirm_app_default'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -313,9 +313,7 @@ export default {
|
|||
name,
|
||||
alternativeTo:
|
||||
_app.potential_alternative_to && _app.potential_alternative_to.length
|
||||
? _app.potential_alternative_to.join(
|
||||
this.$i18n.t('words.separator'),
|
||||
)
|
||||
? _app.potential_alternative_to.join(this.$t('words.separator'))
|
||||
: null,
|
||||
description: formatI18nField(_app.doc.DESCRIPTION || _app.description),
|
||||
screenshot: _app.screenshot,
|
||||
|
@ -326,7 +324,7 @@ export default {
|
|||
_app.packaging_format >= 2
|
||||
? {
|
||||
archs: Array.isArray(archs)
|
||||
? archs.join(this.$i18n.t('words.separator'))
|
||||
? archs.join(this.$t('words.separator'))
|
||||
: archs,
|
||||
ldap: ldap === 'not_relevant' ? null : ldap,
|
||||
sso: sso === 'not_relevant' ? null : sso,
|
||||
|
@ -382,7 +380,7 @@ export default {
|
|||
async performInstall() {
|
||||
if ('path' in this.form && this.form.path === '/') {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_install_domain_root', {
|
||||
this.$t('confirm_install_domain_root', {
|
||||
domain: this.form.domain,
|
||||
}),
|
||||
)
|
||||
|
@ -406,16 +404,14 @@ export default {
|
|||
const postInstall = this.formatAppNotifs(notifications)
|
||||
if (postInstall) {
|
||||
const message =
|
||||
this.$i18n.t('app.install.notifs.post.alert') +
|
||||
'\n\n' +
|
||||
postInstall
|
||||
this.$t('app.install.notifs.post.alert') + '\n\n' + postInstall
|
||||
await this.$askMdConfirmation(
|
||||
message,
|
||||
{
|
||||
title: this.$i18n.t('app.install.notifs.post.title', {
|
||||
title: this.$t('app.install.notifs.post.title', {
|
||||
name: this.app.name,
|
||||
}),
|
||||
okTitle: this.$i18n.t('ok'),
|
||||
okTitle: this.$t('ok'),
|
||||
},
|
||||
true,
|
||||
)
|
||||
|
|
|
@ -155,12 +155,12 @@ export default {
|
|||
: hook
|
||||
if (groupId in data) {
|
||||
data[groupId].value.push(hook)
|
||||
data[groupId].description += ', ' + this.$i18n.t('hook_' + hook)
|
||||
data[groupId].description += ', ' + this.$t('hook_' + hook)
|
||||
} else {
|
||||
data[groupId] = {
|
||||
name: this.$i18n.t('hook_' + groupId),
|
||||
name: this.$t('hook_' + groupId),
|
||||
value: [hook],
|
||||
description: this.$i18n.t(
|
||||
description: this.$t(
|
||||
groupId === hook ? `hook_${hook}_desc` : 'hook_' + hook,
|
||||
),
|
||||
}
|
||||
|
|
|
@ -177,13 +177,13 @@ export default {
|
|||
: hook
|
||||
if (groupId in data) {
|
||||
data[groupId].value.push(hook)
|
||||
data[groupId].description += ', ' + this.$i18n.t('hook_' + hook)
|
||||
data[groupId].description += ', ' + this.$t('hook_' + hook)
|
||||
data[groupId].size += size
|
||||
} else {
|
||||
data[groupId] = {
|
||||
name: this.$i18n.t('hook_' + groupId),
|
||||
name: this.$t('hook_' + groupId),
|
||||
value: [hook],
|
||||
description: this.$i18n.t(
|
||||
description: this.$t(
|
||||
groupId === hook ? `hook_${hook}_desc` : 'hook_' + hook,
|
||||
),
|
||||
size,
|
||||
|
@ -216,7 +216,7 @@ export default {
|
|||
|
||||
async restoreBackup() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_restore', { name: this.name }),
|
||||
this.$t('confirm_restore', { name: this.name }),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
@ -246,7 +246,7 @@ export default {
|
|||
|
||||
async deleteBackup() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_delete', { name: this.name }),
|
||||
this.$t('confirm_delete', { name: this.name }),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<BAlert v-if="!archives" variant="warning">
|
||||
<YIcon iname="exclamation-triangle" />
|
||||
{{ $tc('items_verbose_count', 0, { items: $tc('items.backups', 0) }) }}
|
||||
{{ $t('items_verbose_count', { items: $t('items.backups', 0) }, 0) }}
|
||||
</BAlert>
|
||||
|
||||
<BListGroup v-else>
|
||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
|||
storages: [
|
||||
{
|
||||
id: 'local',
|
||||
name: this.$i18n.t('local_archives'),
|
||||
name: this.$t('local_archives'),
|
||||
uri: '/home/yunohost.backup/',
|
||||
},
|
||||
],
|
||||
|
|
|
@ -247,7 +247,7 @@ export default {
|
|||
async pushDnsChanges() {
|
||||
if (this.force) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('domain.dns.push_force_confirm'),
|
||||
this.$t('domain.dns.push_force_confirm'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<span class="text-secondary px-2">
|
||||
({{
|
||||
$t('domain.cert.valid_for', {
|
||||
days: $tc('day_validity', cert.validity),
|
||||
days: $t('day_validity', cert.validity),
|
||||
})
|
||||
}})
|
||||
</span>
|
||||
|
@ -280,7 +280,7 @@ export default {
|
|||
|
||||
async setAsDefaultDomain() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_change_maindomain'),
|
||||
this.$t('confirm_change_maindomain'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -37,11 +37,11 @@ export default {
|
|||
},
|
||||
serverError: '',
|
||||
groupname: {
|
||||
label: this.$i18n.t('group_name'),
|
||||
description: this.$i18n.t('group_format_name_help'),
|
||||
label: this.$t('group_name'),
|
||||
description: this.$t('group_format_name_help'),
|
||||
props: {
|
||||
id: 'groupname',
|
||||
placeholder: this.$i18n.t('placeholder.groupname'),
|
||||
placeholder: this.$t('placeholder.groupname'),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ export default {
|
|||
const permId = this.permissions.find((perm) => perm.label === option).id
|
||||
if (action === 'add' && ['sftp.main', 'ssh.main'].includes(permId)) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_group_add_access_permission', {
|
||||
this.$t('confirm_group_add_access_permission', {
|
||||
name: groupName,
|
||||
perm: option,
|
||||
}),
|
||||
|
@ -311,7 +311,7 @@ export default {
|
|||
|
||||
async deleteGroup(groupName) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_delete', { name: groupName }),
|
||||
this.$t('confirm_delete', { name: groupName }),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ export default {
|
|||
|
||||
async updateService(action) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_service_' + action, { name: this.name }),
|
||||
this.$t('confirm_service_' + action, { name: this.name }),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -140,27 +140,27 @@ export default {
|
|||
|
||||
// Ports tables data
|
||||
fields: [
|
||||
{ key: 'port', label: this.$i18n.t('port') },
|
||||
{ key: 'ipv4', label: this.$i18n.t('ipv4') },
|
||||
{ key: 'ipv6', label: this.$i18n.t('ipv6') },
|
||||
{ key: 'uPnP', label: this.$i18n.t('upnp') },
|
||||
{ key: 'port', label: this.$t('port') },
|
||||
{ key: 'ipv4', label: this.$t('ipv4') },
|
||||
{ key: 'ipv6', label: this.$t('ipv6') },
|
||||
{ key: 'uPnP', label: this.$t('upnp') },
|
||||
],
|
||||
protocols: undefined,
|
||||
portToToggle: undefined,
|
||||
|
||||
// Ports form data
|
||||
actionChoices: [
|
||||
{ value: 'allow', text: this.$i18n.t('open') },
|
||||
{ value: 'disallow', text: this.$i18n.t('close') },
|
||||
{ value: 'allow', text: this.$t('open') },
|
||||
{ value: 'disallow', text: this.$t('close') },
|
||||
],
|
||||
connectionChoices: [
|
||||
{ value: 'ipv4', text: this.$i18n.t('ipv4') },
|
||||
{ value: 'ipv6', text: this.$i18n.t('ipv6') },
|
||||
{ value: 'ipv4', text: this.$t('ipv4') },
|
||||
{ value: 'ipv6', text: this.$t('ipv6') },
|
||||
],
|
||||
protocolChoices: [
|
||||
{ value: 'TCP', text: this.$i18n.t('tcp') },
|
||||
{ value: 'UDP', text: this.$i18n.t('udp') },
|
||||
{ value: 'Both', text: this.$i18n.t('both') },
|
||||
{ value: 'TCP', text: this.$t('tcp') },
|
||||
{ value: 'UDP', text: this.$t('udp') },
|
||||
{ value: 'Both', text: this.$t('both') },
|
||||
],
|
||||
form: {
|
||||
action: 'allow',
|
||||
|
@ -216,7 +216,7 @@ export default {
|
|||
|
||||
async togglePort({ action, port, protocol, connection }) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_firewall_' + action, {
|
||||
this.$t('confirm_firewall_' + action, {
|
||||
port,
|
||||
protocol,
|
||||
connection,
|
||||
|
@ -226,9 +226,7 @@ export default {
|
|||
return Promise.resolve(confirmed)
|
||||
}
|
||||
|
||||
const actionTrad = this.$i18n.t(
|
||||
{ allow: 'open', disallow: 'close' }[action],
|
||||
)
|
||||
const actionTrad = this.$t({ allow: 'open', disallow: 'close' }[action])
|
||||
return api
|
||||
.put(
|
||||
`firewall/${protocol}/${action}/${port}?${connection}_only`,
|
||||
|
@ -248,7 +246,7 @@ export default {
|
|||
async toggleUpnp(value) {
|
||||
const action = this.upnpEnabled ? 'disable' : 'enable'
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_upnp_' + action),
|
||||
this.$t('confirm_upnp_' + action),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
@ -256,7 +254,7 @@ export default {
|
|||
.put(
|
||||
'firewall/upnp/' + action,
|
||||
{},
|
||||
{ key: 'firewall.upnp', action: this.$i18n.t(action) },
|
||||
{ key: 'firewall.upnp', action: this.$t(action) },
|
||||
)
|
||||
.then(() => {
|
||||
// FIXME Couldn't test when it works.
|
||||
|
|
|
@ -137,7 +137,7 @@ export default {
|
|||
|
||||
async skipMigration(id) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_migrations_skip'),
|
||||
this.$t('confirm_migrations_skip'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
api
|
||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
|||
methods: {
|
||||
async triggerAction(action) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_reboot_action_' + action),
|
||||
this.$t('confirm_reboot_action_' + action),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -36,38 +36,36 @@ export default {
|
|||
|
||||
fields: {
|
||||
locale: {
|
||||
label: this.$i18n.t('tools_webadmin.language'),
|
||||
label: this.$t('tools_webadmin.language'),
|
||||
component: 'SelectItem',
|
||||
props: { id: 'locale', choices: [] },
|
||||
},
|
||||
|
||||
fallbackLocale: {
|
||||
label: this.$i18n.t('tools_webadmin.fallback_language'),
|
||||
description: this.$i18n.t(
|
||||
'tools_webadmin.fallback_language_description',
|
||||
),
|
||||
label: this.$t('tools_webadmin.fallback_language'),
|
||||
description: this.$t('tools_webadmin.fallback_language_description'),
|
||||
component: 'SelectItem',
|
||||
props: { id: 'fallback-locale', choices: [] },
|
||||
},
|
||||
|
||||
cache: {
|
||||
id: 'cache',
|
||||
label: this.$i18n.t('tools_webadmin.cache'),
|
||||
description: this.$i18n.t('tools_webadmin.cache_description'),
|
||||
label: this.$t('tools_webadmin.cache'),
|
||||
description: this.$t('tools_webadmin.cache_description'),
|
||||
component: 'CheckboxItem',
|
||||
props: { labels: { true: 'enabled', false: 'disabled' } },
|
||||
},
|
||||
|
||||
transitions: {
|
||||
id: 'transitions',
|
||||
label: this.$i18n.t('tools_webadmin.transitions'),
|
||||
label: this.$t('tools_webadmin.transitions'),
|
||||
component: 'CheckboxItem',
|
||||
props: { labels: { true: 'enabled', false: 'disabled' } },
|
||||
},
|
||||
|
||||
theme: {
|
||||
id: 'theme',
|
||||
label: this.$i18n.t('tools_webadmin.theme'),
|
||||
label: this.$t('tools_webadmin.theme'),
|
||||
component: 'CheckboxItem',
|
||||
props: { labels: { true: '🌙', false: '☀️' } },
|
||||
},
|
||||
|
@ -90,8 +88,8 @@ export default {
|
|||
if (import.meta.env.DEV) {
|
||||
this.fields.experimental = {
|
||||
id: 'experimental',
|
||||
label: this.$i18n.t('tools_webadmin.experimental'),
|
||||
description: this.$i18n.t('tools_webadmin.experimental_description'),
|
||||
label: this.$t('tools_webadmin.experimental'),
|
||||
description: this.$t('tools_webadmin.experimental_description'),
|
||||
component: 'CheckboxItem',
|
||||
props: { labels: { true: 'enabled', false: 'disabled' } },
|
||||
}
|
||||
|
|
|
@ -223,17 +223,15 @@ export default {
|
|||
|
||||
if (postMessage) {
|
||||
const message =
|
||||
this.$i18n.t('app.upgrade.notifs.post.alert') +
|
||||
'\n\n' +
|
||||
postMessage
|
||||
this.$t('app.upgrade.notifs.post.alert') + '\n\n' + postMessage
|
||||
return this.$askMdConfirmation(
|
||||
message,
|
||||
{
|
||||
title: this.$i18n.t('app.upgrade.notifs.post.title', {
|
||||
title: this.$t('app.upgrade.notifs.post.title', {
|
||||
name: app.name,
|
||||
}),
|
||||
okTitle: this.$i18n.t(isLast ? 'ok' : 'app.upgrade.continue'),
|
||||
cancelTitle: this.$i18n.t('app.upgrade.stop'),
|
||||
okTitle: this.$t(isLast ? 'ok' : 'app.upgrade.continue'),
|
||||
cancelTitle: this.$t('app.upgrade.stop'),
|
||||
},
|
||||
isLast,
|
||||
)
|
||||
|
@ -251,7 +249,7 @@ export default {
|
|||
|
||||
async performSystemUpgrade() {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('confirm_update_system'),
|
||||
this.$t('confirm_update_system'),
|
||||
)
|
||||
if (!confirmed) return
|
||||
|
||||
|
|
|
@ -111,32 +111,32 @@ export default {
|
|||
|
||||
fields: {
|
||||
username: {
|
||||
label: this.$i18n.t('user_username'),
|
||||
label: this.$t('user_username'),
|
||||
props: {
|
||||
id: 'username',
|
||||
placeholder: this.$i18n.t('placeholder.username'),
|
||||
placeholder: this.$t('placeholder.username'),
|
||||
},
|
||||
},
|
||||
|
||||
fullname: {
|
||||
label: this.$i18n.t('user_fullname'),
|
||||
label: this.$t('user_fullname'),
|
||||
props: {
|
||||
id: 'fullname',
|
||||
placeholder: this.$i18n.t('placeholder.fullname'),
|
||||
placeholder: this.$t('placeholder.fullname'),
|
||||
},
|
||||
},
|
||||
|
||||
domain: {
|
||||
id: 'mail',
|
||||
label: this.$i18n.t('user_email'),
|
||||
description: this.$i18n.t('tip_about_user_email'),
|
||||
label: this.$t('user_email'),
|
||||
description: this.$t('tip_about_user_email'),
|
||||
descriptionVariant: 'info',
|
||||
props: { choices: [] },
|
||||
},
|
||||
|
||||
password: {
|
||||
label: this.$i18n.t('password'),
|
||||
description: this.$i18n.t('good_practices_about_user_password'),
|
||||
label: this.$t('password'),
|
||||
description: this.$t('good_practices_about_user_password'),
|
||||
descriptionVariant: 'warning',
|
||||
props: {
|
||||
id: 'password',
|
||||
|
@ -146,7 +146,7 @@ export default {
|
|||
},
|
||||
|
||||
confirmation: {
|
||||
label: this.$i18n.t('password_confirmation'),
|
||||
label: this.$t('password_confirmation'),
|
||||
props: {
|
||||
id: 'confirmation',
|
||||
placeholder: '••••••••',
|
||||
|
|
|
@ -167,51 +167,51 @@ export default {
|
|||
|
||||
fields: {
|
||||
username: {
|
||||
label: this.$i18n.t('user_username'),
|
||||
label: this.$t('user_username'),
|
||||
value: this.name,
|
||||
props: { id: 'username', disabled: true },
|
||||
},
|
||||
|
||||
fullname: {
|
||||
label: this.$i18n.t('user_fullname'),
|
||||
label: this.$t('user_fullname'),
|
||||
props: {
|
||||
id: 'fullname',
|
||||
placeholder: this.$i18n.t('placeholder.fullname'),
|
||||
placeholder: this.$t('placeholder.fullname'),
|
||||
},
|
||||
},
|
||||
|
||||
mail: {
|
||||
label: this.$i18n.t('user_email'),
|
||||
label: this.$t('user_email'),
|
||||
props: { id: 'mail', choices: [] },
|
||||
},
|
||||
|
||||
mailbox_quota: {
|
||||
label: this.$i18n.t('user_mailbox_quota'),
|
||||
description: this.$i18n.t('mailbox_quota_description'),
|
||||
example: this.$i18n.t('mailbox_quota_example'),
|
||||
label: this.$t('user_mailbox_quota'),
|
||||
description: this.$t('mailbox_quota_description'),
|
||||
example: this.$t('mailbox_quota_example'),
|
||||
props: {
|
||||
id: 'mailbox-quota',
|
||||
placeholder: this.$i18n.t('mailbox_quota_placeholder'),
|
||||
placeholder: this.$t('mailbox_quota_placeholder'),
|
||||
},
|
||||
},
|
||||
|
||||
mail_aliases: {
|
||||
props: {
|
||||
placeholder: this.$i18n.t('placeholder.username'),
|
||||
placeholder: this.$t('placeholder.username'),
|
||||
choices: [],
|
||||
},
|
||||
},
|
||||
|
||||
mail_forward: {
|
||||
props: {
|
||||
placeholder: this.$i18n.t('user_new_forward'),
|
||||
placeholder: this.$t('user_new_forward'),
|
||||
type: 'email',
|
||||
},
|
||||
},
|
||||
|
||||
change_password: {
|
||||
label: this.$i18n.t('password'),
|
||||
description: this.$i18n.t('good_practices_about_user_password'),
|
||||
label: this.$t('password'),
|
||||
description: this.$t('good_practices_about_user_password'),
|
||||
descriptionVariant: 'warning',
|
||||
props: {
|
||||
id: 'change_password',
|
||||
|
@ -222,7 +222,7 @@ export default {
|
|||
},
|
||||
|
||||
confirmation: {
|
||||
label: this.$i18n.t('password_confirmation'),
|
||||
label: this.$t('password_confirmation'),
|
||||
props: {
|
||||
id: 'confirmation',
|
||||
type: 'password',
|
||||
|
@ -315,7 +315,7 @@ export default {
|
|||
}
|
||||
|
||||
if (Object.keys(data).length === 0) {
|
||||
this.serverError = this.$i18n.t('error_modify_something')
|
||||
this.serverError = this.$t('error_modify_something')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -49,19 +49,19 @@ export default {
|
|||
|
||||
fields: {
|
||||
csvfile: {
|
||||
label: this.$i18n.t('users_import_csv_file'),
|
||||
description: this.$i18n.t('users_import_csv_file_desc'),
|
||||
label: this.$t('users_import_csv_file'),
|
||||
description: this.$t('users_import_csv_file_desc'),
|
||||
component: 'FileItem',
|
||||
props: {
|
||||
id: 'csvfile',
|
||||
accept: 'text/csv',
|
||||
placeholder: this.$i18n.t('placeholder.file'),
|
||||
placeholder: this.$t('placeholder.file'),
|
||||
},
|
||||
},
|
||||
|
||||
update: {
|
||||
label: this.$i18n.t('users_import_update'),
|
||||
description: this.$i18n.t('users_import_update_desc'),
|
||||
label: this.$t('users_import_update'),
|
||||
description: this.$t('users_import_update_desc'),
|
||||
component: 'CheckboxItem',
|
||||
props: {
|
||||
id: 'update',
|
||||
|
@ -69,8 +69,8 @@ export default {
|
|||
},
|
||||
|
||||
delete: {
|
||||
label: this.$i18n.t('users_import_delete'),
|
||||
description: this.$i18n.t('users_import_delete_desc'),
|
||||
label: this.$t('users_import_delete'),
|
||||
description: this.$t('users_import_delete_desc'),
|
||||
component: 'CheckboxItem',
|
||||
props: {
|
||||
id: 'delete',
|
||||
|
@ -90,8 +90,8 @@ export default {
|
|||
async onSubmit() {
|
||||
if (this.form.delete) {
|
||||
const confirmed = await this.$askConfirmation(
|
||||
this.$i18n.t('users_import_confirm_destructive'),
|
||||
{ okTitle: this.$i18n.t('users_import_delete_others') },
|
||||
this.$t('users_import_confirm_destructive'),
|
||||
{ okTitle: this.$t('users_import_delete_others') },
|
||||
)
|
||||
if (!confirmed) return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue