-
Notifications
You must be signed in to change notification settings - Fork 6
feat: localize core pages #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/modernize_tooling
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements internationalization (i18n) support for the core pages of the Session website using next-intl, enabling multi-language support across the site. The change introduces a comprehensive localization system with support for 16 languages including English, German, French, Spanish, and more.
- Adds next-intl integration with locale-specific routing and content
- Replaces hardcoded strings with translation keys across components and pages
- Implements language selection dialog with proper ARIA accessibility
Reviewed Changes
Copilot reviewed 54 out of 58 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
pages/*.tsx | Updates all core pages to support localization with getStaticProps and locale keys |
pages/api/sitemap.ts | Enhanced sitemap generation with multilingual URL structure and hreflang support |
pages/_app.tsx | Integrates NextIntlClientProvider for i18n context |
pages/_document.tsx | Adds RTL language direction detection |
locales/*.json | Translation files for 16 supported languages |
components/ui/Layout.tsx | Updates Layout component to accept localeKey prop |
components/sections/*.tsx | Replaces hardcoded text with translation hooks |
components/navigation/*.tsx | Implements localized navigation with language picker |
constants/* | Updates navigation and metadata constants for i18n compatibility |
package.json | Adds next-intl and related dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
<div className={classNames(noteContainerClasses, 'pb-12', 'lg:pb-0')}> | ||
<p className={classNames(notesClasses)}> | ||
Verify Signatures: | ||
{t('verifySignatures', { platforms: '' })} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platforms
parameter is passed as an empty string but the translation keys suggest this should contain platform-specific information. This will result in incomplete text like 'Verify Signatures: ' instead of 'Verify Signatures: Android, iOS'.
{t('verifySignatures', { platforms: '' })} | |
{t('verifySignatures', { platforms: 'Android, iOS' })} |
Copilot uses AI. Check for mistakes.
</p> | ||
<p className={classNames(notesClasses)}> | ||
Release Notes: | ||
{t('releaseNotes', { platforms: '' })} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platforms
parameter is passed as an empty string but the translation keys suggest this should contain platform-specific information. This will result in incomplete text like 'Verify Signatures: ' instead of 'Verify Signatures: Android, iOS'.
{t('releaseNotes', { platforms: '' })} | |
{t('releaseNotes', { platforms: 'Android, iOS' })} |
Copilot uses AI. Check for mistakes.
<div className={classNames(noteContainerClasses, 'md:pb-16', 'lg:pb-0')}> | ||
<p className={classNames(notesClasses)}> | ||
Verify Signatures: | ||
{t('verifySignatures', { platforms: '' })} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platforms
parameter is passed as an empty string but the translation keys suggest this should contain platform-specific information. This will result in incomplete text like 'Verify Signatures: ' instead of 'Verify Signatures: Android, iOS'.
{t('verifySignatures', { platforms: '' })} | |
{t('verifySignatures', { platforms: 'Desktop' })} |
Copilot uses AI. Check for mistakes.
</p> | ||
<p className={classNames(notesClasses)}> | ||
Release Notes: | ||
{t('releaseNotes', { platforms: '' })} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The platforms
parameter is passed as an empty string but the translation keys suggest this should contain platform-specific information. This will result in incomplete text like 'Verify Signatures: ' instead of 'Verify Signatures: Android, iOS'.
{t('releaseNotes', { platforms: '' })} | |
{t('releaseNotes', { platforms: _tGeneral('desktop') })} |
Copilot uses AI. Check for mistakes.
"hero": { | ||
"heading": "Send <glitch>Messages,</glitch> Not Metadata.", | ||
"tag": "Find your freedom with {appName}", | ||
"glitchTextGlitch": "Encrypted" |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The English locale file contains HTML-like tags () but other locale files use a different format with 'format' and separate 'glitchTextPrimary'/'glitchTextGlitch' keys. This inconsistency could cause rendering issues in the English version.
"glitchTextGlitch": "Encrypted" | |
"format": "Send {glitchTextPrimary} {glitchTextGlitch} Not Metadata.", | |
"glitchTextPrimary": "Messages,", | |
"glitchTextGlitch": "Encrypted", | |
"tag": "Find your freedom with {appName}" |
Copilot uses AI. Check for mistakes.
"appSupport": "crwdns38066:0{appName}crwdne38066:0", | ||
"socials": "crwdns38068:0crwdne38068:0", | ||
"aria": { | ||
"socialLink": "crwdns38070:0{appName}crwdnd38070:0{platform}crwdne38070:0", |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Crowdin placeholder format uses 'crwdnd' as a delimiter between parameters, but this appears to be a typo - it should likely be 'crwdne' to match the pattern used elsewhere in the file.
"socialLink": "crwdns38070:0{appName}crwdnd38070:0{platform}crwdne38070:0", | |
"socialLink": "crwdns38070:0{appName}crwdne38070:0{platform}crwdne38070:0", |
Copilot uses AI. Check for mistakes.
|
||
const redirects: IRedirection[] = await config.redirects(); | ||
const locales: Array<string> = config.i18n.locales; | ||
const defaultLocale: string = config.i18n.defaultLocale; |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top-level await is used outside of an async function context. This will cause a syntax error. These declarations should be moved inside the async handler function.
const defaultLocale: string = config.i18n.defaultLocale; |
Copilot uses AI. Check for mistakes.
} catch { | ||
return locale.toUpperCase(); | ||
} | ||
} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The of()
method can return undefined for invalid locale codes, but the function signature doesn't account for this. The return should be explicitly typed to handle the undefined case or provide a fallback.
} | |
function getLanguageDisplayName(locale: string): string { | |
try { | |
const displayName = new Intl.DisplayNames([locale], { type: 'language' }).of(locale); | |
return displayName ?? locale.toUpperCase(); | |
} catch { | |
return locale.toUpperCase(); | |
} |
Copilot uses AI. Check for mistakes.
No description provided.