This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts-bar-racing.git
commit 5fdd6de1fa8d85164d679fc808bc0de0eeb968ca Author: Ovilia <zwl.s...@gmail.com> AuthorDate: Mon Feb 21 18:05:50 2022 +0800 fix: update i18n --- src/components/BBody.vue | 16 ++++++++++------ src/components/BChart.vue | 2 +- src/i18n/en-US.ts | 7 +++++++ src/i18n/zh-CN.ts | 7 +++++++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/components/BBody.vue b/src/components/BBody.vue index 9ba94c7..fc549af 100644 --- a/src/components/BBody.vue +++ b/src/components/BBody.vue @@ -153,10 +153,13 @@ </el-col> </el-row> <el-row> - <el-button @click="downloadVideo"> + <el-button @click="downloadVideo" v-if="isChrome"> <i class="el-icon-video-camera"></i> {{$t('generateVideo')}} </el-button> + <el-label class="mt-4 text-red-600" v-if="!isChrome"> + {{$t('videoSupported')}} + </el-label> </el-row> </el-form> </div> @@ -204,6 +207,7 @@ export default defineComponent({ data() { const i18n = this.$i18n as any; return { + isChrome: /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor), selectedDemo: 'complicated', demoData: expectancy, title: i18n.t('titleComplicated'), @@ -298,8 +302,8 @@ export default defineComponent({ async downloadVideo() { if (!this.width || !this.height) { this.$notify.error({ - title: '视频高度宽度错误!', - message: '高度宽度不能为 0', + title: this.$i18n.t('videSizeError'), + message: this.$i18n.t('videSizeErrorHint'), duration: 0, position: 'bottom-left' }); @@ -311,7 +315,7 @@ export default defineComponent({ this.isExportingVideo = false; if (isSuccess) { this.$notify({ - title: '导出成功!', + title: this.$i18n.t('videoSuccess'), type: 'success', duration: 3000, position: 'bottom-left' @@ -319,8 +323,8 @@ export default defineComponent({ } else { this.$notify.error({ - title: '导出失败!', - message: '建议使用最新版 Chrome 或 Firefox', + title: this.$i18n.t('videoFail'), + message: this.$i18n.t('videoFailHint'), duration: 0, position: 'bottom-left' }); diff --git a/src/components/BChart.vue b/src/components/BChart.vue index 9cc2dae..a5c080c 100644 --- a/src/components/BChart.vue +++ b/src/components/BChart.vue @@ -10,7 +10,7 @@ <i class="el-icon-loading"></i> {{$t('exporting')}} <el-button @click="cancelDownload()" > - 取消 + {{$t('cancel')}} </el-button> </div> <div diff --git a/src/i18n/en-US.ts b/src/i18n/en-US.ts index fa02865..90d106b 100644 --- a/src/i18n/en-US.ts +++ b/src/i18n/en-US.ts @@ -15,7 +15,14 @@ export default { videoWidth: 'Video width', videoHeight: 'Video height', videoFps: 'Video FPS', + videoSupported: 'Please use Chrome to generate video', + videoSuccess: 'Successfully exported!', + videoFail: 'Failed to export!', + videoFailHint: 'Please use the latest Chrome browser', + videSizeError: 'Video size error!', + videSizeErrorHint: 'Height and width cannot be 0', generateVideo: 'Generate Video', + cancel: 'Cancel', data: 'Data', color: 'Color', blueberry: 'Blueberry', diff --git a/src/i18n/zh-CN.ts b/src/i18n/zh-CN.ts index 7bbda85..ecd3dbc 100644 --- a/src/i18n/zh-CN.ts +++ b/src/i18n/zh-CN.ts @@ -19,7 +19,14 @@ const langCn: DEFAULT_LANG_TYPE = { videoWidth: '视频宽度', videoHeight: '视频高度', videoFps: '视频帧率', + videoSupported: '请使用 Chrome 生成视频', + videoSuccess: '导出成功!', + videoFail: '导出失败!', + videoFailHint: '建议使用最新版 Chrome 浏览器', + videSizeError: '视频高度宽度错误!', + videSizeErrorHint: '高度宽度不能为 0', generateVideo: '生成视频', + cancel: '取消', data: '数据', color: '颜色', blueberry: '蓝莓', --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org