Skip to content

Commit

Permalink
Merge pull request #441 from jmlich/huami-items-translations
Browse files Browse the repository at this point in the history
Add translations to huami items
  • Loading branch information
piggz authored Jan 10, 2025
2 parents 28f62ab + 41ab6ac commit cb8f04c
Showing 1 changed file with 46 additions and 25 deletions.
71 changes: 46 additions & 25 deletions ui/qml/pages/Settings-huami-shortcuts.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,52 @@ PagePL {
}

function displayName(name) {
if (name === "status") return qsTr("Status");
if (name === "hr") return qsTr("Heartrate");
if (name === "workout") return qsTr("Workout");
if (name === "weather") return qsTr("Weather");
if (name === "notifications") return qsTr("Notifications");
if (name === "more") return qsTr("More");
if (name === "dnd") return qsTr("Do Not Disturb");
if (name === "alarm") return qsTr("Alarms");
if (name === "music") return qsTr("Music");
if (name === "time") return qsTr("Time");
if (name === "mutephone") return qsTr("Mute Phone");
if (name === "settings") return qsTr("Settings");
if (name === "activity") return qsTr("Activity");
if (name === "eventreminder") return qsTr("Event Reminder");
if (name === "pai") return qsTr("PAI");
if (name === "worldclock") return qsTr("World Clock");
if (name === "stress") return qsTr("Stress");
if (name === "period") return qsTr("Period");
if (name === "spo2") return qsTr("SPO2");
if (name === "alexa") return qsTr("Alexa");
if (name === "compass") return qsTr("Compass");
if (name === "alipay") return qsTr("AliPay");
if (name === "timer") return qsTr("Timer");

//If all else fails, use original name
const translations = {
"status": qsTr("Status"),
"hr": qsTr("HR"),
"workout": qsTr("Workout"),
"weather": qsTr("Weather"),
"notifications": qsTr("Notifications"),
"more": qsTr("More"),
"dnd": qsTr("DND"),
"alarm": qsTr("Alarm"),
"takephoto": qsTr("Take Photo"),
"music": qsTr("Music"),
"stopwatch": qsTr("Stopwatch"),
"timer": qsTr("Timer"),
"findphone": qsTr("Find Phone"),
"mutephone": qsTr("Mute Phone"),
"nfc": qsTr("NFC"),
"alipay": qsTr("AliPay"),
"watchface": qsTr("Watch Face"),
"settings": qsTr("Settings"),
"activity": qsTr("Activity"),
"eventreminder": qsTr("Event Reminder"),
"compass": qsTr("Compass"),
"pai": qsTr("PAI"),
"worldclock": qsTr("World Clock"),
"timer_stopwatch": qsTr("Timer/Stopwatch"),
"stress": qsTr("Stress"),
"period": qsTr("Period"),
"goal": qsTr("Goal"),
"sleep": qsTr("Sleep"),
"spo2": qsTr("SpO2"),
"events": qsTr("Events"),
"widgets": qsTr("Widgets"),
"breathing": qsTr("Breathing"),
"steps": qsTr("Steps"),
"distance": qsTr("Distance"),
"calories": qsTr("Calories"),
"pomodoro": qsTr("Pomodoro"),
"alexa": qsTr("Alexa"),
"battery": qsTr("Battery"),
"temperature": qsTr("Temperature"),
"barometer": qsTr("Barometer"),
"flashlight": qsTr("Flashlight")
};
if (translations[name] !== undefined) {
return translations[name];
}
return name;
}

Expand Down

0 comments on commit cb8f04c

Please sign in to comment.