-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: fix footer language not changing when language is changed #3722
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
Conversation
Fixes #3720 Add language support to the footer section to address the issue of the footer text not changing when the language is switched. * **Footer Component (`components/footer/Footer.tsx`)** - Import `useTranslation` hook from `next-i18next`. - Use `useTranslation` hook to get the `t` function. - Replace hardcoded text with `t` function calls for translation. - Add `currentLanguage` prop to the `Footer` component. - Use `currentLanguage` prop to determine the language for translations. * **Next-i18next Configuration (`next-i18next.config.js`)** - Add `footer` to the `namespaces` array. * **App Component (`pages/_app.tsx`)** - Pass the current language as a prop to the `Footer` component. * **Translation Files** - Add English translations for the footer section in `public/locales/en/footer.json`. - Add German translations for the footer section in `public/locales/de/footer.json`.
❌ Deploy Preview for asyncapi-website failed.Built without sensitive environment variables
|
|
@anshgoyalevil @sambhavgupta0705 @devilkiller-ag @derberg @Mayaleeeee please review this one! |
devilkiller-ag
left a comment
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.
Hi @Recxsmacx, Can you check why the deploy preview is failing and fix it?
WalkthroughThe pull request integrates internationalization into the Footer component. The Footer now accepts a new required prop ( Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
@devilkiller-ag its solved now ! |
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
components/footer/Footer.tsx (1)
39-41: Fix Tailwind CSS class order.The class order in several elements needs to be fixed according to the Tailwind CSS convention.
-<Heading typeStyle={HeadingTypeStyle.smSemibold} className='text-white mb-2'> +<Heading typeStyle={HeadingTypeStyle.smSemibold} className='mb-2 text-white'>Also applies to: 57-59, 71-73, 90-92
🧰 Tools
🪛 GitHub Actions: PR testing - if Node project
[warning] 39-39: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
components/footer/Footer.tsx(2 hunks)next-i18next.config.js(1 hunks)pages/_app.tsx(2 hunks)public/locales/de/footer.json(1 hunks)public/locales/en/footer.json(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- public/locales/en/footer.json
- public/locales/de/footer.json
🧰 Additional context used
🪛 ESLint
components/footer/Footer.tsx
[error] 3-3: 'useRouter' is defined but never used.
(unused-imports/no-unused-imports)
[error] 3-3: 'useRouter' is defined but never used.
(no-unused-vars)
[error] 16-16: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u.
(unused-imports/no-unused-vars)
[error] 16-16: 'currentLanguage' is defined but never used.
(no-unused-vars)
[error] 77-77: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················
(prettier/prettier)
[error] 95-95: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 95-98: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank'
(prettier/prettier)
[error] 96-96: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 99-99: Insert ··
(prettier/prettier)
[error] 100-100: Insert ···
(prettier/prettier)
[error] 101-101: Insert ··
(prettier/prettier)
[error] 102-102: Insert ·
(prettier/prettier)
[error] 103-103: Replace ················/>·········· with ··············/>
(prettier/prettier)
[error] 103-103: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 104-104: Delete ······
(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
components/footer/Footer.tsx
[error] 1-1: Run autofix to sort these imports! simple-import-sort/imports
[error] 3-3: 'useRouter' is defined but never used. unused-imports/no-unused-imports
[error] 3-3: 'useRouter' is defined but never used. no-unused-vars
[warning] 16-16: Missing JSDoc comment. require-jsdoc
[error] 16-16: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u. unused-imports/no-unused-vars
[error] 16-16: 'currentLanguage' is defined but never used. no-unused-vars
[warning] 39-39: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 57-57: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 71-71: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 77-77: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎···················· prettier/prettier
[warning] 90-90: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 95-95: Trailing spaces not allowed. no-trailing-spaces
[error] 95-95: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank' prettier/prettier
[error] 96-96: Trailing spaces not allowed. no-trailing-spaces
[error] 99-99: Insert ·· prettier/prettier
[error] 100-100: Insert ··· prettier/prettier
[error] 101-101: Insert ·· prettier/prettier
[error] 102-102: Insert · prettier/prettier
[error] 103-103: Replace ················/>·········· with ··············/> prettier/prettier
[error] 103-103: Trailing spaces not allowed. no-trailing-spaces
[error] 104-104: Delete ······ prettier/prettier
🔇 Additional comments (3)
next-i18next.config.js (1)
5-5: LGTM! Configuration updated correctly for footer translations.The addition of the 'footer' namespace to the configuration is necessary for supporting the footer translations.
pages/_app.tsx (1)
21-21: LGTM! Language context properly integrated.The locale is correctly extracted from the router and passed to the Footer component, enabling language-aware rendering.
Also applies to: 40-40
components/footer/Footer.tsx (1)
16-109: LGTM! Footer internationalization implemented correctly.The implementation correctly uses the translation hook and keys to render the footer content in different languages. The component structure and styling are well-organized.
🧰 Tools
🪛 ESLint
[error] 16-16: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u.
(unused-imports/no-unused-vars)
[error] 16-16: 'currentLanguage' is defined but never used.
(no-unused-vars)
[error] 77-77: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················(prettier/prettier)
[error] 95-95: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 95-98: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'(prettier/prettier)
[error] 96-96: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 99-99: Insert
··(prettier/prettier)
[error] 100-100: Insert
···(prettier/prettier)
[error] 101-101: Insert
··(prettier/prettier)
[error] 102-102: Insert
·(prettier/prettier)
[error] 103-103: Replace
················/>··········with··············/>(prettier/prettier)
[error] 103-103: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 104-104: Delete
······(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
[warning] 16-16: Missing JSDoc comment. require-jsdoc
[error] 16-16: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u. unused-imports/no-unused-vars
[error] 16-16: 'currentLanguage' is defined but never used. no-unused-vars
[warning] 39-39: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 57-57: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 71-71: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 77-77: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················prettier/prettier
[warning] 90-90: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 95-95: Trailing spaces not allowed. no-trailing-spaces
[error] 95-95: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'prettier/prettier
[error] 96-96: Trailing spaces not allowed. no-trailing-spaces
[error] 99-99: Insert
··prettier/prettier
[error] 100-100: Insert
···prettier/prettier
[error] 101-101: Insert
··prettier/prettier
[error] 102-102: Insert
·prettier/prettier
[error] 103-103: Replace
················/>··········with··············/>prettier/prettier
[error] 103-103: Trailing spaces not allowed. no-trailing-spaces
[error] 104-104: Delete
······prettier/prettier
|
@devilkiller-ag @anshgoyalevil @sambhavgupta0705 @vishvamsinh28 please review this one! |
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.
why is there an inconsistency between jsons of en and de? Like de one has around 11 key value pairs while en has much lesser
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.
actually the translation is already applied in the en section by default but we have to apply the changes for the german language thats why the de has 5 translations extra! to change the links under the initiative section
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.
i can match the lines but they are of no use !
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.
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.
@anshgoyalevil should I match the lines?
|
Keeping this PR open, but since the issue linked to this PR is a duplicate of #3716, priority would be given to the author of that issue |
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.
Actionable comments posted: 0
♻️ Duplicate comments (2)
components/footer/Footer.tsx (2)
3-4:⚠️ Potential issueRemove unused import and define FooterProps interface properly.
The code has the following issues:
- The
useRouterimport is unused- The
FooterPropsinterface is missing- Based on the feedback, the
currentLanguageprop might be unnecessary as thetfunction already has access to the current locale-import { useRouter } from 'next/router'; import { useTranslation } from 'next-i18next'; +/** + * Props for the Footer component + * @interface FooterProps + */ +interface FooterProps { + currentLanguage: string | undefined; +}Also applies to: 12-14
🧰 Tools
🪛 ESLint
[error] 3-3: 'useRouter' is defined but never used.
(unused-imports/no-unused-imports)
[error] 3-3: 'useRouter' is defined but never used.
(no-unused-vars)
🪛 GitHub Actions: PR testing - if Node project
[error] 3-3: 'useRouter' is defined but never used. unused-imports/no-unused-imports
[error] 3-3: 'useRouter' is defined but never used. no-unused-vars
14-16: 🛠️ Refactor suggestionSimplify component signature by removing unnecessary prop.
The
currentLanguageprop is not used in the component and is unnecessary since thetfunction fromnext-i18nextalready has access to the current locale.-export default function Footer({ currentLanguage }: FooterProps) { +export default function Footer() { const { t } = useTranslation('footer');🧰 Tools
🪛 ESLint
[error] 14-14: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u.
(unused-imports/no-unused-vars)
[error] 14-14: 'currentLanguage' is defined but never used.
(no-unused-vars)
[error] 14-14: 'FooterProps' is not defined.
(no-undef)
🪛 GitHub Actions: PR testing - if Node project
[warning] 14-14: Missing JSDoc comment. require-jsdoc
[error] 14-14: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u. unused-imports/no-unused-vars
[error] 14-14: 'currentLanguage' is defined but never used. no-unused-vars
[error] 14-14: 'FooterProps' is not defined. no-undef
🧹 Nitpick comments (1)
components/footer/Footer.tsx (1)
37-39: Fix Tailwind CSS class ordering in headings.The
classNameprops in the heading components have invalid Tailwind CSS class ordering.- <Heading typeStyle={HeadingTypeStyle.smSemibold} className='text-white mb-2'> + <Heading typeStyle={HeadingTypeStyle.smSemibold} className='mb-2 text-white'>Apply similar fixes to the other headings at lines 55-57 and 69-71.
Also applies to: 55-57, 69-71
🧰 Tools
🪛 GitHub Actions: PR testing - if Node project
[warning] 37-37: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/footer/Footer.tsx(2 hunks)
🧰 Additional context used
🪛 ESLint
components/footer/Footer.tsx
[error] 3-3: 'useRouter' is defined but never used.
(unused-imports/no-unused-imports)
[error] 3-3: 'useRouter' is defined but never used.
(no-unused-vars)
[error] 12-14: Delete ⏎⏎
(prettier/prettier)
[error] 12-14: More than 1 blank line not allowed.
(no-multiple-empty-lines)
[error] 14-14: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u.
(unused-imports/no-unused-vars)
[error] 14-14: 'currentLanguage' is defined but never used.
(no-unused-vars)
[error] 14-14: 'FooterProps' is not defined.
(no-undef)
[error] 75-75: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················
(prettier/prettier)
[error] 93-93: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 93-96: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank'
(prettier/prettier)
[error] 94-94: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 97-97: Insert ··
(prettier/prettier)
[error] 98-98: Insert ···
(prettier/prettier)
[error] 99-99: Insert ··
(prettier/prettier)
[error] 100-100: Insert ·
(prettier/prettier)
[error] 101-101: Replace ················/>·········· with ··············/>
(prettier/prettier)
[error] 101-101: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 102-102: Delete ······
(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
components/footer/Footer.tsx
[error] 1-1: Run autofix to sort these imports! simple-import-sort/imports
[error] 3-3: 'useRouter' is defined but never used. unused-imports/no-unused-imports
[error] 3-3: 'useRouter' is defined but never used. no-unused-vars
[error] 12-12: Delete ⏎⏎ prettier/prettier
[error] 12-12: More than 1 blank line not allowed. no-multiple-empty-lines
[warning] 14-14: Missing JSDoc comment. require-jsdoc
[error] 14-14: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u. unused-imports/no-unused-vars
[error] 14-14: 'currentLanguage' is defined but never used. no-unused-vars
[error] 14-14: 'FooterProps' is not defined. no-undef
[warning] 37-37: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 55-55: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 69-69: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 75-75: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎···················· prettier/prettier
[warning] 88-88: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 93-93: Trailing spaces not allowed. no-trailing-spaces
[error] 93-93: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank' prettier/prettier
[error] 94-94: Trailing spaces not allowed. no-trailing-spaces
[error] 97-97: Insert ·· prettier/prettier
[error] 98-98: Insert ··· prettier/prettier
[error] 99-99: Insert ·· prettier/prettier
[error] 100-100: Insert · prettier/prettier
[error] 101-101: Replace ················/>·········· with ··············/> prettier/prettier
[error] 101-101: Trailing spaces not allowed. no-trailing-spaces
[error] 102-102: Delete ······ prettier/prettier
⏰ Context from checks skipped due to timeout of 180000ms (1)
- GitHub Check: Lighthouse CI
🔇 Additional comments (2)
components/footer/Footer.tsx (2)
93-102: Fix formatting in Netlify badge section.The Netlify badge section has inconsistent formatting and trailing spaces.
- <a - href='https://netlify.com' - target='_blank' - rel='noopener noreferrer'> - <img - src='https://www.netlify.com/img/global/badges/netlify-color-bg.svg' - className='h-6' - alt='Deploys by Netlify' - /> - </a> + <a + href='https://netlify.com' + target='_blank' + rel='noopener noreferrer' + > + <img + src='https://www.netlify.com/img/global/badges/netlify-color-bg.svg' + className='h-6' + alt='Deploys by Netlify' + /> + </a>🧰 Tools
🪛 ESLint
[error] 93-93: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 93-96: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'(prettier/prettier)
[error] 94-94: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 97-97: Insert
··(prettier/prettier)
[error] 98-98: Insert
···(prettier/prettier)
[error] 99-99: Insert
··(prettier/prettier)
[error] 100-100: Insert
·(prettier/prettier)
[error] 101-101: Replace
················/>··········with··············/>(prettier/prettier)
[error] 101-101: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 102-102: Delete
······(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
[error] 93-93: Trailing spaces not allowed. no-trailing-spaces
[error] 93-93: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'prettier/prettier
[error] 94-94: Trailing spaces not allowed. no-trailing-spaces
[error] 97-97: Insert
··prettier/prettier
[error] 98-98: Insert
···prettier/prettier
[error] 99-99: Insert
··prettier/prettier
[error] 100-100: Insert
·prettier/prettier
[error] 101-101: Replace
················/>··········with··············/>prettier/prettier
[error] 101-101: Trailing spaces not allowed. no-trailing-spaces
[error] 102-102: Delete
······prettier/prettier
17-108: Well-implemented internationalization!The implementation of internationalization using the
tfunction is thorough and consistent throughout the component. All text content is properly translated using translation keys.🧰 Tools
🪛 ESLint
[error] 75-75: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················(prettier/prettier)
[error] 93-93: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 93-96: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'(prettier/prettier)
[error] 94-94: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 97-97: Insert
··(prettier/prettier)
[error] 98-98: Insert
···(prettier/prettier)
[error] 99-99: Insert
··(prettier/prettier)
[error] 100-100: Insert
·(prettier/prettier)
[error] 101-101: Replace
················/>··········with··············/>(prettier/prettier)
[error] 101-101: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 102-102: Delete
······(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
[warning] 37-37: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 55-55: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 69-69: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 75-75: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················prettier/prettier
[warning] 88-88: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 93-93: Trailing spaces not allowed. no-trailing-spaces
[error] 93-93: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'prettier/prettier
[error] 94-94: Trailing spaces not allowed. no-trailing-spaces
[error] 97-97: Insert
··prettier/prettier
[error] 98-98: Insert
···prettier/prettier
[error] 99-99: Insert
··prettier/prettier
[error] 100-100: Insert
·prettier/prettier
[error] 101-101: Replace
················/>··········with··············/>prettier/prettier
[error] 101-101: Trailing spaces not allowed. no-trailing-spaces
[error] 102-102: Delete
······prettier/prettier
okay ! |
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.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
components/footer/FooterList.ts (1)
1-9: 🛠️ Refactor suggestionFix import ordering.
The imports need to be sorted according to the project's conventions.
Apply this diff to fix the import ordering:
import type React from 'react'; +import { useTranslation } from 'next-i18next'; import IconGithub from '../icons/Github'; import IconLinkedIn from '../icons/LinkedIn'; import IconSlack from '../icons/Slack'; import IconTwitch from '../icons/Twitch'; import IconTwitter from '../icons/Twitter'; import IconYoutubeGray from '../icons/YouTubeGray'; -import { useTranslation } from 'next-i18next';🧰 Tools
🪛 ESLint
[error] 1-9: Run autofix to sort these imports!
(simple-import-sort/imports)
[error] 9-9:
next-i18nextimport should occur before import of../icons/Github(import/order)
🪛 GitHub Actions: PR testing - if Node project
[error] 1-1: Run autofix to sort these imports! simple-import-sort/imports
[error] 9-9:
next-i18nextimport should occur before import of../icons/Githubimport/order
🧹 Nitpick comments (1)
components/footer/FooterList.ts (1)
78-85: Add JSDoc documentation for the new function.The new function needs proper documentation.
Add JSDoc documentation:
+/** + * Translates the initiative links using the current language. + * @returns {InitiativeLink[]} Array of initiative links with translated labels. + */ export function TranslatedInitiativeLinks() { const { t } = useTranslation('footer'); return initiativeLinks.map((link) => ({ ...link, label: t(link.label) })); }🧰 Tools
🪛 GitHub Actions: PR testing - if Node project
[warning] 78-78: Missing JSDoc comment. require-jsdoc
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/footer/Footer.tsx(2 hunks)components/footer/FooterList.ts(2 hunks)
🧰 Additional context used
🪛 ESLint
components/footer/FooterList.ts
[error] 1-9: Run autofix to sort these imports!
(simple-import-sort/imports)
[error] 9-9: next-i18next import should occur before import of ../icons/Github
(import/order)
components/footer/Footer.tsx
[error] 3-3: 'useRouter' is defined but never used.
(unused-imports/no-unused-imports)
[error] 3-3: 'useRouter' is defined but never used.
(no-unused-vars)
[error] 9-9: Expected 1 empty line after import statement not followed by another import.
(import/newline-after-import)
[error] 13-13: Import in body of module; reorder to top.
(import/first)
[error] 15-15: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u.
(unused-imports/no-unused-vars)
[error] 15-15: 'currentLanguage' is defined but never used.
(no-unused-vars)
[error] 76-76: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················
(prettier/prettier)
[error] 94-94: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 94-97: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank'
(prettier/prettier)
[error] 95-95: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 98-98: Insert ··
(prettier/prettier)
[error] 99-99: Insert ···
(prettier/prettier)
[error] 100-100: Insert ··
(prettier/prettier)
[error] 101-101: Insert ·
(prettier/prettier)
[error] 102-102: Replace ················/>·········· with ··············/>
(prettier/prettier)
[error] 102-102: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 103-103: Delete ······
(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
components/footer/FooterList.ts
[error] 1-1: Run autofix to sort these imports! simple-import-sort/imports
[error] 9-9: next-i18next import should occur before import of ../icons/Github import/order
[warning] 78-78: Missing JSDoc comment. require-jsdoc
components/footer/Footer.tsx
[error] 1-1: Run autofix to sort these imports! simple-import-sort/imports
[error] 3-3: 'useRouter' is defined but never used. unused-imports/no-unused-imports
[error] 3-3: 'useRouter' is defined but never used. no-unused-vars
[error] 9-9: Expected 1 empty line after import statement not followed by another import. import/newline-after-import
[error] 13-13: Import in body of module; reorder to top. import/first
[warning] 15-15: Missing JSDoc comment. require-jsdoc
[error] 15-15: 'currentLanguage' is defined but never used. Allowed unused args must match /^_/u. unused-imports/no-unused-vars
[error] 15-15: 'currentLanguage' is defined but never used. no-unused-vars
[warning] 38-38: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 56-56: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 70-70: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 76-76: Replace ·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white' with ⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎···················· prettier/prettier
[warning] 89-89: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 94-94: Trailing spaces not allowed. no-trailing-spaces
[error] 94-94: Replace ⏎············href='https://netlify.com'·⏎············target='_blank'⏎············ with href='https://netlify.com'·target='_blank' prettier/prettier
[error] 95-95: Trailing spaces not allowed. no-trailing-spaces
[error] 98-98: Insert ·· prettier/prettier
[error] 99-99: Insert ··· prettier/prettier
[error] 100-100: Insert ·· prettier/prettier
[error] 101-101: Insert · prettier/prettier
[error] 102-102: Replace ················/>·········· with ··············/> prettier/prettier
[error] 102-102: Trailing spaces not allowed. no-trailing-spaces
[error] 103-103: Delete ······ prettier/prettier
⏰ Context from checks skipped due to timeout of 180000ms (2)
- GitHub Check: Redirect rules - asyncapi-website
- GitHub Check: Header rules - asyncapi-website
🔇 Additional comments (3)
components/footer/FooterList.ts (1)
78-85: LGTM! Well-structured translation implementation.The function correctly translates initiative links using the
tfunction fromnext-i18next.🧰 Tools
🪛 GitHub Actions: PR testing - if Node project
[warning] 78-78: Missing JSDoc comment. require-jsdoc
components/footer/Footer.tsx (2)
94-104: Fix formatting in Netlify badge section.🧰 Tools
🪛 ESLint
[error] 94-94: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 94-97: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'(prettier/prettier)
[error] 95-95: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 98-98: Insert
··(prettier/prettier)
[error] 99-99: Insert
···(prettier/prettier)
[error] 100-100: Insert
··(prettier/prettier)
[error] 101-101: Insert
·(prettier/prettier)
[error] 102-102: Replace
················/>··········with··············/>(prettier/prettier)
[error] 102-102: Trailing spaces not allowed.
(no-trailing-spaces)
[error] 103-103: Delete
······(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
[error] 94-94: Trailing spaces not allowed. no-trailing-spaces
[error] 94-94: Replace
⏎············href='https://netlify.com'·⏎············target='_blank'⏎············withhref='https://netlify.com'·target='_blank'prettier/prettier
[error] 95-95: Trailing spaces not allowed. no-trailing-spaces
[error] 98-98: Insert
··prettier/prettier
[error] 99-99: Insert
···prettier/prettier
[error] 100-100: Insert
··prettier/prettier
[error] 101-101: Insert
·prettier/prettier
[error] 102-102: Replace
················/>··········with··············/>prettier/prettier
[error] 102-102: Trailing spaces not allowed. no-trailing-spaces
[error] 103-103: Delete
······prettier/prettier
16-92: LGTM! Well-implemented translations.The translations are correctly implemented using the
useTranslationhook andtfunction.🧰 Tools
🪛 ESLint
[error] 76-76: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················(prettier/prettier)
🪛 GitHub Actions: PR testing - if Node project
[warning] 38-38: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 56-56: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[warning] 70-70: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
[error] 76-76: Replace
·href={link.url}·target='_blank'·rel='noopener·noreferrer'·className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'with⏎······················href={link.url}⏎······················target='_blank'⏎······················rel='noopener·noreferrer'⏎······················className='flex·items-center·gap-2·text-cool-gray·transition·hover:text-white'⏎····················prettier/prettier
[warning] 89-89: Invalid Tailwind CSS classnames order tailwindcss/classnames-order
|
@Recxsmacx are proceeding with this or should we close this one |
|
@sambhavgupta0705 I'm in |


Fixes #3720
Add language support to the footer section to address the issue of the footer text not changing when the language is switched.
Footer Component (
components/footer/Footer.tsx)useTranslationhook fromnext-i18next.useTranslationhook to get thetfunction.tfunction calls for translation.currentLanguageprop to theFootercomponent.currentLanguageprop to determine the language for translations.Next-i18next Configuration (
next-i18next.config.js)footerto thenamespacesarray.App Component (
pages/_app.tsx)Footercomponent.Translation Files
public/locales/en/footer.json.public/locales/de/footer.json.Summary by CodeRabbit
New Features
Refactor
Chore
New Localization Files
New Functions