From f26d86e9e0955d7082f252e6a7503d03efcdf96e Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 23 Mar 2021 11:08:37 +0200 Subject: Lang: Added a sidebar string; Finnish template IssueID #192 --- src/ui/sidebarwidget.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/ui/sidebarwidget.c') diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 8d025569..5ff585a5 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -492,10 +492,11 @@ static void updateMetrics_SidebarWidget_(iSidebarWidget *d) { d->maxButtonLabelWidth = 0; for (int i = 0; i < max_SidebarMode; i++) { if (d->modeButtons[i]) { - d->maxButtonLabelWidth = iMaxi( - d->maxButtonLabelWidth, - 3 * gap_UI + - measure_Text(font_LabelWidget(d->modeButtons[i]), normalModeLabels_[i]).x); + d->maxButtonLabelWidth = + iMaxi(d->maxButtonLabelWidth, + 3 * gap_UI + measure_Text(font_LabelWidget(d->modeButtons[i]), + translateCStr_Lang(normalModeLabels_[i])) + .x); } } updateItemHeight_SidebarWidget_(d); @@ -702,11 +703,15 @@ static void checkModeButtonLayout_SidebarWidget_(iSidebarWidget *d) { if (!button) continue; setFlags_Widget(as_Widget(button), tight_WidgetFlag, isTight); if (i == feeds_SidebarMode && d->numUnreadEntries) { - updateText_LabelWidget(button, - collectNewFormat_String("%s " uiTextAction_ColorEscape "%zu%s", - tightModeLabels_[i], - d->numUnreadEntries, - !isTight ? " ${sidebar.unread}" : "")); + updateText_LabelWidget( + button, + collectNewFormat_String("%s " uiTextAction_ColorEscape "%zu%s", + tightModeLabels_[i], + d->numUnreadEntries, + !isTight + ? (d->numUnreadEntries == 1 ? " ${sidebar.unread}" + : " ${sidebar.unread.many}") + : "")); } else { updateTextCStr_LabelWidget(button, -- cgit v1.2.3