Skip to content

[BanglExercise] Grammar changes, add language translations #3956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/banglexercise/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
0.03: Add software back button on main menu
0.04: Minor code improvements
0.05: Minor code improvements
0.06: Fix grammar, add international language support
32 changes: 16 additions & 16 deletions apps/banglexercise/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let exerciseType = {
// add new exercises here:
const exerciseTypes = [{
"id": "pushup",
"name": "push ups",
"name": /*LANG*/"Push-ups",
"useYaxis": true,
"useZaxis": false,
"threshold": 2500,
Expand All @@ -34,7 +34,7 @@ const exerciseTypes = [{
},
{
"id": "curl",
"name": "curls",
"name": /*LANG*/"Curls",
"useYaxis": true,
"useZaxis": false,
"threshold": 2500,
Expand All @@ -44,7 +44,7 @@ const exerciseTypes = [{
},
{
"id": "situp",
"name": "sit ups",
"name": /*LANG*/"Sit-ups",
"useYaxis": false,
"useZaxis": true,
"threshold": 3500,
Expand Down Expand Up @@ -88,7 +88,7 @@ function showMainMenu() {
menu["--------"] = {
value: ""
};
menu["Last:"] = {
menu[/*LANG*/"Last:"] = {
value: exerciseCounter + " " + exerciseType.name
};
}
Expand Down Expand Up @@ -189,10 +189,10 @@ function isValidExercise(slope, t) {
if (p1 > 0 && p2 < 0) {
if (lastZeroPassCameFromPositive == false) {
lastExerciseHalfCompletionTime = t;
console.log(t, exerciseName + " half complete...");
console.log(t, exerciseName + /*LANG*/" half complete...");

layout.progress.label = "½";
layout.recording.label = "TRAINING";
layout.recording.label = /*LANG*/"TRAINING";
g.clear();
layout.render();
}
Expand All @@ -204,7 +204,7 @@ function isValidExercise(slope, t) {
if (lastZeroPassCameFromPositive == true) {
const tDiffLastExercise = t - lastExerciseCompletionTime;
const tDiffStart = t - tStart;
console.log(t, exerciseName + " maybe complete?", Math.round(tDiffLastExercise), Math.round(tDiffStart));
console.log(t, exerciseName + /*LANG*/" maybe complete?", Math.round(tDiffLastExercise), Math.round(tDiffStart));

// check minimal time between exercises:
if ((lastExerciseCompletionTime <= 0 && tDiffStart >= thresholdMinTime) || tDiffLastExercise >= thresholdMinTime) {
Expand All @@ -222,34 +222,34 @@ function isValidExercise(slope, t) {

layout.count.label = exerciseCounter;
layout.progress.label = "";
layout.recording.label = "Good!";
layout.recording.label =/*LANG*/"Good!";

g.clear();
layout.render();

if (settings.buzz)
Bangle.buzz(200, 0.5);
} else {
console.log(t, exerciseName + " too quick for duration time threshold!"); // thresholdMinDurationTime
console.log(t, exerciseName + /*LANG*/" too quick for duration time threshold!"); // thresholdMinDurationTime
lastExerciseCompletionTime = t;

layout.recording.label = "Go slower!";
layout.recording.label = /*LANG*/"Go slower!";
g.clear();
layout.render();
}
} else {
console.log(t, exerciseName + " top slow for time threshold!"); // thresholdMaxTime
console.log(t, exerciseName + /*LANG*/" top slow for time threshold!"); // thresholdMaxTime
lastExerciseCompletionTime = t;

layout.recording.label = "Go faster!";
layout.recording.label = /*LANG*/"Go faster!";
g.clear();
layout.render();
}
} else {
console.log(t, exerciseName + " too quick for time threshold!"); // thresholdMinTime
console.log(t, exerciseName + /*LANG*/" too quick for time threshold!"); // thresholdMinTime
lastExerciseCompletionTime = t;

layout.recording.label = "Go slower!";
layout.recording.label = /*LANG*/"Go slower!";
g.clear();
layout.render();
}
Expand Down Expand Up @@ -337,15 +337,15 @@ function startTraining() {
type: "txt",
id: "recording",
font: "6x8:2",
label: "TRAINING",
label: /*LANG*/"TRAINING",
bgCol: "#f00",
pad: 5,
fillx: 1
},
]
}, {
btns: [{
label: "STOP",
label: /*LANG*/"STOP",
cb: () => {
stopTraining();
}
Expand Down
6 changes: 3 additions & 3 deletions apps/banglexercise/metadata.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ "id": "banglexercise",
"name": "BanglExercise",
"shortName":"BanglExercise",
"version": "0.05",
"description": "Can automatically track exercises while wearing the Bangle.js watch.",
"version": "0.06",
"description": "Automatically tracks exercises while wearing the Bangle.js watch.",
"icon": "app.png",
"screenshots": [{"url":"screenshot.png"}],
"type": "app",
"tags": "sport",
"tags": "health",
"supports" : ["BANGLEJS2"],
"allow_emulator":true,
"readme": "README.md",
Expand Down