Skip to content

Commit

Permalink
feat: add i18n support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitxeno committed Jul 26, 2023
1 parent 71fc5ce commit a1cef3f
Show file tree
Hide file tree
Showing 15 changed files with 749 additions and 146 deletions.
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"i18n-ally.enabledFrameworks": [
"vue",
"i18next"
],
"i18n-ally.enabledParsers": [
"js",
"json"
],
"i18n-ally.localesPaths": [
"view/src/locales"
],
"i18n-ally.keystyle": "nested"
}
58 changes: 58 additions & 0 deletions view/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"axios": "^1.4.0",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.8",
"i18next": "^23.2.11",
"i18next-browser-languagedetector": "^7.1.0",
"i18next-vue": "^3.0.0-rc.1",
"vue": "^3.2.31",
"vue-router": "^4.2.2",
"vue3-popper": "^1.5.0",
Expand Down
1 change: 1 addition & 0 deletions view/src/assets/icons/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions view/src/assets/icons/language.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions view/src/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import i18next from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import en from "./locales/en/translation.json";
import zh_cn from "./locales/zh_cn/translation.json";

i18next.use(LanguageDetector).init({
// debug: true,
fallbackLng: "en",
resources: {
en: {
name: "English",
translation: en,
},
"zh-CN": {
name: "中文",
translation: zh_cn,
},
},
});

export default i18next;
172 changes: 172 additions & 0 deletions view/src/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"nav": {
"settings": "Settings",
"language": "English"
},
"home": {
"heading": {
"pairable_devices": "Pairable Devices",
"paired_devices": "Paired Devices",
"service_status": "Service Status",
"installed_app": "Installed Apps"
},
"dialog": {
"delete_confirm": {
"title": "Are you sure you want to delete {{name}}?",
"button": {
"cancel": "Cancel",
"confirm": "Confirm"
}
}
},
"toast": {
"refresh_app_started": "Refresh of {{name}} started",
"installing_app": "Installing…"
},
"sidebar": {
"device_status": {
"pairable": "Pairable",
"paired": "Paired",
"unpaired": "Unpaired"
},
"tips": {
"no_paired_devices": "No connected devices",
"how_pair_device": "For AppleTV, go to 'Settings -> Remotes and Devices -> Remote App and Devices' to enter pairing mode for completion"
}
},
"table": {
"header": {
"app": "App",
"device": "Device",
"account": "Account",
"expired_date": "Expiration Date",
"operate": "Operation"
},
"expired_time_format": {
"expired_tips": "Expired",
"days": "{{num}} DAYS"
},
"refresh_date_format": {
"installing_tips": "Installing...",
"seconds": "{{num}} seconds ago",
"miniutes": "{{num}} minutes ago",
"hours": "{{num}} hours ago",
"days": "{{num}} days ago"
},
"button": {
"refresh": "Refresh",
"delete": "Delete"
},
"tips": {
"view_log": "Click to view installation log",
"no_data": "No data",
"footer": "By default, when the app expiration time is less than 1 day, it will automatically refresh between 3-6am."
}
}
},
"pair": {
"toast": {
"pin_incorrect": "Incorrect PIN code",
"pair_error": "Pairing error. Please check the console for more information.",
"no_device_found": "Device not found. Pleasemake sure the usbmuxd service is running."
},
"step": {
"start": {
"title": "Start",
"device": "Device",
"button": "Start Pairing"
},
"pin": {
"title": "Enter PIN code",
"loading": "Connecting…",
"placeholder": "Please enter the PIN displayed on AppleTV",
"button": "Confirm"
},
"completed": {
"title": "Pairing Completed",
"msg": "Pairing successful",
"button": "Back"
}
}
},
"install": {
"tips": {
"warning": "During initial installation, you need to authorize and trust this device. Please make sure you have an iPhone with a logged-in installation account nearby and enter the displayed verification code promptly. Failure to verify within the time limit will result in temporary account suspension, requiring password reset to lift the suspension."
},
"dialog": {
"input_pin": {
"title": "Please enter the verification code shown on your iPhone",
"input": {
"placeholder": "Please allow and enter the verification code shown on your iPhone"
},
"button": {
"submit": "Submit"
}
}
},
"toast": {
"install_success": "Installation Successful",
"install_failed": "Installation Failed. Please check logs for more information."
},
"form": {
"choose_ipa": {
"label": "Choose IPA:"
},
"account": {
"label": "Apple Account:",
"alt": "For account security, please do not use your primary account for installation."
},
"password": {
"label": "Apple Password:"
},
"button": {
"back": "Back",
"submit": "Install"
}
}
},
"settings": {
"toast": {
"save_success": "Save Successful",
"notify_success": "Notification Sent Successfully"
},
"notification": {
"title": "Notifications",
"toggle": {
"label": "Enable"
},
"type": {
"label": "Notification Type"
},
"weixin": {
"title": "Wecom",
"corp_id": "CorpID",
"corp_secret": "CorpSecret",
"agent_id": "AgentID",
"touser": "ToUser"
},
"button": {
"submit": "Save",
"send_test": "Send Test Notification"
}
},
"refresh": {
"title": "Auto Refresh App",
"toggle": {
"label": "Enable"
},
"mode": {
"label": "Refresh Mode",
"day_before_expired": "One day before expiration",
"daily": "Daily"
},
"run_time": {
"label": "Running Time Period",
"format_tips": "Linux crontab format, restricted by refresh mode"
},
"button": {
"submit": "Save"
}
}
}
}
Loading

0 comments on commit a1cef3f

Please sign in to comment.