docs: improve demo translating

This commit is contained in:
chenjiahan
2020-12-11 10:07:07 +08:00
parent b3dfb4997f
commit 09858eb1d3
15 changed files with 281 additions and 248 deletions
+28 -27
View File
@@ -42,37 +42,37 @@
<script>
import { ref } from 'vue';
import { useTranslate } from '@demo/use-translate';
import Toast from '../../toast';
import { useTranslate } from '../../composables/use-translate';
const i18n = {
'zh-CN': {
reset: '重置',
pause: '暂停',
start: '开始',
finished: '倒计时结束',
millisecond: '毫秒级渲染',
customStyle: '自定义样式',
customFormat: '自定义格式',
manualControl: '手动控制',
formatWithDay: 'DD 天 HH 时 mm 分 ss 秒',
},
'en-US': {
reset: 'Reset',
pause: 'Pause',
start: 'Start',
finished: 'Finished',
millisecond: 'Millisecond',
customStyle: 'Custom Style',
customFormat: 'Custom Format',
manualControl: 'Manual Control',
formatWithDay: 'DD Day, HH:mm:ss',
},
};
export default {
i18n: {
'zh-CN': {
reset: '重置',
pause: '暂停',
start: '开始',
finished: '倒计时结束',
millisecond: '毫秒级渲染',
customStyle: '自定义样式',
customFormat: '自定义格式',
manualControl: '手动控制',
formatWithDay: 'DD 天 HH 时 mm 分 ss 秒',
},
'en-US': {
reset: 'Reset',
pause: 'Pause',
start: 'Start',
finished: 'Finished',
millisecond: 'Millisecond',
customStyle: 'Custom Style',
customFormat: 'Custom Format',
manualControl: 'Manual Control',
formatWithDay: 'DD Day, HH:mm:ss',
},
},
setup() {
const t = useTranslate();
const t = useTranslate(i18n);
const time = ref(30 * 60 * 60 * 1000);
const countDown = ref(null);
@@ -90,6 +90,7 @@ export default {
};
return {
t,
time,
start,
pause,