Implement dates of who read your message list.

This commit is contained in:
John Preston
2023-03-03 17:15:02 +04:00
committed by 23rd
parent af51307aa6
commit b95ea28e12
15 changed files with 214 additions and 122 deletions

View File

@@ -52,72 +52,7 @@ inline QString langDateMaybeWithYear(
return withoutYear(month, year);
}
tr::phrase<> Month(int index) {
switch (index) {
case 1: return tr::lng_month1;
case 2: return tr::lng_month2;
case 3: return tr::lng_month3;
case 4: return tr::lng_month4;
case 5: return tr::lng_month5;
case 6: return tr::lng_month6;
case 7: return tr::lng_month7;
case 8: return tr::lng_month8;
case 9: return tr::lng_month9;
case 10: return tr::lng_month10;
case 11: return tr::lng_month11;
case 12: return tr::lng_month12;
}
Unexpected("Index in MonthSmall.");
}
tr::phrase<> MonthSmall(int index) {
switch (index) {
case 1: return tr::lng_month1_small;
case 2: return tr::lng_month2_small;
case 3: return tr::lng_month3_small;
case 4: return tr::lng_month4_small;
case 5: return tr::lng_month5_small;
case 6: return tr::lng_month6_small;
case 7: return tr::lng_month7_small;
case 8: return tr::lng_month8_small;
case 9: return tr::lng_month9_small;
case 10: return tr::lng_month10_small;
case 11: return tr::lng_month11_small;
case 12: return tr::lng_month12_small;
}
Unexpected("Index in MonthSmall.");
}
tr::phrase<> MonthDay(int index) {
switch (index) {
case 1: return tr::lng_month_day1;
case 2: return tr::lng_month_day2;
case 3: return tr::lng_month_day3;
case 4: return tr::lng_month_day4;
case 5: return tr::lng_month_day5;
case 6: return tr::lng_month_day6;
case 7: return tr::lng_month_day7;
case 8: return tr::lng_month_day8;
case 9: return tr::lng_month_day9;
case 10: return tr::lng_month_day10;
case 11: return tr::lng_month_day11;
case 12: return tr::lng_month_day12;
}
Unexpected("Index in MonthDay.");
}
tr::phrase<> Weekday(int index) {
switch (index) {
case 1: return tr::lng_weekday1;
case 2: return tr::lng_weekday2;
case 3: return tr::lng_weekday3;
case 4: return tr::lng_weekday4;
case 5: return tr::lng_weekday5;
case 6: return tr::lng_weekday6;
case 7: return tr::lng_weekday7;
}
Unexpected("Index in Weekday.");
}
using namespace Lang;
} // namespace
@@ -245,4 +180,71 @@ QString LanguageIdOrDefault(const QString &id) {
return !id.isEmpty() ? id : DefaultLanguageId();
}
tr::phrase<> Month(int index) {
switch (index) {
case 1: return tr::lng_month1;
case 2: return tr::lng_month2;
case 3: return tr::lng_month3;
case 4: return tr::lng_month4;
case 5: return tr::lng_month5;
case 6: return tr::lng_month6;
case 7: return tr::lng_month7;
case 8: return tr::lng_month8;
case 9: return tr::lng_month9;
case 10: return tr::lng_month10;
case 11: return tr::lng_month11;
case 12: return tr::lng_month12;
}
Unexpected("Index in MonthSmall.");
}
tr::phrase<> MonthSmall(int index) {
switch (index) {
case 1: return tr::lng_month1_small;
case 2: return tr::lng_month2_small;
case 3: return tr::lng_month3_small;
case 4: return tr::lng_month4_small;
case 5: return tr::lng_month5_small;
case 6: return tr::lng_month6_small;
case 7: return tr::lng_month7_small;
case 8: return tr::lng_month8_small;
case 9: return tr::lng_month9_small;
case 10: return tr::lng_month10_small;
case 11: return tr::lng_month11_small;
case 12: return tr::lng_month12_small;
}
Unexpected("Index in MonthSmall.");
}
tr::phrase<> MonthDay(int index) {
switch (index) {
case 1: return tr::lng_month_day1;
case 2: return tr::lng_month_day2;
case 3: return tr::lng_month_day3;
case 4: return tr::lng_month_day4;
case 5: return tr::lng_month_day5;
case 6: return tr::lng_month_day6;
case 7: return tr::lng_month_day7;
case 8: return tr::lng_month_day8;
case 9: return tr::lng_month_day9;
case 10: return tr::lng_month_day10;
case 11: return tr::lng_month_day11;
case 12: return tr::lng_month_day12;
}
Unexpected("Index in MonthDay.");
}
tr::phrase<> Weekday(int index) {
switch (index) {
case 1: return tr::lng_weekday1;
case 2: return tr::lng_weekday2;
case 3: return tr::lng_weekday3;
case 4: return tr::lng_weekday4;
case 5: return tr::lng_weekday5;
case 6: return tr::lng_weekday6;
case 7: return tr::lng_weekday7;
}
Unexpected("Index in Weekday.");
}
} // namespace Lang

View File

@@ -37,4 +37,9 @@ namespace Lang {
[[nodiscard]] QString DefaultLanguageId();
[[nodiscard]] QString LanguageIdOrDefault(const QString &id);
[[nodiscard]] tr::phrase<> Month(int index);
[[nodiscard]] tr::phrase<> MonthSmall(int index);
[[nodiscard]] tr::phrase<> MonthDay(int index);
[[nodiscard]] tr::phrase<> Weekday(int index);
} // namespace Lang