From 28dc5a163cb5770b27adb7051955d6514bf4f7d6 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Sun, 14 Sep 2025 14:13:57 +0100 Subject: [PATCH] Internationalisation tidy up Amended script and application history. --- .gitignore | 2 ++ HISTORY.md | 2 +- translate.cmd | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f2e2d14..320a50f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ settings.txt Thumbs.db # This file contain credentials, instead provide the empty file ClientId.mc.unpopulated source/ClientId.mc +# Gemini API key for automated translations +gemini_api_key.txt diff --git a/HISTORY.md b/HISTORY.md index 8769814..575ee81 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -49,4 +49,4 @@ | 3.1 | Added the ability for users to provide [custom HTTP headers](HTTP_Headers.md) for their HomeAssistant server. Improved German language translations. Thanks to [@tispokes](https://github.com/tispokes) for assisting with both of those. Removed all groups in settings as the SDK is buggy. Fixed a bug with templates in glances causing application crash on startup. | | 3.2 | Only enable or disable sensors on HomeAssistant when the background service options is changed, i.e. do not call the API to enable on start up every time. | | 3.3 | Providing automatic detection for menu definition updates, but still requires an application restart. | -| 3.4 | Fixed a bug where templates failed to display in toggle menu items (at least on some devices). Fixed a bug where a menu item requesting to exit on completion appeared to indicate failure when using Wi-Fi or LTE. The fix uses a delay in exiting the application modelled as sufficient for a Venu 2 device, so this might need tweaking for other devices. Attempt to fixed an "Out of Memory" bug caused by v3.3 by making automatic checking for menu updates both optional and automatically turned off when insufficient memory is available. This last bug is device dependent and may require another attempt. | +| 3.4 | Fixed a bug where templates failed to display in toggle menu items (at least on some devices). Fixed a bug where a menu item requesting to exit on completion appeared to indicate failure when using Wi-Fi or LTE. The fix uses a delay in exiting the application modelled as sufficient for a Venu 2 device, so this might need tweaking for other devices. Attempt to fixed an "Out of Memory" bug caused by v3.3 by making automatic checking for menu updates both optional and automatically turned off when insufficient memory is available. This last bug is device dependent and may require another attempt. Internationalisation improvements with thanks to @krzys_h for a new automated translations script. | diff --git a/translate.cmd b/translate.cmd index 78800b2..0b504fb 100644 --- a/translate.cmd +++ b/translate.cmd @@ -20,5 +20,12 @@ rem https://developer.garmin.com/connect-iq/reference-guides/monkey-c-comman rem rem ----------------------------------------------------------------------------------- +rem 'pip' instructs us to add this to the PATH for 'websockets.exe' and 'httpx.exe' +PATH=%PATH%;%USERPROFILE%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts +rem pip install google-genai beautifulsoup4 lxml +rem Read the API key from a text file excluded from git. +rem Copy the API key from your project in https://aistudio.google.com/app/apikey into this file. +set /p GEMINI_API_KEY=<".\gemini_api_key.txt" +rem echo Using Gemini API Key: %GEMINI_API_KEY% python translate.py pause