Add translations

This commit is contained in:
MartinBraquet
2026-03-05 15:48:25 +01:00
parent 512406837d
commit 0379c95f9b
3 changed files with 22 additions and 9 deletions

View File

@@ -1271,5 +1271,10 @@
"share_profile.on_x": "Auf X teilen",
"share_profile.on_linkedin": "Auf LinkedIn teilen",
"share_profile.view_profile_card": "Profilkarte ansehen",
"profile_card.loading": "Ihre Karte wird geladen, es kann ein paar Sekunden dauern..."
"profile_card.loading": "Ihre Karte wird geladen, es kann ein paar Sekunden dauern...",
"userpage.failedToFetch": "Profil konnte nicht geladen werden.",
"userpage.accountDeleted": "Dieses Konto wurde gelöscht.",
"userpage.accountSuspended": "Dieses Konto wurde gesperrt.",
"userpage.profileNotCreated": "Dieser Benutzer hat noch kein Profil erstellt.",
"userpage.profileDisabled": "Der Benutzer hat sein Profil deaktiviert."
}

View File

@@ -1270,5 +1270,10 @@
"share_profile.on_x": "Partager sur X",
"share_profile.on_linkedin": "Partager sur LinkedIn",
"share_profile.view_profile_card": "Voir la carte de profil",
"profile_card.loading": "Chargement de votre carte, cela peut prendre quelques secondes..."
"profile_card.loading": "Chargement de votre carte, cela peut prendre quelques secondes...",
"userpage.failedToFetch": "Échec du chargement du profil.",
"userpage.accountDeleted": "Ce compte a été supprimé.",
"userpage.accountSuspended": "Ce compte a été suspendu.",
"userpage.profileNotCreated": "Cet utilisateur n'a pas encore créé de profil.",
"userpage.profileDisabled": "L'utilisateur a désactivé son profil."
}

View File

@@ -20,6 +20,7 @@ import {useProfileByUser} from 'web/hooks/use-profile'
import {useSaveReferral} from 'web/hooks/use-save-referral'
import {useTracking} from 'web/hooks/use-tracking'
import {useUser} from 'web/hooks/use-user'
import {useT} from 'web/lib/locale'
import {db} from 'web/lib/supabase/db'
import {safeLocalStorage} from 'web/lib/util/local'
import {getPageData} from 'web/lib/util/page-data'
@@ -117,7 +118,7 @@ export const getStaticProps = async (
debug('No profile', `${user.username} hasn't created a profile yet.`)
return {
props: {
notFoundCustomText: `${user.username} hasn't created a profile yet.`,
notFoundCustomText: null,
},
revalidate: 1,
}
@@ -135,7 +136,7 @@ export const getStaticProps = async (
// Runs at build time for SSG (native mobile), or at runtime for ISR fallback in web
export const getStaticPaths = () => {
console.log('Starting getStaticPaths in /[username]', isNativeMobile())
// console.log('Starting getStaticPaths in /[username]', isNativeMobile())
return {paths: [], fallback: 'blocking'}
}
@@ -153,6 +154,7 @@ type ActiveUserPageProps = {
export default function UserPage(props: UserPageProps) {
const nativeMobile = isNativeMobile()
const router = useRouter()
const t = useT()
const username = (nativeMobile ? router.query.username : props.username) as string
const [loading, setLoading] = useState(nativeMobile)
const fromSignup = router?.query?.fromSignup === 'true'
@@ -201,7 +203,7 @@ export default function UserPage(props: UserPageProps) {
console.error('Failed to fetch profile for native mobile', e)
setFetchedProps({
username,
notFoundCustomText: 'Failed to fetch profile.',
notFoundCustomText: t('userpage.failedToFetch', 'Failed to fetch profile.'),
})
}
setLoading(false)
@@ -231,7 +233,7 @@ export default function UserPage(props: UserPageProps) {
<PageBase trackPageView={'user page'} className={'relative p-2 sm:pt-0'}>
<Col className="items-center justify-center h-full">
<div className="text-xl font-semibold text-center mt-8">
This account has been deleted.
{t('userpage.accountDeleted', 'This account has been deleted.')}
</div>
</Col>
</PageBase>
@@ -243,7 +245,7 @@ export default function UserPage(props: UserPageProps) {
<PageBase trackPageView={'user page'} className={'relative p-2 sm:pt-0'}>
<Col className="items-center justify-center h-full">
<div className="text-xl font-semibold text-center mt-8">
This account has been suspended.
{t('userpage.accountSuspended', 'This account has been suspended.')}
</div>
</Col>
</PageBase>
@@ -255,7 +257,7 @@ export default function UserPage(props: UserPageProps) {
<PageBase trackPageView={'user page'} className={'relative p-2 sm:pt-0'}>
<Col className="items-center justify-center h-full">
<div className="text-xl font-semibold text-center mt-8">
This user hasn't created a profile yet.
{t('userpage.profileNotCreated', "This user hasn't created a profile yet.")}
</div>
</Col>
</PageBase>
@@ -269,6 +271,7 @@ function UserPageInner(props: ActiveUserPageProps) {
// debug('Starting UserPageInner in /[username]')
const {user, username} = props
const router = useRouter()
const t = useT()
const {query} = router
const fromSignup = query.fromSignup === 'true'
@@ -289,7 +292,7 @@ function UserPageInner(props: ActiveUserPageProps) {
<PageBase trackPageView={'user page'} className={'relative p-2 sm:pt-0'}>
<Col className="items-center justify-center h-full">
<div className="text-xl font-semibold text-center mt-8">
The user disabled their profile.
{t('userpage.profileDisabled', 'The user disabled their profile.')}
</div>
</Col>
</PageBase>