From 451774ddf8d3b1b9cff4981abf50b332b63f1615 Mon Sep 17 00:00:00 2001 From: ariel-lindemann <41641978+ariel-lindemann@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:25:34 +0100 Subject: [PATCH] fix: broken translations in status bar settings (#1188) ## Summary * **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) The strings for `Show` and `Hide` were always showing in English, regardless of which language was selected. * **What changes are included?** Replace the variables in the lambda by direct calls to the `tr` macro ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _****_ --- src/activities/settings/StatusBarSettingsActivity.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/activities/settings/StatusBarSettingsActivity.cpp b/src/activities/settings/StatusBarSettingsActivity.cpp index 675f73dc..f216b941 100644 --- a/src/activities/settings/StatusBarSettingsActivity.cpp +++ b/src/activities/settings/StatusBarSettingsActivity.cpp @@ -28,9 +28,6 @@ const StrId progressBarThicknessNames[PROGRESS_BAR_THICKNESS_ITEMS] = { constexpr int TITLE_ITEMS = 3; const StrId titleNames[TITLE_ITEMS] = {StrId::STR_BOOK, StrId::STR_CHAPTER, StrId::STR_HIDE}; -const char* translatedShow = tr(STR_SHOW); -const char* translatedHide = tr(STR_HIDE); - const int widthMargin = 10; const int verticalPreviewPadding = 50; const int verticalPreviewTextPadding = 40; @@ -135,9 +132,9 @@ void StatusBarSettingsActivity::render(Activity::RenderLock&&) { [this](int index) { // Draw status for each setting if (index == 0) { - return SETTINGS.statusBarChapterPageCount ? translatedShow : translatedHide; + return SETTINGS.statusBarChapterPageCount ? tr(STR_SHOW) : tr(STR_HIDE); } else if (index == 1) { - return SETTINGS.statusBarBookProgressPercentage ? translatedShow : translatedHide; + return SETTINGS.statusBarBookProgressPercentage ? tr(STR_SHOW) : tr(STR_HIDE); } else if (index == 2) { return I18N.get(progressBarNames[SETTINGS.statusBarProgressBar]); } else if (index == 3) { @@ -145,9 +142,9 @@ void StatusBarSettingsActivity::render(Activity::RenderLock&&) { } else if (index == 4) { return I18N.get(titleNames[SETTINGS.statusBarTitle]); } else if (index == 5) { - return SETTINGS.statusBarBattery ? translatedShow : translatedHide; + return SETTINGS.statusBarBattery ? tr(STR_SHOW) : tr(STR_HIDE); } else { - return translatedHide; + return tr(STR_HIDE); } }, true);