@@ -40,7 +40,7 @@ import ProjectThumbnail from "./ProjectThumbnail";
4040import { generateRetroAvatar } from "../lib/avatar" ;
4141import { generateRetroSpriteAvatar } from "../lib/retroSpriteAvatar" ;
4242import AvatarSelector from "./AvatarSelector" ;
43- import { useTranslation } from "@zxplay/i18n" ;
43+ import { useTranslation , useDateFnsLocale } from "@zxplay/i18n" ;
4444
4545const UPDATE_PROJECT_ORDER = gql `
4646 mutation UpdateProjectOrder($projectId: uuid!, $displayOrder: Int!) {
@@ -149,6 +149,7 @@ const GET_USER_BY_ID = gql`
149149// Sortable project card component for drag and drop
150150function SortableProjectCard ( { project, projectUrl, isDragging } ) {
151151 const { t } = useTranslation ( ) ;
152+ const locale = useDateFnsLocale ( ) ;
152153 const navigate = useNavigate ( ) ;
153154 const {
154155 attributes,
@@ -230,9 +231,10 @@ function SortableProjectCard({ project, projectUrl, isDragging }) {
230231 />
231232
232233 < div className = "mt-auto text-400 text-sm relative z-1" >
233- Updated { " " }
234+ { t ( "feed.updated" ) } { " " }
234235 { formatDistanceToNow ( new Date ( project . updated_at ) , {
235236 addSuffix : true ,
237+ locale,
236238 } ) }
237239 </ div >
238240 </ div >
@@ -256,6 +258,7 @@ function getLanguageColor(lang) {
256258
257259export default function PublicUserProfile ( ) {
258260 const { t } = useTranslation ( ) ;
261+ const locale = useDateFnsLocale ( ) ;
259262 const { id } = useParams ( ) ; // This could be either slug or UUID
260263 const navigate = useNavigate ( ) ;
261264 const dispatch = useDispatch ( ) ;
@@ -539,6 +542,7 @@ export default function PublicUserProfile() {
539542 const displayName = user . greeting_name || t ( "profile.defaultName" ) ;
540543 const memberSince = formatDistanceToNow ( new Date ( user . created_at ) , {
541544 addSuffix : true ,
545+ locale,
542546 } ) ;
543547
544548 return (
@@ -663,11 +667,15 @@ export default function PublicUserProfile() {
663667 < Card
664668 title = {
665669 < div className = "flex align-items-center justify-content-between" >
666- < span > Public Projects ({ projects ?. length || 0 } )</ span >
670+ < span >
671+ { t ( "profile.publicProjects" , {
672+ count : projects ?. length || 0 ,
673+ } ) }
674+ </ span >
667675 { isOwnProfile && isSaving && (
668676 < Tag
669677 severity = "info"
670- value = "Saving order..."
678+ value = { t ( "profile.savingOrder" ) }
671679 icon = "pi pi-spin pi-spinner"
672680 />
673681 ) }
@@ -742,10 +750,10 @@ export default function PublicUserProfile() {
742750 />
743751
744752 < div className = "mt-auto text-400 text-sm relative z-1" >
745- Updated { " " }
753+ { t ( "feed.updated" ) } { " " }
746754 { formatDistanceToNow (
747755 new Date ( project . updated_at ) ,
748- { addSuffix : true }
756+ { addSuffix : true , locale }
749757 ) }
750758 </ div >
751759 </ div >
@@ -761,9 +769,7 @@ export default function PublicUserProfile() {
761769 < i className = "pi pi-inbox text-4xl text-300 mb-3" />
762770 < p className = "text-500" > { t ( "profile.noProjects" ) } </ p >
763771 { isOwnProfile && (
764- < p className = "text-sm" >
765- Make your projects public to display them here
766- </ p >
772+ < p className = "text-sm" > { t ( "profile.makePublicHint" ) } </ p >
767773 ) }
768774 </ div >
769775 ) }
0 commit comments