feat: i18n (i18next + react-i18next) zh/en + hydration fixes
- i18next + react-i18next: zh/en locales, language detection (localStorage > navigator > zh), settings language switcher - Components i18n'd: Navbar, Feed, NewPost, Modals, SettingsPage, SettingsProfile, AccountSecurity, RecoveryCodes - Fix hydration mismatch (spinner restart): forum name via cookie (Server Component reads cookie, SSR outputs name, no inline script DOM injection); remove createPortal in RecoveryCodes modal; i18n sync init (initImmediate) so SSR/CSR text matches - LoadingScreen: React-state name rendering (no script-injected nodes) - Fix double spinner in Feed; DM icon emoji → SVG in ConversationList
This commit is contained in:
1 parent
82bc2eb885
commit
0562dd735a
20 files changed
+599
-168
No files matched your search
+154
@@ -0,0 +1,154 @@
|
||||
{
|
||||
"appName": "Forumlify",
|
||||
"nav": {
|
||||
"home": "Home",
|
||||
"messages": "Messages",
|
||||
"settings": "Settings",
|
||||
"admin": "Admin",
|
||||
"login": "Login",
|
||||
"register": "Register",
|
||||
"logout": "Logout",
|
||||
"darkMode": "Dark mode",
|
||||
"lightMode": "Light mode",
|
||||
"logoutConfirm": "Are you sure you want to log out?"
|
||||
},
|
||||
"feed": {
|
||||
"latest": "Latest posts",
|
||||
"hot": "Latest replies",
|
||||
"newPost": "New post",
|
||||
"loading": "Loading...",
|
||||
"empty": "✨ No posts yet — be the first to publish!",
|
||||
"pinned": "📌 Pinned",
|
||||
"deleted": "(edited)",
|
||||
"report": "Report",
|
||||
"delete": "Delete",
|
||||
"confirmDelete": "Are you sure you want to delete this post?",
|
||||
"deleteFailed": "Delete failed: {{msg}}",
|
||||
"noTitle": "Untitled",
|
||||
"anonymous": "Anonymous"
|
||||
},
|
||||
"post": {
|
||||
"title": "Post detail",
|
||||
"back": "← Back",
|
||||
"edit": "Edit",
|
||||
"save": "Save",
|
||||
"cancel": "Cancel",
|
||||
"editFailed": "Load failed: {{msg}}",
|
||||
"contentRequired": "Please fill in the content",
|
||||
"reply": "Reply",
|
||||
"replyCount": "{{count}} replies",
|
||||
"reportReason": "Report reason",
|
||||
"confirmDelete": "Are you sure you want to delete this post?",
|
||||
"reportTitle": "Report post",
|
||||
"submitReport": "Submit report"
|
||||
},
|
||||
"newPost": {
|
||||
"title": "Title",
|
||||
"content": "Say something...",
|
||||
"publish": "Publish post",
|
||||
"uploading": "Uploading...",
|
||||
"pleaseLogin": "Please log in first",
|
||||
"captchaError": "Wrong captcha, please try again",
|
||||
"publishSuccess": "Post published",
|
||||
"publishFailed": "Publish failed: {{msg}}",
|
||||
"answer": "Answer",
|
||||
"captchaLoading": "Loading captcha...",
|
||||
"drop": "Release to upload",
|
||||
"dropHint": "Click or drag to upload image"
|
||||
},
|
||||
"reply": {
|
||||
"submit": "Submit reply",
|
||||
"placeholder": "Write your reply...",
|
||||
"empty": "No replies yet — be the first to comment 🛋️",
|
||||
"replyFailed": "Reply failed: {{msg}}",
|
||||
"delete": "Delete",
|
||||
"confirmDelete": "Are you sure you want to delete this reply?",
|
||||
"deleteFailed": "Delete failed: {{msg}}"
|
||||
},
|
||||
"auth": {
|
||||
"email": "Email",
|
||||
"password": "Password",
|
||||
"username": "Username",
|
||||
"passwordHint": "Password (min 6 chars)",
|
||||
"forgotPassword": "Forgot password?",
|
||||
"captchaError": "Wrong captcha, please try again",
|
||||
"registerSuccess": "🎉 Registration successful",
|
||||
"loginSuccess": "Logged in",
|
||||
"logoutSuccess": "Logged out",
|
||||
"login": "Login",
|
||||
"register": "Register"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"profile": "Profile",
|
||||
"security": "Security",
|
||||
"recovery": "Recovery codes",
|
||||
"language": "Language",
|
||||
"languageZh": "中文",
|
||||
"languageEn": "English",
|
||||
"username": "Username",
|
||||
"bio": "Bio",
|
||||
"signature": "Signature",
|
||||
"save": "Save settings",
|
||||
"saved": "Saved!",
|
||||
"saveFailed": "Save failed: {{msg}}",
|
||||
"usernameRequired": "Username cannot be empty",
|
||||
"pleaseLogin": "Please log in first"
|
||||
},
|
||||
"user": {
|
||||
"title": "User profile",
|
||||
"bioEmpty": "This user hasn't written a bio yet",
|
||||
"sendMessage": "Send message",
|
||||
"joined": "📅 Joined {{date}}",
|
||||
"posts": "📝 {{count}} posts",
|
||||
"admin": "🛡️ Admin",
|
||||
"noPosts": "No posts yet",
|
||||
"notFound": "User not found",
|
||||
"loading": "Loading..."
|
||||
},
|
||||
"stats": {
|
||||
"topics": "Topics",
|
||||
"posts": "Posts",
|
||||
"users": "Users",
|
||||
"links": "Links"
|
||||
},
|
||||
"loading": "Loading...",
|
||||
"common": {
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"close": "Close"
|
||||
},
|
||||
"report": {
|
||||
"spam": "Spam",
|
||||
"abuse": "Harassment",
|
||||
"illegal": "Illegal content",
|
||||
"nsfw": "Inappropriate content",
|
||||
"other": "Other"
|
||||
},
|
||||
"security": {
|
||||
"title": "Account security",
|
||||
"currentPw": "Current password",
|
||||
"newPw": "New password",
|
||||
"changePw": "Change password",
|
||||
"currentPwVerify": "Current password (verify identity)",
|
||||
"newEmail": "New email",
|
||||
"changeEmail": "Change email",
|
||||
"fillAll": "Please fill in all fields",
|
||||
"pwMin": "New password must be at least 6 characters",
|
||||
"pwChanged": "✅ Password changed",
|
||||
"emailChanged": "✅ Email changed"
|
||||
},
|
||||
"recovery": {
|
||||
"title": "Recovery codes",
|
||||
"desc": "Use these to reset your account if you forget your password. Each code works once.",
|
||||
"view": "View recovery codes",
|
||||
"regenerate": "Regenerate",
|
||||
"remaining": "{{count}} recovery codes remaining",
|
||||
"confirmRegenerate": "Regenerating will invalidate all old codes. Continue?",
|
||||
"genFailed": "Generation failed: {{msg}}",
|
||||
"fetchFailed": "Fetch failed: {{msg}}",
|
||||
"newCodes": "🆕 New recovery codes",
|
||||
"saveWarning": "⚠️ Save these codes now — they cannot be viewed again after closing.",
|
||||
"saved": "I have saved them"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user