refactor(client): i18n.locale -> i18n.ts
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<MkSpacer :content-max="800" :margin-min="16" :margin-max="32">
|
||||
<div class="cwepdizn _formRoot">
|
||||
<FormFolder :default-open="true" class="_formBlock">
|
||||
<template #label>{{ i18n.locale.backgroundColor }}</template>
|
||||
<template #label>{{ i18n.ts.backgroundColor }}</template>
|
||||
<div class="cwepdizn-colors">
|
||||
<div class="row">
|
||||
<button v-for="color in bgColors.filter(x => x.kind === 'light')" :key="color.color" class="color _button" :class="{ active: theme.props.bg === color.color }" @click="setBgColor(color)">
|
||||
@@ -18,7 +18,7 @@
|
||||
</FormFolder>
|
||||
|
||||
<FormFolder :default-open="true" class="_formBlock">
|
||||
<template #label>{{ i18n.locale.accentColor }}</template>
|
||||
<template #label>{{ i18n.ts.accentColor }}</template>
|
||||
<div class="cwepdizn-colors">
|
||||
<div class="row">
|
||||
<button v-for="color in accentColors" :key="color" class="color rounded _button" :class="{ active: theme.props.accent === color }" @click="setAccentColor(color)">
|
||||
@@ -29,7 +29,7 @@
|
||||
</FormFolder>
|
||||
|
||||
<FormFolder :default-open="true" class="_formBlock">
|
||||
<template #label>{{ i18n.locale.textColor }}</template>
|
||||
<template #label>{{ i18n.ts.textColor }}</template>
|
||||
<div class="cwepdizn-colors">
|
||||
<div class="row">
|
||||
<button v-for="color in fgColors" :key="color" class="color char _button" :class="{ active: (theme.props.fg === color.forLight) || (theme.props.fg === color.forDark) }" @click="setFgColor(color)">
|
||||
@@ -41,22 +41,22 @@
|
||||
|
||||
<FormFolder :default-open="false" class="_formBlock">
|
||||
<template #icon><i class="fas fa-code"></i></template>
|
||||
<template #label>{{ i18n.locale.editCode }}</template>
|
||||
<template #label>{{ i18n.ts.editCode }}</template>
|
||||
|
||||
<div class="_formRoot">
|
||||
<FormTextarea v-model="themeCode" tall class="_formBlock">
|
||||
<template #label>{{ i18n.locale._theme.code }}</template>
|
||||
<template #label>{{ i18n.ts._theme.code }}</template>
|
||||
</FormTextarea>
|
||||
<FormButton primary class="_formBlock" @click="applyThemeCode">{{ i18n.locale.apply }}</FormButton>
|
||||
<FormButton primary class="_formBlock" @click="applyThemeCode">{{ i18n.ts.apply }}</FormButton>
|
||||
</div>
|
||||
</FormFolder>
|
||||
|
||||
<FormFolder :default-open="false" class="_formBlock">
|
||||
<template #label>{{ i18n.locale.addDescription }}</template>
|
||||
<template #label>{{ i18n.ts.addDescription }}</template>
|
||||
|
||||
<div class="_formRoot">
|
||||
<FormTextarea v-model="description">
|
||||
<template #label>{{ i18n.locale._theme.description }}</template>
|
||||
<template #label>{{ i18n.ts._theme.description }}</template>
|
||||
</FormTextarea>
|
||||
</div>
|
||||
</FormFolder>
|
||||
@@ -167,7 +167,7 @@ function applyThemeCode() {
|
||||
} catch (err) {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
text: i18n.locale._theme.invalid,
|
||||
text: i18n.ts._theme.invalid,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ function applyThemeCode() {
|
||||
|
||||
async function saveAs() {
|
||||
const { canceled, result: name } = await os.inputText({
|
||||
title: i18n.locale.name,
|
||||
title: i18n.ts.name,
|
||||
allowEmpty: false,
|
||||
});
|
||||
if (canceled) return;
|
||||
@@ -204,18 +204,18 @@ watch($$(theme), apply, { deep: true });
|
||||
|
||||
defineExpose({
|
||||
[symbols.PAGE_INFO]: {
|
||||
title: i18n.locale.themeEditor,
|
||||
title: i18n.ts.themeEditor,
|
||||
icon: 'fas fa-palette',
|
||||
bg: 'var(--bg)',
|
||||
actions: [{
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-eye',
|
||||
text: i18n.locale.preview,
|
||||
text: i18n.ts.preview,
|
||||
handler: showPreview,
|
||||
}, {
|
||||
asFullButton: true,
|
||||
icon: 'fas fa-check',
|
||||
text: i18n.locale.saveAs,
|
||||
text: i18n.ts.saveAs,
|
||||
handler: saveAs,
|
||||
}],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user