From dba61bc6526ec1eb162ab3e7857e05ff18cf4210 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Fri, 16 Oct 2020 11:55:33 +0200 Subject: [PATCH] Parse messages file and use i18next vue plugin --- locales/en/messages.json | 21 ++++-- package.json | 4 +- .../betaflight-logo/BetaflightLogo.vue | 6 +- src/components/init.js | 8 --- src/components/status-bar/PortUtilization.vue | 2 +- src/components/status-bar/ReadingStat.vue | 2 +- .../status-bar/StatusBarVersion.vue | 6 +- src/components/vueI18n.js | 16 +---- src/js/localization.js | 72 +++++++++++++------ yarn.lock | 17 +++-- 10 files changed, 89 insertions(+), 65 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index d661f280..05dfe774 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -622,25 +622,32 @@ }, "statusbar_port_utilization": { - "message": "Port utilization:" + "message": "Port utilization:", + "description": "Port utilization text shown in the status bar" }, "statusbar_usage_download": { - "message": "D: $1%" + "message": "D:", + "description": "References 'Download' in the status bar, port utilization. Keep one character long if possible" }, "statusbar_usage_upload": { - "message": "U: $1%" + "message": "U:", + "description": "References 'Upload' in the status bar, port utilization. Keep one character long if possible" }, "statusbar_packet_error": { - "message": "Packet error:" + "message": "Packet error:", + "description": "Packet error text shown in the status bar" }, "statusbar_i2c_error": { - "message": "I2C error:" + "message": "I2C error:", + "description": "CPU load text shown in the status bar" }, "statusbar_cycle_time": { - "message": "Cycle Time:" + "message": "Cycle Time:", + "description": "Cycle time text shown in the status bar" }, "statusbar_cpu_load": { - "message": "CPU Load: $1%" + "message": "CPU Load:", + "description": "CPU load text shown in the status bar" }, "dfu_connect_message": { diff --git a/package.json b/package.json index 58e6eb3a..4eae71b4 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.13.0", + "@panter/vue-i18next": "^0.15.2", "bluebird": "^3.7.2", "djv": "^2.1.3-alpha.0", "i18next": "^19.0.0", @@ -67,8 +68,7 @@ "short-unique-id": "^1.1.1", "three": "~0.97.0", "universal-ga": "^1.2.0", - "vue": "2.6.12", - "vue-i18n": "8.21.1" + "vue": "2.6.12" }, "devDependencies": { "@quanle94/innosetup": "^6.0.2", diff --git a/src/components/betaflight-logo/BetaflightLogo.vue b/src/components/betaflight-logo/BetaflightLogo.vue index 51461b64..6c8bcb8e 100644 --- a/src/components/betaflight-logo/BetaflightLogo.vue +++ b/src/components/betaflight-logo/BetaflightLogo.vue @@ -72,15 +72,15 @@