From 8651f31ebb7cf9c6a0949503f2c2c5755328ce46 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 29 Aug 2024 19:22:53 -0500 Subject: Localize dates, counts (#5027) * refactor: consistent localized formatting * refactor: localized date time * refactor: localize relative time with strings * chore: fix typo from copy-paste * Clean up useTimeAgo * Remove old ago * Const * Reuse * Prettier --------- Co-authored-by: Mary --- src/view/com/post-thread/PostThreadItem.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/view/com/post-thread/PostThreadItem.tsx') diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index a3cfebbab..3b5ddb1dc 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -181,7 +181,7 @@ let PostThreadItemLoaded = ({ threadgateRecord?: AppBskyFeedThreadgate.Record }): React.ReactNode => { const pal = usePalette('default') - const {_} = useLingui() + const {_, i18n} = useLingui() const langPrefs = useLanguagePrefs() const {openComposer} = useComposerControls() const [limitLines, setLimitLines] = React.useState( @@ -388,7 +388,7 @@ let PostThreadItemLoaded = ({ type="lg" style={pal.textLight}> - {formatCount(post.repostCount)} + {formatCount(i18n, post.repostCount)} {' '} - {formatCount(post.quoteCount)} + {formatCount(i18n, post.quoteCount)} {' '} - {formatCount(post.likeCount)} + {formatCount(i18n, post.likeCount)} {' '} @@ -705,7 +705,7 @@ function ExpandedPostDetails({ translatorUrl: string }) { const pal = usePalette('default') - const {_} = useLingui() + const {_, i18n} = useLingui() const openLink = useOpenLink() const isRootPost = !('reply' in post.record) @@ -723,7 +723,9 @@ function ExpandedPostDetails({ s.mt2, s.mb10, ]}> - {niceDate(post.indexedAt)} + + {niceDate(i18n, post.indexedAt)} + {isRootPost && ( )} -- cgit 1.4.1