From d6cd1c81fb157e01d725281f1f2f4d14c64694d9 Mon Sep 17 00:00:00 2001 From: winbin Date: Thu, 11 Feb 2021 00:57:36 +0800 Subject: [PATCH 01/14] Add The Language Change And Chinese --- package.json | 1 + src/App.vue | 12 +- src/components/ConnectingDialog.vue | 6 +- src/components/SelectPrinterDialog.vue | 28 +-- src/components/TopCornerMenu.vue | 20 +- src/components/UpdateDialog.vue | 6 +- src/components/charts/TempChart.vue | 2 +- src/components/panels/ControlPanel.vue | 6 +- src/components/panels/ExtruderPanel.vue | 11 +- src/components/panels/KlippyStatePanel.vue | 8 +- src/components/panels/MinSettingsPanel.vue | 16 +- src/components/panels/MiniconsolePanel.vue | 14 +- src/components/panels/MiscellaneousPanel.vue | 4 +- .../panels/MoonrakerFailedPluginsPanel.vue | 8 +- .../panels/Settings/ConfigFilesPanel.vue | 60 ++--- .../panels/Settings/ConsolePanel.vue | 8 +- .../panels/Settings/ControlPanel.vue | 212 ++-------------- .../panels/Settings/DashboardPanel.vue | 8 +- .../panels/Settings/EndstopPanel.vue | 6 +- .../panels/Settings/GeneralPanel.vue | 4 +- .../panels/Settings/LanguagePanel.vue | 68 +++++ .../panels/Settings/LimitsPanel.vue | 10 +- .../panels/Settings/LogfilesPanel.vue | 2 +- .../panels/Settings/MacrosPanel.vue | 2 +- .../panels/Settings/PresetsPanel.vue | 22 +- .../panels/Settings/RemotePrintersPanel.vue | 16 +- .../panels/Settings/RunoutPanel.vue | 2 +- .../panels/Settings/UpdatePanel.vue | 10 +- .../panels/Settings/WebcamPanel.vue | 12 +- src/components/panels/Settings/index.js | 2 + src/components/panels/StatusPanel.vue | 30 +-- src/components/panels/ToolsPanel.vue | 36 +-- src/components/panels/WebcamPanel.vue | 4 +- src/components/panels/ZOffsetPanel.vue | 4 +- src/locales/en.json | 237 ++++++++++++++++++ src/locales/zh.json | 237 ++++++++++++++++++ src/main.js | 7 + src/pages/Console.vue | 16 +- src/pages/Files.vue | 94 +++---- src/pages/settings/interface.vue | 1 + src/plugins/i18n.js | 26 ++ src/store/gui/actions.js | 4 +- src/store/gui/getters.js | 2 - src/store/gui/mutations.js | 1 + src/store/printer/getters.js | 2 +- src/store/variables.js | 2 +- vue.config.js | 8 + 47 files changed, 862 insertions(+), 435 deletions(-) create mode 100644 src/components/panels/Settings/LanguagePanel.vue create mode 100644 src/locales/en.json create mode 100644 src/locales/zh.json create mode 100644 src/plugins/i18n.js diff --git a/package.json b/package.json index 2766379f..98b9a473 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "vue-context": "^6.0.0", "vue-github-api": "^0.1.7", "vue-headful": "^2.1.0", + "vue-i18n": "^8.22.4", "vue-plotly": "^1.1.0", "vue-prism-editor": "^1.2.2", "vue-resource": "^1.5.1", diff --git a/src/App.vue b/src/App.vue index 159ec50f..36b30131 100644 --- a/src/App.vue +++ b/src/App.vue @@ -57,7 +57,7 @@ v-if="category.title === 'Settings' && isUpdateAvailable" >mdi-progress-upload - {{ category.title }} + {{ $t(`Router.${category.title}`) }} mdi-chevron-down @@ -66,7 +66,7 @@ @@ -81,9 +81,9 @@ - SAVE CONFIG - mdi-file-uploadUpload & Print - mdi-alert-circle-outlineEmergency Stop + {{ $t("App.SAVECONFIG")}} + mdi-file-upload{{ $t("App.UploadPrint")}} + mdi-alert-circle-outline{{ $t("App.EmergencyStop")}} @@ -106,7 +106,7 @@ dark v-model="uploadSnackbar.status" > - Uploading {{ uploadSnackbar.filename }}
+ {{ $t("App.Uploading")}} {{ uploadSnackbar.filename }}
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s
- Klipper Control + {{ $t("App.KlipperControl") }} - mdi-restartRestart + mdi-restart{{ $t("App.Restart") }} - mdi-restartFirmware Restart + mdi-restart{{ $t("App.FirmwareRestart") }} - Restart Services + {{ $t("App.RestartServices") }} - mdi-restartKlipper + mdi-restart{{ $t("App.Klipper") }} - mdi-restartMoonraker + mdi-restart{{ $t("App.Moonraker") }}
- Power Devices + {{ $t("App.PowerDevices") }} mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}{{ device.device }} @@ -38,12 +38,12 @@
- Host Control + {{ $t("App.HostControl") }} - mdi-powerReboot + mdi-power{{ $t("App.Reboot") }} - mdi-powerShutdown + mdi-power{{ $t("App.Shutdown") }}
diff --git a/src/components/UpdateDialog.vue b/src/components/UpdateDialog.vue index 85073851..6631c13a 100644 --- a/src/components/UpdateDialog.vue +++ b/src/components/UpdateDialog.vue @@ -25,7 +25,7 @@ - mdi-updateUpdating {{ application }}{{ complete ? " done!" : "..." }} + mdi-update{{ $t("App.Updating")}} {{ application }}{{ complete ? " done!" : "..." }} @@ -45,7 +45,7 @@ color="primary" > diff --git a/src/components/panels/MinSettingsPanel.vue b/src/components/panels/MinSettingsPanel.vue index d1f039ed..4ca0db98 100644 --- a/src/components/panels/MinSettingsPanel.vue +++ b/src/components/panels/MinSettingsPanel.vue @@ -12,21 +12,21 @@ - Missing configuration + {{ $t("Dashboard.MissingConfiguration") }} -

virtual_sdcard is not defined in config.

-

pause_resume is not defined in config.

-

display_status is not defined in config.

-

gcode_macro PAUSE is not defined in config.

-

gcode_macro RESUME is not defined in config.

-

gcode_macro CANCEL_PRINT is not defined in config.

+

virtual_sdcard {{ $t("Dashboard.IsNotDefinedInConfig") }}

+

pause_resume {{ $t("Dashboard.IsNotDefinedInConfig") }}

+

display_status {{ $t("Dashboard.IsNotDefinedInConfig") }}

+

gcode_macro PAUSE {{ $t("Dashboard.IsNotDefinedInConfig") }}

+

gcode_macro RESUME {{ $t("Dashboard.IsNotDefinedInConfig") }}

+

gcode_macro CANCEL_PRINT {{ $t("Dashboard.IsNotDefinedInConfig") }}

- mdi-informationmore information + mdi-information{{ $t("Dashboard.MoreInformation") }}
diff --git a/src/components/panels/MiniconsolePanel.vue b/src/components/panels/MiniconsolePanel.vue index fb59279b..58f501dd 100644 --- a/src/components/panels/MiniconsolePanel.vue +++ b/src/components/panels/MiniconsolePanel.vue @@ -23,19 +23,19 @@ - mdi-console-lineConsole + mdi-console-line{{ $t("Dashboard.Console") }} - + - + - + @@ -45,7 +45,7 @@ - mdi-send send + mdi-send {{ $t("Dashboard.Send") }} @@ -81,7 +81,7 @@ sort-by="date" > diff --git a/src/components/panels/Settings/ConfigFilesPanel.vue b/src/components/panels/Settings/ConfigFilesPanel.vue index e7420fff..6b68235f 100644 --- a/src/components/panels/Settings/ConfigFilesPanel.vue +++ b/src/components/panels/Settings/ConfigFilesPanel.vue @@ -29,7 +29,7 @@ - Config Files + {{ $t('Setting.ConfigFiles') }} @@ -43,13 +43,13 @@ - + - Current path: {{ this.currentPath === "" ? "/" : this.currentPath }} + {{ $t('Setting.CurrentPath') }} {{ this.currentPath === "" ? "/" : this.currentPath }} - min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°
max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°
+ {{ $t('Dashboard.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°
{{ $t('Dashboard.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°
{{ values.value.toFixed(1) }} {{ values.unit }} @@ -160,7 +160,7 @@ - mdi-webcamWebcam + mdi-webcam{{ $t('Setting.Webcam')}} - Webcam +
diff --git a/src/components/panels/ZOffsetPanel.vue b/src/components/panels/ZOffsetPanel.vue index 2f3fe043..b49a22a2 100644 --- a/src/components/panels/ZOffsetPanel.vue +++ b/src/components/panels/ZOffsetPanel.vue @@ -6,7 +6,7 @@ - Z Baby Stepping + {{ $t("Dashboard.ZBabyStepping") }} @@ -14,7 +14,7 @@ -

Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm

+

{{ $t("Dashboard.CurrentOffset") }} {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm

diff --git a/src/locales/en.json b/src/locales/en.json new file mode 100644 index 00000000..7634e9ff --- /dev/null +++ b/src/locales/en.json @@ -0,0 +1,237 @@ +{ + "App": { + "SAVECONFIG": "SAVE CONFIG", + "UploadPrint": "Upload & Print", + "EmergencyStop": "Emergency Stop", + "Uploading": "Uploading", + "Connecting": "Connecting", + "To": "to", + "Failed": "failed", + "CannotNotConnectTo": "Cannot not connect to", + "TryAgain": "try again", + "ConnectionTo": "Connection to", + "ConnectionFailed": "Connection failed", + "SelectPrinter": "Select Printer", + "AddPrinter": "Add Printer", + "EditPrinter": "Edit Printer", + "UpdatePrinter": "Update Printer", + "ChangePrinter": "Change Printer", + "Hello": "Hello and welcome to the remote mode of Mainsail!", + "PleaseRememberToAdd": "Please remember to add", + "InMoonrakerConf": "in moonraker.conf within 'cors_domains'.", + "YouCanFindMore": "You can find more details at", + "Remotemode": "docs.mainsail.xyz/remotemode", + "Empty": "Empty", + "Close": "Close", + "KlipperControl": "Klipper Control", + "Restart": "Restart", + "FirmwareRestart": "Firmware Restart", + "RestartServices": "Restart Services", + "Klipper": "Klipper", + "Moonraker": "Moonraker", + "PowerDevices": "Power Devices", + "HostControl": "Host Control", + "Reboot": "Reboot", + "Shutdown": "Shutdown" + }, + "Router" : { + "Dashboard": "Dashboard", + "Printers": "Printers", + "Settings": "Settings", + "Webcam": "Webcam", + "Console": "Console", + "Heightmap": "Heightmap", + "G-Code Files": "G-Code Files", + "Machine": "Machine", + "Interface": "Interface" + }, + "Dashboard": { + "MissingConfiguration": "Missing configuration", + "IsNotDefinedInConfig": "is not defined in config.", + "MoreInformation": "more information", + "MoonrakerFailedPlugins": "Moonraker Failed Plugins", + "MoonrakerErrorInfo": "An error was detected while loading the moonraker plugins. Please check the logfile and fix the issue.", + "FollowingPluginHasAnError": "Following plugin has an error:", + "DownloadLog": "Download Log", + "PausePrint": "Pause print", + "CancelPrint": "Cancel print", + "ResumePrint": "Resume print", + "ClearPrintStats": "Clear print stats", + "ReprintJob": "Reprint job", + "Filament": "Filament", + "Print": "Print", + "Total": "Total", + "Speed": "Speed", + "Layer": "Layer", + "ETA": "ETA", + "File": "File", + "Slicer": "Slicer", + "ZBabyStepping": "Z Baby Stepping", + "CurrentOffset": "Current Offset: ", + "Home": "Home", + "All": "All", + "QGL": "QGL", + "ZTilt": "Z Tilt", + "FeedAmountIn": "Feed amount in", + "FeedrateIn": "Feedrate in", + "Retract": "Retract", + "Extrude": "Extrude", + "PrintSettings": "Print Settings", + "Miscellaneous": "Miscellaneous", + "Temperatures": "Temperatures", + "Presets": "Presets", + "Cooldown": "Cooldown", + "Name": "Name", + "State": "State", + "Current": "Current", + "Target": "Target", + "Min": "min: ", + "Max": "max: ", + "ShowCurrentTemperatureInChart": "Show current temperature in chart", + "ShowTargetTemperatureInChart": "Show target temperature in chart", + "ShowPWMPowerInChart": "Show PWM-power in chart", + "Show": "Show", + "InList": "in list", + "SetupTemperatures": "Setup Temperatures", + "ShowChart": "Show Chart", + "AutoscaleChart": "Autoscale Chart", + "Console": "Console", + "SendCode": "Send code...", + "Send": "Send", + "Empty": "Empty", + "Setup Console": "Setup Console", + "Hide temperatures": "Hide temperatures", + "Custom filters": "Custom filters", + "Unknown": "Unknown" + }, + "Files": { + "GCodeFiles": "G-Code Files", + "UploadNewGcode": "Upload new Gcode", + "CreateNewDirectory": "Create new Directory", + "RefreshCurrentDirectory":"Refresh current Directory", + "SetupCurrentList":"Setup current list", + "HiddenFiles":"Hidden files", + "FreeDisk":"Free disk: ", + "Used":"Used: ", + "Free":"Free: ", + "Total":"Total: ", + "Files": "Files", + "Search":"Search", + "Empty": "Empty", + "blabla": "bla bla", + "DropFilesToAddGcode": "Drop files to add gcode.", + "PrintStart": "Print start", + "Preheat": "Preheat", + "Download": "Download", + "Rename": "Rename", + "Delete": "Delete", + "StartJob": "Start Job", + "DoYouWantToStart": "Do you want to start", + "No": "No", + "Yes": "Yes", + "NewDirectory": "New Directory", + "PleaseEnterANewDirectoryName": "Please enter a new directory name:", + "RenameFile": "Rename File", + "Name": "Name", + "Cancel": "Cancel", + "Create": "Create", + "RenameDirectory": "Rename Directory", + "Uploading": "Uploading", + "CurrentPath": "Current path", + "Filesize": "Filesize", + "LastModified": "Last modified", + "ObjectHeight": "Object Height", + "LayerHeight": "Layer Height", + "FilamentUsage": "Filament Usage", + "PrintTime": "Print Time", + "Slicer": "Slicer" + }, + "Console": { + "send": "send", + "SetupConsole": "Setup Console", + "SendCode": "Send code...", + "Empty": "Empty", + "HideTemperatures": "Hide temperatures", + "CustomFilters": "Custom filters", + "Date": "Date", + "Event": "Event" + }, + "Setting": { + "Language": "Language", + "General": "General", + "PrinterName": "Printer Name", + "ControlExtruder": "Control & Extruder", + "PreheatPresets": "Preheat Presets", + "Webcam": "Webcam", + "Tempchart": "Tempchart", + "Macros": "Macros", + "Dashboard": "Dashboard", + "Console": "Console", + "RemotePrinters": "Remote Printers", + "ConfigFiles": "Config Files", + "SetupCurrentList": "Setup current list", + "HiddenFiles": "Hidden files", + "CurrentPath: ": "Current path: ", + "Empty": "Empty", + "EditFile": "Edit file", + "Download": "Download", + "Rename": "Rename", + "Delete": "Delete", + "PleaseStandBy": "Please stand by", + "ConfigReference": "Config Reference", + "Save": "Save", + "SaveRestart": "Save & restart", + "RenameFile": "Rename File", + "Name": "Name", + "Cancel": "Cancel", + "Create": "Create", + "Edit": "Edit", + "CreateFile": "Create File", + "CreateFolder": "Create Folder", + "Uploading": "Uploading", + "Files": "Files", + "Filesize": "Filesize", + "LastModified": "Last modified", + "MachineLimits": "Machine Limits", + "Velocity": "Velocity", + "Acceleration": "Acceleration", + "Deceleration": "Deceleration", + "SquareCornerVelocity": "Square corner velocity", + "KlippyState": "Klippy-State: ", + "KlippyInfo": "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.", + "Restart": "Restart", + "FIRMWARERestart": "FIRMWARE Restart", + "UpdateManager": "Update Manager", + "CheckForUpdates": "Check for updates", + "System": "System", + "PackagesCanBeUpgraded": "packages can be upgraded", + "OSPackages": "OS-Packages", + "Endstops": "Endstops", + "Endstop": "Endstop", + "EndstopInfo": "Press the sync-button on the right-bottom to load the current endstop status.", + "Logfiles": "Logfiles", + "WebcamURL": "Webcam URL", + "Rotate": "Rotate", + "FlipWebcamHorizontally": "Flip webcam horizontally", + "FlipWebcamVertically": "Flip webcam vertically", + "ShowInNavigation": "Show in navigation", + "HideTemperatures": "Hide temperatures", + "CustomFilter": "Custom filter", + "Rules": "Rules", + "FeedrateXY": "Feedrate XY", + "FeedrateZ": "Feedrate Z", + "Cooldown": "Cooldown", + "AddPreset": "add preset", + "Preset": "Preset", + "CustomGCode": "Custom G-Code", + "PresetInfo": "You have to set minimum a target temperature or a custom gcode.", + "Store": "Store", + "Update": "Update", + "EditCooldown": "Edit Cooldown", + "UpdateCooldown": "Update Cooldown", + "AddPrinter": "Add Printer", + "EditPrinter": "Edit Printer", + "UpdatePrinter": "Update Printer", + "detected": "detected" + } +} \ No newline at end of file diff --git a/src/locales/zh.json b/src/locales/zh.json new file mode 100644 index 00000000..9a372fe8 --- /dev/null +++ b/src/locales/zh.json @@ -0,0 +1,237 @@ +{ + "App": { + "SAVECONFIG": "保存配置", + "UploadPrint": "上传并打印", + "EmergencyStop": "紧急停止", + "Uploading": "上传", + "Connecting": "连接", + "To": "到", + "Failed": "失败", + "CannotNotConnectTo": "无法连接到", + "TryAgain": "重试", + "ConnectionTo": "连接到", + "ConnectionFailed": "连接失败", + "SelectPrinter": "选择打印机", + "AddPrinter": "添加打印机", + "EditPrinter": "编辑打印机", + "UpdatePrinter": "更新打印机", + "ChangePrinter": "更换打印机", + "Hello": "大家好,欢迎来到主帆遥控模式!", + "PleaseRememberToAdd": "请记得添加", + "InMoonrakerConf": "在 moonraker.conf 的 'cors_domains' 中.", + "YouCanFindMore": "详情请浏览", + "Remotemode": "docs.mainsail.xyz/remotemode", + "Empty": "空的", + "Close": "关闭", + "KlipperControl": "Klipper 控制", + "Restart": "重启", + "FirmwareRestart": "固件重启", + "RestartServices": "重启服务", + "Klipper": "Klipper", + "Moonraker": "Moonraker", + "PowerDevices": "电力设备", + "HostControl": "主机控制", + "Reboot": "重启", + "Shutdown": "关机" + }, + "Router" : { + "Dashboard": "仪表盘", + "Printers": "打印机", + "Settings": "设置", + "Webcam": "摄像头", + "Console": "控制台", + "Heightmap": "Heightmap", + "G-Code Files": "G-Code 文件", + "Machine": "机器", + "Interface": "界面" + }, + "Dashboard": { + "MissingConfiguration": "缺少配置", + "IsNotDefinedInConfig": "未在配置中定义.", + "MoreInformation": "更多信息", + "MoonrakerFailedPlugins": "Moonraker 失败的插件", + "MoonrakerErrorInfo": "加载moonraker插件时检测到一个错误. 请检查日志文件并修复这个问题.", + "FollowingPluginHasAnError": "以下插件有一个错误:", + "DownloadLog": "下载日志", + "PausePrint": "暂停打印", + "CancelPrint": "取消打印", + "ResumePrint": "继续打印", + "ClearPrintStats": "清除打印统计信息", + "ReprintJob": "重新打印工作", + "Filament": "Filam耗材ent", + "Print": "打印", + "Total": "总计", + "Speed": "速度", + "Layer": "层", + "ETA": "ETA", + "File": "文件", + "Slicer": "切片", + "ZBabyStepping": "Z Baby Stepping", + "CurrentOffset": "当前偏移量: ", + "Home": "Home", + "All": "All", + "QGL": "QGL", + "ZTilt": "Z 倾斜", + "FeedAmountIn": "进料量", + "FeedrateIn": "输入", + "Retract": "回抽", + "Extrude": "挤出", + "PrintSettings": "打印设置", + "Miscellaneous": "其他", + "Temperatures": "温度", + "Presets": "预设", + "Cooldown": "冷却", + "Name": "名称", + "State": "状态", + "Current": "当前", + "Target": "目标", + "Min": "最小: ", + "Max": "最大: ", + "ShowCurrentTemperatureInChart": "在图表中显示当前温度", + "ShowTargetTemperatureInChart": "在图表中显示目标温度", + "ShowPWMPowerInChart": "在图表中显示PWM功率", + "Show": "显示", + "InList": "在列表中", + "SetupTemperatures": "设置温度", + "ShowChart": "显示图表", + "AutoscaleChart": "自动缩放图表", + "Console": "控制台", + "SendCode": "发送代码...", + "Send": "发送", + "Empty": "空的", + "SetupConsole": "设置控制台", + "HideTemperatures": "隐藏温度", + "CustomFilters": "自定义筛选器", + "Unknown": "未知" + }, + "Files": { + "GCodeFiles": "G-Code 文件", + "UploadNewGcode": "上传新 Gcode", + "CreateNewDirectory": "创建新目录", + "RefreshCurrentDirectory":"刷新当前目录", + "SetupCurrentList":"设置当前列表", + "HiddenFiles":"隐藏文件", + "FreeDisk":"可用磁盘: ", + "Used":"使用: ", + "Free":"空闲: ", + "Total":"总共: ", + "Files": "文件", + "Search":"搜索", + "Empty": "空的", + "blabla": "巴拉巴拉", + "DropFilesToAddGcode": "Drop files to add gcode.", + "PrintStart": "开始打印", + "Preheat": "预热", + "Download": "下载", + "Rename": "重命名", + "Delete": "删除", + "StartJob": "开始作业", + "DoYouWantToStart": "你想开始吗", + "No": "否", + "Yes": "是", + "NewDirectory": "新建目录", + "PleaseEnterANewDirectoryName": "请输入新的目录名称:", + "RenameFile": "重命名文件", + "Name": "名称", + "Cancel": "取消", + "Create": "创建", + "RenameDirectory": "重命名目录", + "Uploading": "上传", + "CurrentPath": "当前路径", + "Filesize": "文件大小", + "LastModified": "上次修改", + "ObjectHeight": "对象高度", + "LayerHeight": "层高", + "FilamentUsage": "耗材使用", + "PrintTime": "打印时间", + "Slicer": "切片" + }, + "Console": { + "send": "发送", + "SetupConsole": "设置控制台", + "SendCode": "发送代码...", + "Empty": "空的", + "HideTemperatures": "隐藏温度", + "CustomFilters": "自定义筛选器", + "Date": "时间", + "Event": "事件" + }, + "Setting": { + "Language": "语言", + "General": "一般", + "PrinterName": "打印机名称", + "ControlExtruder": "控制 & 挤出机", + "PreheatPresets": "预热预设", + "Webcam": "摄像头", + "Tempchart": "温度图", + "Macros": "宏", + "Dashboard": "仪表盘", + "Console": "控制台", + "RemotePrinters": "远程打印机", + "ConfigFiles": "配置文件", + "SetupCurrentList": "设置当前列表", + "HiddenFiles": "隐藏文件", + "CurrentPath": "当前路径: ", + "Empty": "空的", + "EditFile": "编辑文件", + "Download": "下载", + "Rename": "重命名", + "Delete": "删除", + "PleaseStandBy": "请等待", + "ConfigReference": "配置参考", + "Save": "保存", + "SaveRestart": "保存 & 重启", + "RenameFile": "重命名文件", + "Name": "名称", + "Cancel": "取消", + "Create": "创建", + "Edit": "编辑", + "CreateFile": "创建文件", + "CreateFolder": "创建文件夹", + "Uploading": "上传", + "Files": "文件", + "Filesize": "文件大小", + "LastModified": "上次修改", + "MachineLimits": "机器限制", + "Velocity": "速度", + "Acceleration": "加速", + "Deceleration": "减速", + "SquareCornerVelocity": "直角速度", + "KlippyState": "Klippy 状态: ", + "KlippyInfo": "Moonraker 不能连接到 Klippy! \n请检查Klipper服务是否正在运行, 并且是否配置了UDS (Unix域套接字). ", + "Restart": "重启", + "FIRMWARERestart": "固件重启", + "UpdateManager": "更新管理器", + "CheckForUpdates": "检查更新", + "System": "系统", + "PackagesCanBeUpgraded": "软件包可以升级", + "OSPackages": "OS包", + "Endstops": "限位开关", + "Endstop": "限位", + "EndstopInfo": "按右下角的同步按钮加载当前的限位状态。", + "Logfiles": "日志文件", + "WebcamURL": "摄像头链接", + "Rotate": "旋转", + "FlipWebcamHorizontally": "水平翻转摄像头 ", + "FlipWebcamVertically": "垂直翻转摄像头", + "ShowInNavigation": "在导航中显示 ", + "HideTemperatures": "隐藏温度", + "CustomFilter": "自定义筛选器", + "Rules": "规则", + "FeedrateXY": "XY 步进速度", + "FeedrateZ": "Z 步进速度", + "Cooldown": "冷却", + "AddPreset": "添加预设", + "Preset": "预设", + "CustomGCode": "自定义 G-Code", + "PresetInfo": "您必须设置最低目标温度或自定义gcode.", + "Store": "储存", + "Update": "更新", + "EditCooldown": "编辑冷却", + "UpdateCooldown": "更新冷却", + "AddPrinter": "添加打印机", + "EditPrinter": "编辑打印机", + "UpdatePrinter": "更新打印机", + "detected": "发现" + } +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 1e72a08b..51eeb0b9 100644 --- a/src/main.js +++ b/src/main.js @@ -2,12 +2,14 @@ import Vue from 'vue' import WebSocketClient from './plugins/wsClient' import App from './App.vue' import vuetify from './plugins/vuetify' +import i18n from './plugins/i18n' import VueResource from 'vue-resource' import './components' import store from './store' import router from './plugins/router' import vueHeadful from 'vue-headful'; + Vue.config.productionTip = false; Vue.use(VueResource); @@ -19,6 +21,7 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO Vue.component('vue-headful', vueHeadful); + fetch('/config.json') .then(res => res.json()) .then(file => { @@ -37,8 +40,10 @@ fetch('/config.json') vuetify, router, store, + i18n, render: h => h(App) }).$mount('#app') + }) .catch((error) => { let p = document.createElement("p"); @@ -47,3 +52,5 @@ fetch('/config.json') document.getElementById('app').append(p); window.console.error('Error:', error); }); + + diff --git a/src/pages/Console.vue b/src/pages/Console.vue index 25ed3892..58c843a1 100644 --- a/src/pages/Console.vue +++ b/src/pages/Console.vue @@ -34,7 +34,7 @@ - mdi-send send + mdi-send {{ $t('Console.send')}} - + - + - + @@ -83,7 +83,7 @@ mobile-breakpoint="0" > - bla bla + {{ $t('Files.blabla')}}
-
Drop files to add gcode.
+
{{ $t('Files.DropFilesToAddGcode')}}
- mdi-play Print start + mdi-play {{ $t("Files.PrintStart")}} - mdi-fire Preheat + mdi-fire {{ $t('Files.Preheat')}} - mdi-cloud-download Download + mdi-cloud-download {{ $t('Filse.Download')}} - mdi-rename-box Rename + mdi-rename-box {{ $t('Filse.Rename')}} - mdi-rename-box Rename + mdi-rename-box {{ $t('Filse.Rename')}} - mdi-delete Delete + mdi-delete {{ $t('Filse.Delete')}} - mdi-delete Delete + mdi-delete {{ $t('Filse.Delete')}} @@ -214,52 +214,52 @@ v-if="existsBigThumbnail(dialogPrintFile.item)" :src="'data:image/gif;base64,'+getBigThumbnail(dialogPrintFile.item)" > - Start Job - Do you want to start {{ dialogPrintFile.item.filename }}? + {{ $t('Files.StartJob') }} + {{ $t('Files.DoYouWantToStart') + dialogPrintFile.item.filename }}? - No - Yes + {{ $t('Files.No')}} + {{$t('Files.Yes')}} - New Directory + {{ $t('Files.NewDirectory') }} - Please enter a new directory name: + {{ $t('Files.PleaseEnterANewDirectoryName') }} - Cancel - create + {{ $t('Files.Cancel') }} + {{ $t('Files.Create') }} - Rename File + {{ $t('Files.RenameFile')}} - + - Cancel - rename + {{ $t('Files.Cancel') }} + {{ $t('Files.Rename') }} - Rename Directory + {{ $t('Files.RenameDirectory') }} - Cancel - rename + {{ $t('Files.Cancel') }} + {{ $t('Files.Rename') }} @@ -272,7 +272,7 @@ dark v-model="uploadSnackbar.status" > - ({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})Uploading {{ uploadSnackbar.filename }}
+ ({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }}){{ $t("Files.Uploading") + uploadSnackbar.filename }}
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s
diff --git a/src/components/panels/Settings/GeneralPanel.vue b/src/components/panels/Settings/GeneralPanel.vue index 1af8ed8f..167bd0c0 100644 --- a/src/components/panels/Settings/GeneralPanel.vue +++ b/src/components/panels/Settings/GeneralPanel.vue @@ -35,12 +35,12 @@ diff --git a/src/components/panels/Settings/LanguagePanel.vue b/src/components/panels/Settings/LanguagePanel.vue index e29074de..93acb47e 100644 --- a/src/components/panels/Settings/LanguagePanel.vue +++ b/src/components/panels/Settings/LanguagePanel.vue @@ -45,11 +45,11 @@ this.lang = val }, getLanguages(){ - const locales = require.context('@/locales', true, /[A-Za-z0-9-_,\s]+\.json$/i) + const locales = require.context('@/locales', true, /[A-Za-z0-9-_,\s]+\.js$/i) this.Languages = [] locales.keys().map(key=>{ this.Languages.push({ - text: locales(key).title, + text: locales(key).default.title, value: key.match(/([A-Za-z0-9-_]+)\./i)[1] }) }) diff --git a/src/locales/en.js b/src/locales/en.js new file mode 100644 index 00000000..410d0718 --- /dev/null +++ b/src/locales/en.js @@ -0,0 +1,356 @@ +export default { + title: "English", + App: { + Connecting: "Connecting", + To: "to", + Failed: "failed", + TryAgain: "try again", + Printers: "Printers", + CannotNotConnectTo: "Cannot not connect to", + ConnectionTo: "Connection to", + ConnectionFailed: "Connection failed", + SelectPrinter: "Select Printer", + AddPrinter: "Add Printer", + EditPrinter: "Edit Printer", + UpdatePrinter: "Update Printer", + ChangePrinter: "Change Printer", + Hello: "Hello and welcome to the remote mode of Mainsail!", + PleaseRememberToAdd: "Please remember to add", + InMoonrakerConf: "in moonraker.conf within 'cors_domains'.", + YouCanFindMore: "You can find more details at", + Remotemode: "https://docs.mainsail.xyz/remotemode", + KlipperControl: "Klipper Control", + Restart: "Restart", + FirmwareRestart: "FIRMWARE Restart", + RestartServices: "Restart Services", + Klipper: "Klipper", + Moonraker: "Moonraker", + PowerDevices: "Power Devices", + HostControl: "Host Control", + Reboot: "Reboot", + Shutdown: "Shutdown", + Updating: "Updating", + done: " done!", + Empty: "Empty", + Close: "Close", + SAVECONFIG: "SAVE CONFIG", + UploadPrint: "Upload & Print", + EmergencyStop: "Emergency Stop", + Uploading: "Uploading" + }, + Router: { + Dashboard: "Dashboard", + Printers: "Printers", + Settings: "Settings", + Webcam: "Webcam", + Console: "Console", + Heightmap: "Heightmap", + "G-Code Files": "G-Code Files", + Machine: "Machine", + Interface: "Interface" + }, + Files: { + GCodeFiles: "G-Code Files", + UploadNewGcode: "Upload new Gcode", + CreateNewDirectory: "Create new Directory", + RefreshCurrentDirectory: "Refresh current Directory", + SetupCurrentList: "Setup current list", + HiddenFiles: "Hidden files", + FreeDisk: "Free disk: ", + Used: "Used: ", + Free: "Free: ", + Total: "Total: ", + Files: "Files", + Search: "Search", + Empty: "Empty", + blabla: "bla bla", + DropFilesToAddGcode: "Drop files to add gcode.", + PrintStart: "Print start", + Preheat: "Preheat", + Download: "Download", + Rename: "Rename", + Delete: "Delete", + StartJob: "Start Job", + DoYouWantToStart: "Do you want to start", + No: "No", + Yes: "Yes", + NewDirectory: "New Directory", + PleaseEnterANewDirectoryName: "Please enter a new directory name:", + RenameFile: "Rename File", + Name: "Name", + Cancel: "Cancel", + Create: "Create", + RenameDirectory: "Rename Directory", + Uploading: "Uploading", + CurrentPath: "Current path", + Filesize: "Filesize", + LastModified: "Last modified", + ObjectHeight: "Object Height", + LayerHeight: "Layer Height", + FilamentUsage: "Filament Usage", + PrintTime: "Print Time", + Slicer: "Slicer" + }, + Console: { + send: "send", + SetupConsole: "Setup Console", + SendCode: "Send code...", + Empty: "Empty", + HideTemperatures: "Hide temperatures", + CustomFilters: "Custom filters", + Date: "Date", + Event: "Event" + }, + Panels: { + ControlPanel: { + Controls: "Controls", + SetupControls: "Setup Controls", + AlternateControls: "Alternate controls", + InvertX: "Invert X", + InvertY: "Invert Y", + InvertZ: "Invert Z", + ALL: "ALL", + QGL: "QGL", + ZTilt: "Z Tilt", + X: "X", + Y: "Y", + Z: "Z", + PleaseConfigureSteps: "Please configure steps", + SettingsInterfaceControl: "Settings > Interface > Control", + Home: "Home", + Retract: "Retract", + Extrude: "Extrude", + Macros: "Macros" + }, + ExtruderPanel: { + FeedAmountIn: "Feed amount in", + FeedrateIn: "Feedrate in", + Retract: "Retract", + Extrude: "Extrude" + }, + FarmPrinterPanel: { + + }, + KlippyStatePanel: { + KlippyState: "Klippy-State: ", + KlippyInfo: "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.", + Restart: "Restart", + FirmwareRestart: "Firmware Restart" + }, + MiniconsolePanel: { + Console: "Console", + SetupConsole: "Setup Console", + HideTemperatures: "Hide temperatures", + CustomFilters: "Custom filters", + SendCode: "Send code...", + Send: "Send", + Empty: "Empty" + }, + MinSettingsPanel: { + MissingConfiguration: "Missing configuration", + IsNotDefinedInConfig: "is not defined in config.", + MoreInformation: "more information" + }, + MiscellaneousPanel: { + PrintSettings: "Print Settings", + Miscellaneous: "Miscellaneous" + }, + MoonrakerFailedComponentsPanel: { + MoonrakerFailedComponents: "Moonraker Failed Components", + MoonrakerErrorInfo: "An error was detected while loading the moonraker components. Please check the logfile and fix the issue.", + FollowingPluginHasAnError: "Following plugin has an error:", + DownloadLog: "Download Log" + }, + PowerControlPanel: { + PowerControl: "Power Control", + Error: "Error", + On: "On", + Off: "Off" + }, + StatusPanel: { + Unknown: "Unknown", + PausePrint: "Pause print", + ResumePrint: "Resume print", + CancelPrint: "Cancel print", + ClearPrintStats: "Clear print stats", + ReprintJob: "Reprint job", + X: "X", + Y: "Y", + Z: "Z", + Filament: "Filament", + Print: "Print", + Total: "Total", + Speed: "Speed", + Layer: "Layer", + ObjectHeight: "Object Height:", + ETA: "ETA", + File: "File", + Slicer: "Slicer" + }, + ToolsPanel: { + Temperatures: "Temperatures", + Presets: "Presets", + Cooldown: "Cooldown", + SetupTemperatures: "Setup Temperatures", + ShowChart: "Show Chart", + AutoscaleChart: "Autoscale Chart", + Name: "Name", + Color: "Color", + State: "State", + Current: "Current", + Target: "Target", + Min: "min: ", + Max: "max: ", + UNKNOWN: "UNKNOWN", + ShowCurrentTemperatureInChart: "Show current temperature in chart", + ShowTargetTemperatureInChart: "Show target temperature in chart", + ShowPWMPowerInChart: "Show PWM-power in chart", + Show: "Show", + InList: "in list" + }, + WebcamPanel: { + Webcam: "Webcam", + FPS: "FPS" + }, + ZOffsetPanel: { + ZBabyStepping: "Z Baby Stepping", + CurrentOffset: "Current Offset: " + } + }, + Settings: { + ConfigFilesPanel: { + ConfigFiles: "Config Files", + SetupCurrentList: "Setup current list", + HiddenFiles: "Hidden files", + CurrentPath: "Current path: ", + Files: "Files", + Empty: "Empty", + EditFile: "Edit file", + Download: "Download", + Rename: "Rename", + Delete: "Delete", + PleaseStandBy: "Please stand by", + ConfigReference: "Config Reference", + Save: "Save", + SaveRestart: "Save & restart", + RenameFile: "Rename File", + Name: "Name", + Cancel: "Cancel", + Create: "Create", + Edit: "Edit", + CreateFile: "Create File", + CreateFolder: "Create Folder", + Uploading: "Uploading", + Filesize: "Filesize", + LastModified: "Last modified" + }, + ConsolePanel: { + Console: "Console", + HideTemperatures: "Hide temperatures", + CustomFilter: "Custom filter", + Rules: "Rules" + }, + ControlPanel: { + Control: "Control", + SpeedXY: "Speed XY", + SpeedZ: "Speed Z", + MoveDistancesInMm: "Move distances in mm", + ReverseXMovement: "Reverse X movement", + ReverseYMovement: "Reverse Y movement", + ReverseZMovement: "Reverse Z movement", + MoveDistancesXYInMm: "Move distances XY in mm", + MoveDistancesZInMm: "Move distances Z in mm", + MoveDistancesEInMm: "Move distances E in mm", + Extruder: "Extruder", + SpeedEInMms: "Speed E in mm/s" + }, + DashboardPanel: { + Dashboard: "Dashboard", + Webcam: "Webcam", + Tempchart: "Tempchart", + Console: "Console", + ChartUpdateInterval: "Chart update interval", + DatapointInterval: "Datapoint interval" + }, + EndstopPanel: { + Endstops: "Endstops", + Endstop: "Endstop", + TRIGGERED: "TRIGGERED", + open: "OPEN", + EndstopInfo: "Press the sync-button on the right-bottom to load the current endstop status." + }, + GeneralPanel: { + General: "General", + PrinterName: "Printer Name", + DisplayCANCEL_PRINT: "Display CANCEL_PRINT", + DisplayZOffset: "Display Z-Offset-Panel", + ShowCANCEL_PRINT: "Shows the CANCEL_PRINT button permanently - no second layer confirmation needed.", + ShowZOffset: "Shows the Z-Offset panel permanently.", + FactoryReset: "Factory reset", + FactoryInfo: "Do you really want to reset mainsail to factory settings?", + ResetMainsail: "reset mainsail" + }, + LanguagePanel: { + Language: "Language" + }, + LimitsPanel: { + MachineLimits: "Machine Limits", + Velocity: "Velocity", + Acceleration: "Acceleration", + Deceleration: "Deceleration", + SquareCornerVelocity: "Square corner velocity" + }, + LogfilesPanel: { + Logfiles: "Logfiles" + }, + MacrosPanel: { + Macros: "Macros", + NOMacros: "No macros found..." + }, + PresetsPanel: { + PreheatPresets: "Preheat Presets", + Cooldown: "Cooldown", + AddPreset: "add preset", + Preset: "Preset", + Create: "Create", + Edit: "Edit", + Name: "Name", + CustomGCode: "Custom G-Code", + PresetInfo: "You have to set minimum a target temperature or a custom gcode.", + Store: "Store", + Update: "Update", + EditCooldown: "Edit Cooldown", + UpdateCooldown: "Update Cooldown" + }, + RemotePrintersPanel: { + RemotePrinters: "Remote Printers", + AddPrinter: "Add Printer", + EditPrinter: "Edit Printer", + UpdatePrinter: "Update Printer" + }, + RunoutPanel: { + Detected: "detected", + Empty: "Empty" + }, + UpdatePanel: { + UpdateManager: "Update Manager", + CheckForUpdates: "Check for updates", + System: "System", + PackagesCanBeUpgraded: "packages can be upgraded", + OSPackages: "OS-Packages", + Commits: "Commits", + CommittedAt: "committed at", + UpToDate: "up-to-date", + ERROR: "ERROR" + }, + WebcamPanel: { + Webcam: "Webcam", + WebcamURL: "Webcam URL", + Rotate: "Rotate", + FlipWebcamHorizontally: "Flip webcam horizontally", + FlipWebcamVertically: "Flip webcam vertically", + ShowInNavigation: "Show in navigation", + Service: "Service" + } + } +} \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json deleted file mode 100644 index 73482672..00000000 --- a/src/locales/en.json +++ /dev/null @@ -1,355 +0,0 @@ -{ - "title": "English", - "App": { - "Connecting": "Connecting", - "To": "to", - "Failed": "failed", - "TryAgain": "try again", - "Printers": "Printers", - "CannotNotConnectTo": "Cannot not connect to", - "ConnectionTo": "Connection to", - "ConnectionFailed": "Connection failed", - "SelectPrinter": "Select Printer", - "AddPrinter": "Add Printer", - "EditPrinter": "Edit Printer", - "UpdatePrinter": "Update Printer", - "ChangePrinter": "Change Printer", - "Hello": "Hello and welcome to the remote mode of Mainsail!", - "PleaseRememberToAdd": "Please remember to add", - "InMoonrakerConf": "in moonraker.conf within 'cors_domains'.", - "YouCanFindMore": "You can find more details at", - "Remotemode": "https://docs.mainsail.xyz/remotemode", - "KlipperControl": "Klipper Control", - "Restart": "Restart", - "FirmwareRestart": "FIRMWARE Restart", - "RestartServices": "Restart Services", - "Klipper": "Klipper", - "Moonraker": "Moonraker", - "PowerDevices": "Power Devices", - "HostControl": "Host Control", - "Reboot": "Reboot", - "Shutdown": "Shutdown", - "Updating": "Updating", - "done": " done!", - "Empty": "Empty", - "Close": "Close", - "SAVECONFIG": "SAVE CONFIG", - "UploadPrint": "Upload & Print", - "EmergencyStop": "Emergency Stop", - "Uploading": "Uploading" - }, - "Router" : { - "Dashboard": "Dashboard", - "Printers": "Printers", - "Settings": "Settings", - "Webcam": "Webcam", - "Console": "Console", - "Heightmap": "Heightmap", - "G-Code Files": "G-Code Files", - "Machine": "Machine", - "Interface": "Interface" - }, - "Files": { - "GCodeFiles": "G-Code Files", - "UploadNewGcode": "Upload new Gcode", - "CreateNewDirectory": "Create new Directory", - "RefreshCurrentDirectory":"Refresh current Directory", - "SetupCurrentList":"Setup current list", - "HiddenFiles":"Hidden files", - "FreeDisk":"Free disk: ", - "Used":"Used: ", - "Free":"Free: ", - "Total":"Total: ", - "Files": "Files", - "Search":"Search", - "Empty": "Empty", - "blabla": "bla bla", - "DropFilesToAddGcode": "Drop files to add gcode.", - "PrintStart": "Print start", - "Preheat": "Preheat", - "Download": "Download", - "Rename": "Rename", - "Delete": "Delete", - "StartJob": "Start Job", - "DoYouWantToStart": "Do you want to start", - "No": "No", - "Yes": "Yes", - "NewDirectory": "New Directory", - "PleaseEnterANewDirectoryName": "Please enter a new directory name:", - "RenameFile": "Rename File", - "Name": "Name", - "Cancel": "Cancel", - "Create": "Create", - "RenameDirectory": "Rename Directory", - "Uploading": "Uploading", - "CurrentPath": "Current path", - "Filesize": "Filesize", - "LastModified": "Last modified", - "ObjectHeight": "Object Height", - "LayerHeight": "Layer Height", - "FilamentUsage": "Filament Usage", - "PrintTime": "Print Time", - "Slicer": "Slicer" - }, - "Console": { - "send": "send", - "SetupConsole": "Setup Console", - "SendCode": "Send code...", - "Empty": "Empty", - "HideTemperatures": "Hide temperatures", - "CustomFilters": "Custom filters", - "Date": "Date", - "Event": "Event" - }, - "Panels": { - "ControlPanel":{ - "Controls": "Controls", - "SetupControls": "Setup Controls", - "AlternateControls": "Alternate controls", - "InvertX": "Invert X", - "InvertY": "Invert Y", - "InvertZ": "Invert Z", - "ALL": "ALL", - "QGL": "QGL", - "ZTilt": "Z Tilt", - "X": "X", - "Y": "Y", - "Z": "Z", - "PleaseConfigureSteps": "Please configure steps", - "SettingsInterfaceControl": "Settings > Interface > Control", - "Home":"Home", - "Retract": "Retract", - "Extrude": "Extrude", - "Macros": "Macros" - }, - "ExtruderPanel": { - "FeedAmountIn": "Feed amount in", - "FeedrateIn": "Feedrate in", - "Retract": "Retract", - "Extrude": "Extrude" - }, - "FarmPrinterPanel": { - - }, - "KlippyStatePanel": { - "KlippyState": "Klippy-State: ", - "KlippyInfo": "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.", - "Restart": "Restart", - "FirmwareRestart": "Firmware Restart" - }, - "MiniconsolePanel": { - "Console": "Console", - "SetupConsole": "Setup Console", - "HideTemperatures": "Hide temperatures", - "CustomFilters": "Custom filters", - "SendCode": "Send code...", - "Send": "Send", - "Empty": "Empty" - }, - "MinSettingsPanel": { - "MissingConfiguration": "Missing configuration", - "IsNotDefinedInConfig": "is not defined in config.", - "MoreInformation": "more information" - }, - "MiscellaneousPanel": { - "PrintSettings": "Print Settings", - "Miscellaneous": "Miscellaneous" - }, - "MoonrakerFailedPluginsPanel": { - "MoonrakerFailedPlugins": "Moonraker Failed Plugins", - "MoonrakerFailedComponents": "Moonraker Failed Components", - "MoonrakerErrorInfo": "An error was detected while loading the moonraker components. Please check the logfile and fix the issue.", - "FollowingPluginHasAnError": "Following plugin has an error:", - "DownloadLog": "Download Log" - }, - "PowerControlPanel": { - "PowerControl": "Power Control", - "Error": "Error", - "On": "On", - "Off": "Off" - }, - "StatusPanel": { - "Unknown": "Unknown", - "PausePrint": "Pause print", - "ResumePrint": "Resume print", - "CancelPrint": "Cancel print", - "ClearPrintStats": "Clear print stats", - "ReprintJob": "Reprint job", - "X": "X", - "Y": "Y", - "Z": "Z", - "Filament": "Filament", - "Print": "Print", - "Total": "Total", - "Speed": "Speed", - "Layer": "Layer", - "ObjectHeight": "Object Height:", - "ETA": "ETA", - "File": "File", - "Slicer": "Slicer" - }, - "ToolsPanel": { - "Temperatures": "Temperatures", - "Presets": "Presets", - "Cooldown": "Cooldown", - "SetupTemperatures": "Setup Temperatures", - "ShowChart": "Show Chart", - "AutoscaleChart": "Autoscale Chart", - "Name": "Name", - "Color": "Color", - "State": "State", - "Current": "Current", - "Target": "Target", - "Min": "min: ", - "Max": "max: ", - "UNKNOWN": "UNKNOWN", - "ShowCurrentTemperatureInChart": "Show current temperature in chart", - "ShowTargetTemperatureInChart": "Show target temperature in chart", - "ShowPWMPowerInChart": "Show PWM-power in chart", - "Show": "Show", - "InList": "in list" - }, - "WebcamPanel": { - "Webcam": "Webcam", - "FPS": "FPS" - }, - "ZOffsetPanel": { - "ZBabyStepping": "Z Baby Stepping", - "CurrentOffset": "Current Offset: " - } - }, - "Settings": { - "ConfigFilesPanel": { - "ConfigFiles": "Config Files", - "SetupCurrentList": "Setup current list", - "HiddenFiles": "Hidden files", - "CurrentPath: ": "Current path: ", - "Files": "Files", - "Empty": "Empty", - "EditFile": "Edit file", - "Download": "Download", - "Rename": "Rename", - "Delete": "Delete", - "PleaseStandBy": "Please stand by", - "ConfigReference": "Config Reference", - "Save": "Save", - "SaveRestart": "Save & restart", - "RenameFile": "Rename File", - "Name": "Name", - "Cancel": "Cancel", - "Create": "Create", - "Edit": "Edit", - "CreateFile": "Create File", - "CreateFolder": "Create Folder", - "Uploading": "Uploading", - "Filesize": "Filesize", - "LastModified": "Last modified" - }, - "ConsolePanel": { - "Console": "Console", - "HideTemperatures": "Hide temperatures", - "CustomFilter": "Custom filter", - "Rules": "Rules" - }, - "ControlPanel": { - "Control": "Control", - "SpeedXY": "Speed XY", - "SpeedZ": "Speed Z", - "MoveDistancesInMm": "Move distances in mm", - "ReverseXMovement": "Reverse X movement", - "ReverseYMovement": "Reverse Y movement", - "ReverseZMovement": "Reverse Z movement", - "MoveDistancesXYInMm": "Move distances XY in mm", - "MoveDistancesZInMm": "Move distances Z in mm", - "MoveDistancesEInMm": "Move distances E in mm", - "Extruder": "Extruder", - "SpeedEInMms": "Speed E in mm/s" - }, - "DashboardPanel": { - "Dashboard": "Dashboard", - "Webcam": "Webcam", - "Tempchart": "Tempchart", - "Console": "Console", - "ChartUpdateInterval": "Chart update interval", - "DatapointInterval": "Datapoint interval" - }, - "EndstopPanel": { - "Endstops": "Endstops", - "Endstop": "Endstop", - "TRIGGERED": "TRIGGERED", - "open": "OPEN", - "EndstopInfo": "Press the sync-button on the right-bottom to load the current endstop status." - }, - "GeneralPanel": { - "General": "General", - "PrinterName": "Printer Name", - "DisplayCANCEL_PRINT": "Display CANCEL_PRINT", - "ShowCANCEL_PRINT": "Shows the CANCEL_PRINT button permanently - no second layer confirmation needed.", - "FactoryReset": "Factory reset", - "FactoryInfo": "Do you really want to reset mainsail to factory settings?", - "ResetMainsail": "reset mainsail" - }, - "LanguagePanel": { - "Language": "Language" - }, - "LimitsPanel": { - "MachineLimits": "Machine Limits", - "Velocity": "Velocity", - "Acceleration": "Acceleration", - "Deceleration": "Deceleration", - "SquareCornerVelocity": "Square corner velocity" - }, - "LogfilesPanel": { - "Logfiles": "Logfiles" - }, - "MacrosPanel": { - "Macros": "Macros", - "NOMacros": "No macros found..." - }, - "PresetsPanel": { - "PreheatPresets": "Preheat Presets", - "Cooldown": "Cooldown", - "AddPreset": "add preset", - "Preset": "Preset", - "Create": "Create", - "Edit": "Edit", - "Name": "Name", - "CustomGCode": "Custom G-Code", - "PresetInfo": "You have to set minimum a target temperature or a custom gcode.", - "Store": "Store", - "Update": "Update", - "EditCooldown": "Edit Cooldown", - "UpdateCooldown": "Update Cooldown" - }, - "RemotePrintersPanel": { - "RemotePrinters": "Remote Printers", - "AddPrinter": "Add Printer", - "EditPrinter": "Edit Printer", - "UpdatePrinter": "Update Printer" - }, - "RunoutPanel": { - "Detected": "detected", - "Empty": "Empty" - }, - "UpdatePanel": { - "UpdateManager": "Update Manager", - "CheckForUpdates": "Check for updates", - "System": "System", - "PackagesCanBeUpgraded": "packages can be upgraded", - "OSPackages": "OS-Packages", - "Commits": "Commits", - "CommittedAt": "committed at", - "UpToDate": "up-to-date", - "ERROR": "ERROR" - }, - "WebcamPanel": { - "Webcam": "Webcam", - "WebcamURL": "Webcam URL", - "Rotate": "Rotate", - "FlipWebcamHorizontally": "Flip webcam horizontally", - "FlipWebcamVertically": "Flip webcam vertically", - "ShowInNavigation": "Show in navigation", - "Service": "Service" - } - } -} \ No newline at end of file diff --git a/src/locales/zh.js b/src/locales/zh.js new file mode 100644 index 00000000..c206a8de --- /dev/null +++ b/src/locales/zh.js @@ -0,0 +1,354 @@ +export default { + title: "简体中文", + App: { + Connecting: "连接", + To: "到", + Failed: "失败", + TryAgain: "重试", + Printers: "Printers", + CannotNotConnectTo: "无法连接到", + ConnectionTo: "连接到", + ConnectionFailed: "连接失败", + SelectPrinter: "选择打印机", + AddPrinter: "添加打印机", + EditPrinter: "编辑打印机", + UpdatePrinter: "更新打印机", + ChangePrinter: "更换打印机", + Hello: "大家好,欢迎来到主帆遥控模式!", + PleaseRememberToAdd: "请记得添加", + InMoonrakerConf: "在 moonraker.conf 的 'cors_domains' 中.", + YouCanFindMore: "详情请浏览", + Remotemode: "docs.mainsail.xyz/remotemode", + KlipperControl: "Klipper 控制", + Restart: "重启", + FirmwareRestart: "固件重启", + RestartServices: "重启服务", + Klipper: "Klipper", + Moonraker: "Moonraker", + PowerDevices: "电力设备", + HostControl: "主机控制", + Reboot: "重启", + Shutdown: "关机", + Updating: "更新", + done: " 完成!", + Empty: "空的", + Close: "关闭", + SAVECONFIG: "保存配置", + UploadPrint: "上传并打印", + EmergencyStop: "紧急停止", + Uploading: "上传" + }, + Router: { + Dashboard: "仪表盘", + Printers: "打印机", + Settings: "设置", + Webcam: "摄像头", + Console: "控制台", + Heightmap: "Heightmap", + "G-Code Files": "G-Code 文件", + Machine: "机器", + Interface: "界面" + }, + Files: { + GCodeFiles: "G-Code 文件", + UploadNewGcode: "上传新 Gcode", + CreateNewDirectory: "创建新目录", + RefreshCurrentDirectory: "刷新当前目录", + SetupCurrentList: "设置当前列表", + HiddenFiles: "隐藏文件", + FreeDisk: "可用磁盘: ", + Used: "使用: ", + Free: "空闲: ", + Total: "总共: ", + Files: "文件", + Search: "搜索", + Empty: "空的", + blabla: "巴拉巴拉", + DropFilesToAddGcode: "删除文件以添加gcode.", + PrintStart: "开始打印", + Preheat: "预热", + Download: "下载", + Rename: "重命名", + Delete: "删除", + StartJob: "开始作业", + DoYouWantToStart: "你想开始吗", + No: "否", + Yes: "是", + NewDirectory: "新建目录", + PleaseEnterANewDirectoryName: "请输入新的目录名称:", + RenameFile: "重命名文件", + Name: "名称", + Cancel: "取消", + Create: "创建", + RenameDirectory: "重命名目录", + Uploading: "上传", + CurrentPath: "当前路径", + Filesize: "文件大小", + LastModified: "上次修改", + ObjectHeight: "对象高度", + LayerHeight: "层高", + FilamentUsage: "耗材使用", + PrintTime: "打印时间", + Slicer: "切片" + }, + Console: { + send: "发送", + SetupConsole: "设置控制台", + SendCode: "发送代码...", + Empty: "空的", + HideTemperatures: "隐藏温度", + CustomFilters: "自定义筛选器", + Date: "时间", + Event: "事件" + }, + Panels: { + ControlPanel: { + Controls: "控制台", + SetupControls: "设置控件", + AlternateControls: "备用控件", + InvertX: "反转 X", + InvertY: "反转 Y", + InvertZ: "反转 Z", + ALL: "全部", + QGL: "QGL", + ZTilt: "Z 倾斜", + X: "X", + Y: "Y", + Z: "Z", + PleaseConfigureSteps: "请配置步骤", + SettingsInterfaceControl: "设置 > 界面 > 控制", + Home: "家", + Retract: "回抽", + Extrude: "挤出", + Macros: "宏" + }, + ExtruderPanel: { + FeedAmountIn: "进料量", + FeedrateIn: "输入速度", + Retract: "回抽", + Extrude: "挤出" + }, + FarmPrinterPanel: { + + }, + KlippyStatePanel: { + KlippyState: "Klippy-State: ", + KlippyInfo: "Moonraker 无法连接到 Klippy!\n请检查Klipper服务是否正在运行,并且是否配置了UDS(Unix域套接字).", + Restart: "重启", + FirmwareRestart: "固件重启" + }, + MiniconsolePanel: { + Console: "控制台", + SetupConsole: "设置控制台", + HideTemperatures: "隐藏温度", + CustomFilters: "自定义筛选器", + SendCode: "发送代码...", + Send: "发送", + Empty: "空的" + }, + MinSettingsPanel: { + MissingConfiguration: "缺少配置", + IsNotDefinedInConfig: "未在配置中定义.", + MoreInformation: "更多信息" + }, + MiscellaneousPanel: { + PrintSettings: "打印设置", + Miscellaneous: "其他" + }, + MoonrakerFailedComponentsPanel: { + MoonrakerFailedComponents: "Moonraker 失败的组件", + MoonrakerErrorInfo: "加载moonraker组件时检测到一个错误. 请检查日志文件并修复这个问题.", + FollowingPluginHasAnError: "以下插件有一个错误:", + DownloadLog: "下载日志" + }, + PowerControlPanel: { + PowerControl: "功率控制", + Error: "错误", + On: "开", + Off: "关" + }, + StatusPanel: { + Unknown: "未知", + PausePrint: "暂停打印", + CancelPrint: "取消打印", + ResumePrint: "继续打印", + ClearPrintStats: "清除打印统计信息", + ReprintJob: "重新打印工作", + X: "X", + Y: "Y", + Z: "Z", + Filament: "耗材", + Print: "打印", + Total: "总计", + Speed: "速度", + Layer: "层", + ObjectHeight: "对象高度:", + ETA: "ETA", + File: "文件", + Slicer: "切片" + }, + ToolsPanel: { + Temperatures: "温度", + Presets: "预设", + Cooldown: "冷却", + SetupTemperatures: "设置温度", + ShowChart: "显示图表", + AutoscaleChart: "自动缩放图表", + Name: "名称", + Color: "颜色", + State: "状态", + Current: "当前", + Target: "目标", + Min: "最小: ", + Max: "最大: ", + UNKNOWN: "未知", + ShowCurrentTemperatureInChart: "在图表中显示当前温度", + ShowTargetTemperatureInChart: "在图表中显示目标温度", + ShowPWMPowerInChart: "在图表中显示PWM功率", + Show: "Show", + InList: "in list" + }, + WebcamPanel: { + Webcam: "摄像头", + FPS: "FPS" + }, + ZOffsetPanel: { + ZBabyStepping: "Z 偏移", + CurrentOffset: "当前偏移量: " + } + }, + Settings: { + ConfigFilesPanel: { + ConfigFiles: "配置文件", + SetupCurrentList: "设置当前列表", + HiddenFiles: "隐藏文件", + CurrentPath: "当前路径", + Files: "文件", + Empty: "空的", + EditFile: "编辑文件", + Download: "下载", + Rename: "重命名", + Delete: "删除", + PleaseStandBy: "请等待", + ConfigReference: "配置参考", + Save: "保存", + SaveRestart: "保存 & 重启", + RenameFile: "重命名文件", + Name: "名称", + Cancel: "取消", + Create: "创建", + Edit: "编辑", + CreateFile: "创建文件", + CreateFolder: "创建文件夹", + Uploading: "上传", + Filesize: "文件大小", + LastModified: "上次修改" + }, + ConsolePanel: { + Console: "控制", + HideTemperatures: "隐藏温度", + CustomFilters: "自定义筛选器", + Rules: "规则" + }, + ControlPanel: { + Control: "控制", + SpeedXY: "XY 速度", + SpeedZ: "Z 速度", + MoveDistancesInMm: "移动距离(mm)", + ReverseZMovement: "反向Z运动", + MoveDistancesXYInMm: "XY移动距离(mm)", + MoveDistancesZInMm: "Z移动距离(mm)", + MoveDistancesEInMm: "E移动距离(mm)", + Extruder: "挤出机", + SpeedEInMms: "E速度(mm/s)" + }, + DashboardPanel: { + Dashboard: "仪表盘", + Webcam: "摄像头", + Tempchart: "温度图", + Console: "控制台", + ChartUpdateInterval: "图表更新间隔", + DatapointInterval: "数据点间隔" + }, + EndstopPanel: { + Endstops: "限位开关", + Endstop: "限位", + TRIGGERED: "触发", + open: "打开", + EndstopInfo: "按右下角的同步按钮加载当前的限位状态。" + }, + GeneralPanel: { + General: "一般", + PrinterName: "打印机名称", + DisplayCANCEL_PRINT: "显示 CANCEL_PRINT", + DisplayZOffset: "显示Z偏移面板", + ShowCANCEL_PRINT: "永久显示CANCEL_PRINT按钮-无需第二层确认。", + ShowZOffset: "永久显示Z偏移面板.", + FactoryReset: "恢复出厂设置", + FactoryInfo: "您是否真的要将主帆重置为出厂设置?", + ResetMainsail: "重置主帆" + }, + LanguagePanel: { + Language: "语言" + }, + LimitsPanel: { + MachineLimits: "机器限制", + Velocity: "速度", + Acceleration: "加速", + Deceleration: "减速", + SquareCornerVelocity: "直角速度" + }, + LogfilesPanel: { + Logfiles: "日志文件" + }, + MacrosPanel: { + Macros: "宏", + NOMacros: "没有找到宏..." + }, + PresetsPanel: { + PreheatPresets: "预热预设", + Cooldown: "冷却", + AddPreset: "添加预设", + Preset: "预设", + Create: "创建", + Edit: "编辑", + Name: "名称", + CustomGCode: "自定义 G-Code", + PresetInfo: "您必须设置最低目标温度或自定义gcode.", + Store: "储存", + Update: "更新", + EditCooldown: "编辑冷却", + UpdateCooldown: "更新冷却" + }, + RemotePrintersPanel: { + RemotePrinters: "远程打印机", + AddPrinter: "添加打印机", + EditPrinter: "编辑打印机", + UpdatePrinter: "更新打印机" + }, + RunoutPanel: { + Detected: "发现", + Empty: "空的" + }, + UpdatePanel: { + UpdateManager: "更新管理器", + CheckForUpdates: "检查更新", + System: "系统", + PackagesCanBeUpgraded: "软件包可以升级", + OSPackages: "OS包", + Commits: "Commits", + CommittedAt: "committed at", + UpToDate: "最新的", + ERROR: "错误" + }, + WebcamPanel: { + Webcam: "摄像头", + WebcamURL: "摄像头地址", + Rotate: "旋转", + FlipWebcamHorizontally: "水平翻转摄像头 ", + FlipWebcamVertically: "垂直翻转摄像头", + ShowInNavigation: "在导航中显示 ", + Service: "服务" + } + } +} \ No newline at end of file diff --git a/src/locales/zh.json b/src/locales/zh.json deleted file mode 100644 index 02f4a6b5..00000000 --- a/src/locales/zh.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "title": "简体中文", - "App": { - "Connecting": "连接", - "To": "到", - "Failed": "失败", - "TryAgain": "重试", - "Printers": "Printers", - "CannotNotConnectTo": "无法连接到", - "ConnectionTo": "连接到", - "ConnectionFailed": "连接失败", - "SelectPrinter": "选择打印机", - "AddPrinter": "添加打印机", - "EditPrinter": "编辑打印机", - "UpdatePrinter": "更新打印机", - "ChangePrinter": "更换打印机", - "Hello": "大家好,欢迎来到主帆遥控模式!", - "PleaseRememberToAdd": "请记得添加", - "InMoonrakerConf": "在 moonraker.conf 的 'cors_domains' 中.", - "YouCanFindMore": "详情请浏览", - "Remotemode": "docs.mainsail.xyz/remotemode", - "KlipperControl": "Klipper 控制", - "Restart": "重启", - "FirmwareRestart": "固件重启", - "RestartServices": "重启服务", - "Klipper": "Klipper", - "Moonraker": "Moonraker", - "PowerDevices": "电力设备", - "HostControl": "主机控制", - "Reboot": "重启", - "Shutdown": "关机", - "Updating": "更新", - "done": " 完成!", - "Empty": "空的", - "Close": "关闭", - "SAVECONFIG": "保存配置", - "UploadPrint": "上传并打印", - "EmergencyStop": "紧急停止", - "Uploading": "上传" - }, - "Router" : { - "Dashboard": "仪表盘", - "Printers": "打印机", - "Settings": "设置", - "Webcam": "摄像头", - "Console": "控制台", - "Heightmap": "Heightmap", - "G-Code Files": "G-Code 文件", - "Machine": "机器", - "Interface": "界面" - }, - "Files": { - "GCodeFiles": "G-Code 文件", - "UploadNewGcode": "上传新 Gcode", - "CreateNewDirectory": "创建新目录", - "RefreshCurrentDirectory":"刷新当前目录", - "SetupCurrentList":"设置当前列表", - "HiddenFiles":"隐藏文件", - "FreeDisk":"可用磁盘: ", - "Used":"使用: ", - "Free":"空闲: ", - "Total":"总共: ", - "Files": "文件", - "Search":"搜索", - "Empty": "空的", - "blabla": "巴拉巴拉", - "DropFilesToAddGcode": "删除文件以添加gcode.", - "PrintStart": "开始打印", - "Preheat": "预热", - "Download": "下载", - "Rename": "重命名", - "Delete": "删除", - "StartJob": "开始作业", - "DoYouWantToStart": "你想开始吗", - "No": "否", - "Yes": "是", - "NewDirectory": "新建目录", - "PleaseEnterANewDirectoryName": "请输入新的目录名称:", - "RenameFile": "重命名文件", - "Name": "名称", - "Cancel": "取消", - "Create": "创建", - "RenameDirectory": "重命名目录", - "Uploading": "上传", - "CurrentPath": "当前路径", - "Filesize": "文件大小", - "LastModified": "上次修改", - "ObjectHeight": "对象高度", - "LayerHeight": "层高", - "FilamentUsage": "耗材使用", - "PrintTime": "打印时间", - "Slicer": "切片" - }, - "Console": { - "send": "发送", - "SetupConsole": "设置控制台", - "SendCode": "发送代码...", - "Empty": "空的", - "HideTemperatures": "隐藏温度", - "CustomFilters": "自定义筛选器", - "Date": "时间", - "Event": "事件" - }, - "Panels": { - "ControlPanel":{ - "Controls": "控制台", - "SetupControls": "设置控件", - "AlternateControls": "备用控件", - "InvertX": "反转 X", - "InvertY": "反转 Y", - "InvertZ": "反转 Z", - "ALL": "全部", - "QGL": "QGL", - "ZTilt": "Z 倾斜", - "X": "X", - "Y": "Y", - "Z": "Z", - "PleaseConfigureSteps": "请配置步骤", - "SettingsInterfaceControl": "设置 > 界面 > 控制", - "Home":"家", - "Retract": "回抽", - "Extrude": "挤出", - "Macros": "宏" - }, - "ExtruderPanel": { - "FeedAmountIn": "进料量", - "FeedrateIn": "输入速度", - "Retract": "回抽", - "Extrude": "挤出" - }, - "FarmPrinterPanel": { - - }, - "KlippyStatePanel": { - "KlippyState": "Klippy-State: ", - "KlippyInfo": "Moonraker 无法连接到 Klippy!\n请检查Klipper服务是否正在运行,并且是否配置了UDS(Unix域套接字).", - "Restart": "重启", - "FirmwareRestart": "固件重启" - }, - "MiniconsolePanel": { - "Console": "控制台", - "SetupConsole": "设置控制台", - "HideTemperatures": "隐藏温度", - "CustomFilters": "自定义筛选器", - "SendCode": "发送代码...", - "Send": "发送", - "Empty": "空的" - }, - "MinSettingsPanel": { - "MissingConfiguration": "缺少配置", - "IsNotDefinedInConfig": "未在配置中定义.", - "MoreInformation": "更多信息" - }, - "MiscellaneousPanel": { - "PrintSettings": "打印设置", - "Miscellaneous": "其他" - }, - "MoonrakerFailedPluginsPanel": { - "MoonrakerFailedPlugins": "Moonraker 失败的插件", - "MoonrakerFailedComponents": "Moonraker 失败的组件", - "MoonrakerErrorInfo": "加载moonraker组件时检测到一个错误. 请检查日志文件并修复这个问题.", - "FollowingPluginHasAnError": "以下插件有一个错误:", - "DownloadLog": "下载日志" - }, - "PowerControlPanel": { - "PowerControl": "功率控制", - "Error": "错误", - "On": "开", - "Off": "关" - }, - "StatusPanel": { - "Unknown": "未知", - "PausePrint": "暂停打印", - "CancelPrint": "取消打印", - "ResumePrint": "继续打印", - "ClearPrintStats": "清除打印统计信息", - "ReprintJob": "重新打印工作", - "X": "X", - "Y": "Y", - "Z": "Z", - "Filament": "耗材", - "Print": "打印", - "Total": "总计", - "Speed": "速度", - "Layer": "层", - "ObjectHeight": "对象高度:", - "ETA": "ETA", - "File": "文件", - "Slicer": "切片" - }, - "ToolsPanel": { - "Temperatures": "温度", - "Presets": "预设", - "Cooldown": "冷却", - "SetupTemperatures": "设置温度", - "ShowChart": "显示图表", - "AutoscaleChart": "自动缩放图表", - "Name": "名称", - "Color": "颜色", - "State": "状态", - "Current": "当前", - "Target": "目标", - "Min": "最小: ", - "Max": "最大: ", - "UNKNOWN": "未知", - "ShowCurrentTemperatureInChart": "在图表中显示当前温度", - "ShowTargetTemperatureInChart": "在图表中显示目标温度", - "ShowPWMPowerInChart": "在图表中显示PWM功率", - "Show": "Show", - "InList": "in list" - }, - "WebcamPanel": { - "Webcam": "摄像头", - "FPS": "FPS" - }, - "ZOffsetPanel": { - "ZBabyStepping": "Z 偏移", - "CurrentOffset": "当前偏移量: " - } - }, - "Settings": { - "ConfigFilesPanel": { - "ConfigFiles": "配置文件", - "SetupCurrentList":"设置当前列表", - "HiddenFiles":"隐藏文件", - "CurrentPath": "当前路径", - "Files": "文件", - "Empty": "空的", - "EditFile": "编辑文件", - "Download": "下载", - "Rename": "重命名", - "Delete": "删除", - "PleaseStandBy": "请等待", - "ConfigReference": "配置参考", - "Save": "保存", - "SaveRestart": "保存 & 重启", - "RenameFile": "重命名文件", - "Name": "名称", - "Cancel": "取消", - "Create": "创建", - "Edit": "编辑", - "CreateFile": "创建文件", - "CreateFolder": "创建文件夹", - "Uploading": "上传", - "Filesize": "文件大小", - "LastModified": "上次修改" - }, - "ConsolePanel": { - "Console": "控制", - "HideTemperatures": "隐藏温度", - "CustomFilters": "自定义筛选器", - "Rules": "规则" - }, - "ControlPanel": { - "Control": "控制", - "SpeedXY": "XY 速度", - "SpeedZ": "Z 速度", - "MoveDistancesInMm": "移动距离(mm)", - "ReverseZMovement": "反向Z运动", - "MoveDistancesXYInMm": "XY移动距离(mm)", - "MoveDistancesZInMm": "Z移动距离(mm)", - "MoveDistancesEInMm": "E移动距离(mm)", - "Extruder": "挤出机", - "SpeedEInMms": "E速度(mm/s)" - }, - "DashboardPanel": { - "Dashboard": "仪表盘", - "Webcam": "摄像头", - "Tempchart": "温度图", - "Console": "控制台", - "ChartUpdateInterval": "图表更新间隔", - "DatapointInterval": "数据点间隔" - }, - "EndstopPanel": { - "Endstops": "限位开关", - "Endstop": "限位", - "TRIGGERED": "触发", - "open": "打开", - "EndstopInfo": "按右下角的同步按钮加载当前的限位状态。" - }, - "GeneralPanel": { - "General": "一般", - "PrinterName": "打印机名称", - "DisplayCANCEL_PRINT": "显示 CANCEL_PRINT", - "ShowCANCEL_PRINT": "永久显示CANCEL_PRINT按钮-无需第二层确认。", - "FactoryReset": "恢复出厂设置", - "FactoryInfo": "您是否真的要将主帆重置为出厂设置?", - "ResetMainsail": "重置主帆" - }, - "LanguagePanel": { - "Language": "语言" - }, - "LimitsPanel": { - "MachineLimits": "机器限制", - "Velocity": "速度", - "Acceleration": "加速", - "Deceleration": "减速", - "SquareCornerVelocity": "直角速度" - }, - "LogfilesPanel": { - "Logfiles": "日志文件" - }, - "MacrosPanel": { - "Macros": "宏", - "NOMacros": "没有找到宏..." - }, - "PresetsPanel": { - "PreheatPresets": "预热预设", - "Cooldown": "冷却", - "AddPreset": "添加预设", - "Preset": "预设", - "Create": "创建", - "Edit": "编辑", - "Name": "名称", - "CustomGCode": "自定义 G-Code", - "PresetInfo": "您必须设置最低目标温度或自定义gcode.", - "Store": "储存", - "Update": "更新", - "EditCooldown": "编辑冷却", - "UpdateCooldown": "更新冷却" - }, - "RemotePrintersPanel": { - "RemotePrinters": "远程打印机", - "AddPrinter": "添加打印机", - "EditPrinter": "编辑打印机", - "UpdatePrinter": "更新打印机" - }, - "RunoutPanel": { - "Detected": "发现", - "Empty": "空的" - }, - "UpdatePanel": { - "UpdateManager": "更新管理器", - "CheckForUpdates": "检查更新", - "System": "系统", - "PackagesCanBeUpgraded": "软件包可以升级", - "OSPackages": "OS包", - "Commits": "Commits", - "CommittedAt": "committed at", - "UpToDate": "最新的", - "ERROR": "错误" - }, - "WebcamPanel": { - "Webcam": "摄像头", - "WebcamURL": "摄像头地址", - "Rotate": "旋转", - "FlipWebcamHorizontally": "水平翻转摄像头 ", - "FlipWebcamVertically": "垂直翻转摄像头", - "ShowInNavigation": "在导航中显示 ", - "Service": "服务" - } - } -} \ No newline at end of file diff --git a/src/plugins/i18n.js b/src/plugins/i18n.js index b9d8aac5..d0a48ca8 100644 --- a/src/plugins/i18n.js +++ b/src/plugins/i18n.js @@ -3,15 +3,16 @@ import VueI18n from 'vue-i18n' Vue.use(VueI18n) function loadLocaleMessages () { - const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.json$/i) + const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.js$/i) const messages = {} locales.keys().forEach(key => { const matched = key.match(/([A-Za-z0-9-_]+)\./i) if (matched && matched.length > 1) { const locale = matched[1] - messages[locale] = locales(key) + messages[locale] = locales(key).default } }) + console.log(messages,666) return messages }