Skip to content

Commit 6b7ba52

Browse files
gnpricechrisbobbe
authored andcommitted
profile: Show last-active time
Fixes #1647. There are probably ways the logic here can be improved. But we can do that in tandem with the relative times on the lightbox (#45), once we have ready access to CLDR data via FFI.
1 parent 3fd0817 commit 6b7ba52

17 files changed

+933
-1
lines changed

assets/l10n/app_en.arb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,50 @@
874874
"@yesterday": {
875875
"description": "Term to use to reference the previous day."
876876
},
877+
"userActiveNow": "Active now",
878+
"@userActiveNow": {
879+
"description": "Indicates a user is currently active on Zulip (not idle or offline)"
880+
},
881+
"userIdle": "Idle",
882+
"@userIdle": {
883+
"description": "Indicates a user is currently idle on Zulip (not active, but not offline)"
884+
},
885+
"userActiveMinutesAgo": "Active {minutes, plural, =1{1 minute} other{{minutes} minutes}} ago",
886+
"@userActiveMinutesAgo": {
887+
"description": "Indicates when a user was last active on Zulip (who is currently offline)",
888+
"placeholders": {
889+
"minutes": {"type": "int", "example": "5"}
890+
}
891+
},
892+
"userActiveHoursAgo": "Active {hours, plural, =1{1 hour} other{{hours} hours}} ago",
893+
"@userActiveHoursAgo": {
894+
"description": "Indicates when a user was last active on Zulip (who is currently offline)",
895+
"placeholders": {
896+
"hours": {"type": "int", "example": "5"}
897+
}
898+
},
899+
"userActiveYesterday": "Active yesterday",
900+
"@userActiveYesterday": {
901+
"description": "Indicates when a user was last active on Zulip (who is currently offline)"
902+
},
903+
"userActiveDaysAgo": "Active {days, plural, =1{1 day} other{{days} days}} ago",
904+
"@userActiveDaysAgo": {
905+
"description": "Indicates when a user was last active on Zulip (who is currently offline)",
906+
"placeholders": {
907+
"days": {"type": "int", "example": "5"}
908+
}
909+
},
910+
"userActiveDate": "Active {date}",
911+
"@userActiveDate": {
912+
"description": "Indicates the date when a user was last active on Zulip (who is currently offline).\n\nThe date might be day and month if recent, or day, month, and year if less recent.",
913+
"placeholders": {
914+
"date": {"type": "String", "example": "Aug 1, 2024"}
915+
}
916+
},
917+
"userNotActiveInYear": "Not active in the last year",
918+
"@userNotActiveInYear": {
919+
"description": "Indicates when a user was last active on Zulip (who is currently offline)"
920+
},
877921
"invisibleMode": "Invisible mode",
878922
"@invisibleMode": {
879923
"description": "Label for the 'Invisible mode' switch on the profile page."

lib/generated/l10n/zulip_localizations.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,56 @@ abstract class ZulipLocalizations {
13011301
/// **'Yesterday'**
13021302
String get yesterday;
13031303

1304+
/// Indicates a user is currently active on Zulip (not idle or offline)
1305+
///
1306+
/// In en, this message translates to:
1307+
/// **'Active now'**
1308+
String get userActiveNow;
1309+
1310+
/// Indicates a user is currently idle on Zulip (not active, but not offline)
1311+
///
1312+
/// In en, this message translates to:
1313+
/// **'Idle'**
1314+
String get userIdle;
1315+
1316+
/// Indicates when a user was last active on Zulip (who is currently offline)
1317+
///
1318+
/// In en, this message translates to:
1319+
/// **'Active {minutes, plural, =1{1 minute} other{{minutes} minutes}} ago'**
1320+
String userActiveMinutesAgo(int minutes);
1321+
1322+
/// Indicates when a user was last active on Zulip (who is currently offline)
1323+
///
1324+
/// In en, this message translates to:
1325+
/// **'Active {hours, plural, =1{1 hour} other{{hours} hours}} ago'**
1326+
String userActiveHoursAgo(int hours);
1327+
1328+
/// Indicates when a user was last active on Zulip (who is currently offline)
1329+
///
1330+
/// In en, this message translates to:
1331+
/// **'Active yesterday'**
1332+
String get userActiveYesterday;
1333+
1334+
/// Indicates when a user was last active on Zulip (who is currently offline)
1335+
///
1336+
/// In en, this message translates to:
1337+
/// **'Active {days, plural, =1{1 day} other{{days} days}} ago'**
1338+
String userActiveDaysAgo(int days);
1339+
1340+
/// Indicates the date when a user was last active on Zulip (who is currently offline).
1341+
///
1342+
/// The date might be day and month if recent, or day, month, and year if less recent.
1343+
///
1344+
/// In en, this message translates to:
1345+
/// **'Active {date}'**
1346+
String userActiveDate(String date);
1347+
1348+
/// Indicates when a user was last active on Zulip (who is currently offline)
1349+
///
1350+
/// In en, this message translates to:
1351+
/// **'Not active in the last year'**
1352+
String get userNotActiveInYear;
1353+
13041354
/// Label for the 'Invisible mode' switch on the profile page.
13051355
///
13061356
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,56 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
723723
@override
724724
String get yesterday => 'Yesterday';
725725

726+
@override
727+
String get userActiveNow => 'Active now';
728+
729+
@override
730+
String get userIdle => 'Idle';
731+
732+
@override
733+
String userActiveMinutesAgo(int minutes) {
734+
String _temp0 = intl.Intl.pluralLogic(
735+
minutes,
736+
locale: localeName,
737+
other: '$minutes minutes',
738+
one: '1 minute',
739+
);
740+
return 'Active $_temp0 ago';
741+
}
742+
743+
@override
744+
String userActiveHoursAgo(int hours) {
745+
String _temp0 = intl.Intl.pluralLogic(
746+
hours,
747+
locale: localeName,
748+
other: '$hours hours',
749+
one: '1 hour',
750+
);
751+
return 'Active $_temp0 ago';
752+
}
753+
754+
@override
755+
String get userActiveYesterday => 'Active yesterday';
756+
757+
@override
758+
String userActiveDaysAgo(int days) {
759+
String _temp0 = intl.Intl.pluralLogic(
760+
days,
761+
locale: localeName,
762+
other: '$days days',
763+
one: '1 day',
764+
);
765+
return 'Active $_temp0 ago';
766+
}
767+
768+
@override
769+
String userActiveDate(String date) {
770+
return 'Active $date';
771+
}
772+
773+
@override
774+
String get userNotActiveInYear => 'Not active in the last year';
775+
726776
@override
727777
String get invisibleMode => 'Invisible mode';
728778

lib/generated/l10n/zulip_localizations_de.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,56 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
745745
@override
746746
String get yesterday => 'Gestern';
747747

748+
@override
749+
String get userActiveNow => 'Active now';
750+
751+
@override
752+
String get userIdle => 'Idle';
753+
754+
@override
755+
String userActiveMinutesAgo(int minutes) {
756+
String _temp0 = intl.Intl.pluralLogic(
757+
minutes,
758+
locale: localeName,
759+
other: '$minutes minutes',
760+
one: '1 minute',
761+
);
762+
return 'Active $_temp0 ago';
763+
}
764+
765+
@override
766+
String userActiveHoursAgo(int hours) {
767+
String _temp0 = intl.Intl.pluralLogic(
768+
hours,
769+
locale: localeName,
770+
other: '$hours hours',
771+
one: '1 hour',
772+
);
773+
return 'Active $_temp0 ago';
774+
}
775+
776+
@override
777+
String get userActiveYesterday => 'Active yesterday';
778+
779+
@override
780+
String userActiveDaysAgo(int days) {
781+
String _temp0 = intl.Intl.pluralLogic(
782+
days,
783+
locale: localeName,
784+
other: '$days days',
785+
one: '1 day',
786+
);
787+
return 'Active $_temp0 ago';
788+
}
789+
790+
@override
791+
String userActiveDate(String date) {
792+
return 'Active $date';
793+
}
794+
795+
@override
796+
String get userNotActiveInYear => 'Not active in the last year';
797+
748798
@override
749799
String get invisibleMode => 'Invisible mode';
750800

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,56 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
723723
@override
724724
String get yesterday => 'Yesterday';
725725

726+
@override
727+
String get userActiveNow => 'Active now';
728+
729+
@override
730+
String get userIdle => 'Idle';
731+
732+
@override
733+
String userActiveMinutesAgo(int minutes) {
734+
String _temp0 = intl.Intl.pluralLogic(
735+
minutes,
736+
locale: localeName,
737+
other: '$minutes minutes',
738+
one: '1 minute',
739+
);
740+
return 'Active $_temp0 ago';
741+
}
742+
743+
@override
744+
String userActiveHoursAgo(int hours) {
745+
String _temp0 = intl.Intl.pluralLogic(
746+
hours,
747+
locale: localeName,
748+
other: '$hours hours',
749+
one: '1 hour',
750+
);
751+
return 'Active $_temp0 ago';
752+
}
753+
754+
@override
755+
String get userActiveYesterday => 'Active yesterday';
756+
757+
@override
758+
String userActiveDaysAgo(int days) {
759+
String _temp0 = intl.Intl.pluralLogic(
760+
days,
761+
locale: localeName,
762+
other: '$days days',
763+
one: '1 day',
764+
);
765+
return 'Active $_temp0 ago';
766+
}
767+
768+
@override
769+
String userActiveDate(String date) {
770+
return 'Active $date';
771+
}
772+
773+
@override
774+
String get userNotActiveInYear => 'Not active in the last year';
775+
726776
@override
727777
String get invisibleMode => 'Invisible mode';
728778

lib/generated/l10n/zulip_localizations_fr.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,56 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
737737
@override
738738
String get yesterday => 'Yesterday';
739739

740+
@override
741+
String get userActiveNow => 'Active now';
742+
743+
@override
744+
String get userIdle => 'Idle';
745+
746+
@override
747+
String userActiveMinutesAgo(int minutes) {
748+
String _temp0 = intl.Intl.pluralLogic(
749+
minutes,
750+
locale: localeName,
751+
other: '$minutes minutes',
752+
one: '1 minute',
753+
);
754+
return 'Active $_temp0 ago';
755+
}
756+
757+
@override
758+
String userActiveHoursAgo(int hours) {
759+
String _temp0 = intl.Intl.pluralLogic(
760+
hours,
761+
locale: localeName,
762+
other: '$hours hours',
763+
one: '1 hour',
764+
);
765+
return 'Active $_temp0 ago';
766+
}
767+
768+
@override
769+
String get userActiveYesterday => 'Active yesterday';
770+
771+
@override
772+
String userActiveDaysAgo(int days) {
773+
String _temp0 = intl.Intl.pluralLogic(
774+
days,
775+
locale: localeName,
776+
other: '$days days',
777+
one: '1 day',
778+
);
779+
return 'Active $_temp0 ago';
780+
}
781+
782+
@override
783+
String userActiveDate(String date) {
784+
return 'Active $date';
785+
}
786+
787+
@override
788+
String get userNotActiveInYear => 'Not active in the last year';
789+
740790
@override
741791
String get invisibleMode => 'Invisible mode';
742792

lib/generated/l10n/zulip_localizations_it.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,56 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
738738
@override
739739
String get yesterday => 'Ieri';
740740

741+
@override
742+
String get userActiveNow => 'Active now';
743+
744+
@override
745+
String get userIdle => 'Idle';
746+
747+
@override
748+
String userActiveMinutesAgo(int minutes) {
749+
String _temp0 = intl.Intl.pluralLogic(
750+
minutes,
751+
locale: localeName,
752+
other: '$minutes minutes',
753+
one: '1 minute',
754+
);
755+
return 'Active $_temp0 ago';
756+
}
757+
758+
@override
759+
String userActiveHoursAgo(int hours) {
760+
String _temp0 = intl.Intl.pluralLogic(
761+
hours,
762+
locale: localeName,
763+
other: '$hours hours',
764+
one: '1 hour',
765+
);
766+
return 'Active $_temp0 ago';
767+
}
768+
769+
@override
770+
String get userActiveYesterday => 'Active yesterday';
771+
772+
@override
773+
String userActiveDaysAgo(int days) {
774+
String _temp0 = intl.Intl.pluralLogic(
775+
days,
776+
locale: localeName,
777+
other: '$days days',
778+
one: '1 day',
779+
);
780+
return 'Active $_temp0 ago';
781+
}
782+
783+
@override
784+
String userActiveDate(String date) {
785+
return 'Active $date';
786+
}
787+
788+
@override
789+
String get userNotActiveInYear => 'Not active in the last year';
790+
741791
@override
742792
String get invisibleMode => 'Invisible mode';
743793

0 commit comments

Comments
 (0)