mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Use proper localization in new notification mute time selector
This commit is contained in:
@@ -228,5 +228,37 @@
|
|||||||
"ktg_reminder_preview": "Remind with preview",
|
"ktg_reminder_preview": "Remind with preview",
|
||||||
"ktg_schedule_preview": "Send preview scheduled",
|
"ktg_schedule_preview": "Send preview scheduled",
|
||||||
"ktg_language_reloaded": "Kotatogram-specific language strings were reloaded.",
|
"ktg_language_reloaded": "Kotatogram-specific language strings were reloaded.",
|
||||||
|
"ktg_notifications_mute_seconds": {
|
||||||
|
"zero": "seconds",
|
||||||
|
"one": "second",
|
||||||
|
"two": "seconds",
|
||||||
|
"few": "seconds",
|
||||||
|
"many": "seconds",
|
||||||
|
"other": "seconds"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_minutes": {
|
||||||
|
"zero": "minutes",
|
||||||
|
"one": "minute",
|
||||||
|
"two": "minutes",
|
||||||
|
"few": "minutes",
|
||||||
|
"many": "minutes",
|
||||||
|
"other": "minutes"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_hours": {
|
||||||
|
"zero": "hours",
|
||||||
|
"one": "hour",
|
||||||
|
"two": "hours",
|
||||||
|
"few": "hours",
|
||||||
|
"many": "hours",
|
||||||
|
"other": "hours"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_days": {
|
||||||
|
"zero": "days",
|
||||||
|
"one": "day",
|
||||||
|
"two": "days",
|
||||||
|
"few": "days",
|
||||||
|
"many": "days",
|
||||||
|
"other": "days"
|
||||||
|
},
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
}
|
}
|
||||||
|
@@ -228,5 +228,37 @@
|
|||||||
"ktg_reminder_preview": "Напомнить с помощью превью",
|
"ktg_reminder_preview": "Напомнить с помощью превью",
|
||||||
"ktg_schedule_preview": "Отправить превью позже",
|
"ktg_schedule_preview": "Отправить превью позже",
|
||||||
"ktg_language_reloaded": "Языковые строки Kotatogram были перезагружены.",
|
"ktg_language_reloaded": "Языковые строки Kotatogram были перезагружены.",
|
||||||
|
"ktg_notifications_mute_seconds": {
|
||||||
|
"zero": "секунд",
|
||||||
|
"one": "секунда",
|
||||||
|
"two": "секунды",
|
||||||
|
"few": "секунды",
|
||||||
|
"many": "секунд",
|
||||||
|
"other": "секунды"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_minutes": {
|
||||||
|
"zero": "минут",
|
||||||
|
"one": "минута",
|
||||||
|
"two": "минуты",
|
||||||
|
"few": "минуты",
|
||||||
|
"many": "минут",
|
||||||
|
"other": "минуты"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_hours": {
|
||||||
|
"zero": "часов",
|
||||||
|
"one": "час",
|
||||||
|
"two": "часа",
|
||||||
|
"few": "часа",
|
||||||
|
"many": "часов",
|
||||||
|
"other": "часа"
|
||||||
|
},
|
||||||
|
"ktg_notifications_mute_days": {
|
||||||
|
"zero": "дней",
|
||||||
|
"one": "день",
|
||||||
|
"two": "дня",
|
||||||
|
"few": "дня",
|
||||||
|
"many": "дней",
|
||||||
|
"other": "дня"
|
||||||
|
},
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
}
|
}
|
||||||
|
@@ -65,25 +65,13 @@ void MuteSettingsBox::prepare() {
|
|||||||
const auto group = std::make_shared<Ui::RadiobuttonGroup>(kForeverHours);
|
const auto group = std::make_shared<Ui::RadiobuttonGroup>(kForeverHours);
|
||||||
y += st::boxOptionListPadding.top();
|
y += st::boxOptionListPadding.top();
|
||||||
|
|
||||||
const auto trimLangStr = [] (const QString &numberStr, const QString &langStr) {
|
|
||||||
return langStr.mid(numberStr.length()).trimmed();
|
|
||||||
};
|
|
||||||
|
|
||||||
const auto makePeriodText = [=, this] (Period period) {
|
const auto makePeriodText = [=, this] (Period period) {
|
||||||
const auto currentValue = _forNumberInput->getLastText().toInt();
|
const auto currentValue = _forNumberInput->getLastText().toInt();
|
||||||
const auto currentStrValue = QString::number(currentValue); // re-converting to get rid of the invalid symbols
|
|
||||||
switch (period) {
|
switch (period) {
|
||||||
case Period::Second:
|
case Period::Second: return ktr("ktg_notifications_mute_seconds", currentValue);
|
||||||
return trimLangStr(currentStrValue, tr::lng_group_call_duration_seconds(tr::now, lt_count, currentValue));
|
case Period::Minute: return ktr("ktg_notifications_mute_minutes", currentValue);
|
||||||
|
case Period::Hour: return ktr("ktg_notifications_mute_hours", currentValue);
|
||||||
case Period::Minute:
|
case Period::Day: return ktr("ktg_notifications_mute_days", currentValue);
|
||||||
return trimLangStr(currentStrValue, tr::lng_group_call_duration_minutes(tr::now, lt_count, currentValue));
|
|
||||||
|
|
||||||
case Period::Hour:
|
|
||||||
return trimLangStr(currentStrValue, tr::lng_group_call_duration_hours(tr::now, lt_count, currentValue));
|
|
||||||
|
|
||||||
case Period::Day:
|
|
||||||
return trimLangStr(currentStrValue, tr::lng_group_call_duration_days(tr::now, lt_count, currentValue));
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QString();
|
return QString();
|
||||||
|
Reference in New Issue
Block a user