commit 80ae489967d8076b28f86e60593876b9fdec594f
parent 259c0b677a5a5695480b992a1a733c98ea3a8e92
Author: kernelkind <kernelkind@gmail.com>
Date: Thu, 4 Sep 2025 15:31:09 -0400
ui: repost description impl
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
1 file changed, 48 insertions(+), 0 deletions(-)
diff --git a/crates/notedeck_columns/src/ui/timeline.rs b/crates/notedeck_columns/src/ui/timeline.rs
@@ -542,6 +542,54 @@ fn reaction_description(
}
}
+fn repost_description(
+ loc: &mut Localization,
+ first_name: &str,
+ count: usize,
+ referenced_type: ReferencedNoteType,
+) -> String {
+ match referenced_type {
+ ReferencedNoteType::Tagged => {
+ if count == 0 {
+ tr!(
+ loc,
+ "{name} reposted a note you were tagged in",
+ "repost from user",
+ name = first_name
+ )
+ } else {
+ tr_plural!(
+ loc,
+ "{name} and {count} other reposted a note you were tagged in",
+ "{name} and {ocunt} others reposted a note you were tagged in",
+ "describing the amount of reposts a note you were tagged in received",
+ count,
+ name = first_name
+ )
+ }
+ }
+ ReferencedNoteType::Yours => {
+ if count == 0 {
+ tr!(
+ loc,
+ "{name} reposted your note",
+ "repost from user",
+ name = first_name
+ )
+ } else {
+ tr_plural!(
+ loc,
+ "{name} and {count} other reposted your note",
+ "{name} and {count} others reposted your note",
+ "describing the amount of reposts your note received",
+ count,
+ name = first_name
+ )
+ }
+ }
+ }
+}
+
fn render_note(
ui: &mut egui::Ui,
note_context: &mut NoteContext,