Skip to content

Commit

Permalink
feat:导入导出的i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Dec 10, 2023
1 parent 003aa74 commit 82f93a4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
20 changes: 16 additions & 4 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title":{
"title": {
"message": "CookiesClerk",
"description": "Title text"
},
Expand All @@ -21,7 +21,7 @@
},
"domainExample": {
"message": "Example: google.com",
"description": "Placeholder for the new domain input box"
"description": "Placeholder for the new domain input box"
},
"addNewDomain": {
"message": "Add",
Expand All @@ -35,7 +35,7 @@
"message": "Restrict tracked domain's links to open only in the current tab",
"description": "Description for the second checkbox"
},
"onStartupClearEnabled":{
"onStartupClearEnabled": {
"message": "Clear closed and no-alias cookies on startup",
"description": "Description for the third checkbox"
},
Expand Down Expand Up @@ -79,6 +79,18 @@
"message": "Options",
"description": "open options"
},
"exportData": {
"message": "Export Data",
"description": "Title for the Export Data button"
},
"loading": {
"message": "Loading...",
"description": "Loading text"
},
"importData": {
"message": "Import Data",
"description": "Title for the Import Data button"
},
"greeting": {
"message": "Hello",
"description": "Greeting text"
Expand All @@ -87,4 +99,4 @@
"message": "Goodbye",
"description": "Farewell text"
}
}
}
22 changes: 17 additions & 5 deletions _locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"title":{
"title": {
"message": "Cookies店员",
"description": "Title text"
},
"accountManagement": {
"accountManagement": {
"message": "账户管理",
"description": "账户管理部分的标题"
},
Expand Down Expand Up @@ -43,7 +43,7 @@
"message": "删除",
"description": "删除按钮的标签"
},
"saveCookiesToAccount": {
"saveCookiesToAccount": {
"message": "保存Cookies到账户",
"description": "保存Cookies按钮的标题"
},
Expand Down Expand Up @@ -75,10 +75,22 @@
"message": "加载所有Cookies",
"description": "加载所有Cookies按钮的标题"
},
"options": {
"options": {
"message": "选项",
"description": "打开选项界面"
},
"exportData": {
"message": "导出数据",
"description": "导出数据按钮的标题"
},
"loading": {
"message": "加载中...",
"description": "加载中的提示"
},
"importData": {
"message": "导入数据",
"description": "导入数据按钮的标题"
},
"greeting": {
"message": "Hello",
"description": "Greeting text"
Expand All @@ -87,4 +99,4 @@
"message": "Goodbye",
"description": "Farewell text"
}
}
}
6 changes: 3 additions & 3 deletions src/components/StorageManager.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<template>
<div class="flex items-center justify-between space-mx-4">
<button @click="exportData" class=" rounded hover:bg-green-600 transition ml-6">
<button @click="exportData" class=" rounded hover:bg-green-600 transition ml-6" data-i18n="exportData">
导出数据
</button>

<input type="file" id="fileInput" ref="fileInput" @change="handleFileChange" accept=".json" class="hidden">

<p v-if="state.isLoading" class="text-gray-500">
<p v-if="state.isLoading" class="text-gray-500" data-i18n="loading">
加载中...
</p>

<p v-if="state.errorMessage" class="text-red-500">
{{ state.errorMessage }}
</p>

<button @click="triggerFileInput" class=" rounded hover:bg-green-600 transition mr-6">
<button @click="triggerFileInput" class=" rounded hover:bg-green-600 transition mr-6" data-i18n="importData">
导入数据
</button>
</div>
Expand Down

0 comments on commit 82f93a4

Please sign in to comment.