Skip to content

Conversation

@Recxsmacx
Copy link

@Recxsmacx Recxsmacx commented Feb 22, 2025

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.

Summary by CodeRabbit

  • New Features

    • Enhanced multilingual support with dynamic translations for footer content, now available in English and German.
  • Refactor

    • Improved footer layout and spacing for a cleaner, more responsive user interface.
  • Chore

    • Updated translation configuration to include a new namespace for footer localization.
  • New Localization Files

    • Added footer localization files for English and German, providing necessary translations for various footer elements.
  • New Functions

    • Introduced a function for translating initiative links in the footer.

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`.
@netlify
Copy link

netlify bot commented Feb 22, 2025

Deploy Preview for asyncapi-website failed.

Built without sensitive environment variables

Name Link
🔨 Latest commit b6ba539
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67bf16aa0dbeae0008496fd5

@Recxsmacx Recxsmacx changed the title BUG : fix footer language not changing when language is changed fix: fix footer language not changing when language is changed Feb 22, 2025
@Recxsmacx
Copy link
Author

@anshgoyalevil @sambhavgupta0705 @devilkiller-ag @derberg @Mayaleeeee please review this one!

@Recxsmacx
Copy link
Author

image

this is the final output

Copy link
Member

@devilkiller-ag devilkiller-ag left a 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?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2025

Walkthrough

The pull request integrates internationalization into the Footer component. The Footer now accepts a new required prop (currentLanguage) defined by a freshly added interface. It uses the useTranslation hook from next-i18next for dynamic text rendering. Layout adjustments refine spacing and structure for sections such as initiative, news, and social media. The i18n configuration is updated to include a new 'footer' namespace, and new translation JSON files for English and German have been added. Additionally, the locale from the router is extracted and passed to Footer via the _app.tsx component.

Changes

File(s) Change Summary
components/footer/Footer.tsx Updated Footer component: added FooterProps interface with currentLanguage prop, integrated useTranslation, restructured layout, and replaced hardcoded texts with translation keys.
pages/_app.tsx Extracted locale from the router and passed it as the currentLanguage prop to the Footer component.
next-i18next.config.js Added a new 'footer' namespace to the configuration to support footer-specific internationalization.
public/locales/{en,de}/footer.json Introduced new translation files for English and German, containing localized strings for the footer section.
components/footer/FooterList.ts Added TranslatedInitiativeLinks function to translate initiative link labels using useTranslation.

Possibly related PRs

Suggested labels

ready-to-merge, autoupdate

Suggested reviewers

  • derberg
  • devilkiller-ag
  • anshgoyalevil
  • sambhavgupta0705
  • Mayaleeeee
  • asyncapi-bot-eve

Poem

I'm a bunny with a joyful hop,
Skipping through code without a stop.
Footer sings in every tongue aloud,
With translations making it proud.
Carrots and keys, in unity we bound! 🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Recxsmacx
Copy link
Author

@devilkiller-ag its solved now !

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 881a4c7 and 1d21455.

📒 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'⏎············ 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

[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

@Recxsmacx
Copy link
Author

@devilkiller-ag @anshgoyalevil @sambhavgupta0705 @vishvamsinh28 please review this one!

Copy link
Member

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

Copy link
Author

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

Copy link
Author

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 !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
about blog market finance faqs (they were not translated)

Copy link
Author

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?

@anshgoyalevil
Copy link
Member

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 issue

Remove unused import and define FooterProps interface properly.

The code has the following issues:

  1. The useRouter import is unused
  2. The FooterProps interface is missing
  3. Based on the feedback, the currentLanguage prop might be unnecessary as the t function 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 suggestion

Simplify component signature by removing unnecessary prop.

The currentLanguage prop is not used in the component and is unnecessary since the t function from next-i18next already 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 className props 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d21455 and 8bf2723.

📒 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'⏎············ 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

[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


17-108: Well-implemented internationalization!

The implementation of internationalization using the t function 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'⏎············ 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

[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

@Recxsmacx
Copy link
Author

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

okay !

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 suggestion

Fix 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-i18next import 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-i18next import should occur before import of ../icons/Github import/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

📥 Commits

Reviewing files that changed from the base of the PR and between 7e81ee1 and ec48eb1.

📒 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 t function from next-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'⏎············ 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

[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


16-92: LGTM! Well-implemented translations.

The translations are correctly implemented using the useTranslation hook and t function.

🧰 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 Recxsmacx closed this Feb 26, 2025
@Recxsmacx Recxsmacx reopened this Feb 26, 2025
@sambhavgupta0705
Copy link
Member

@Recxsmacx are proceeding with this or should we close this one

@Recxsmacx
Copy link
Author

@sambhavgupta0705 I'm in

@Recxsmacx Recxsmacx closed this Mar 5, 2025
@Recxsmacx Recxsmacx deleted the fix-footer-language branch March 5, 2025 06:54
@Recxsmacx Recxsmacx restored the fix-footer-language branch March 5, 2025 07:28
@Recxsmacx Recxsmacx reopened this Mar 5, 2025
@Recxsmacx Recxsmacx closed this Mar 5, 2025
@Recxsmacx Recxsmacx deleted the fix-footer-language branch March 5, 2025 07:29
@Recxsmacx Recxsmacx restored the fix-footer-language branch March 5, 2025 07:33
@Recxsmacx Recxsmacx reopened this Mar 5, 2025
@Recxsmacx Recxsmacx closed this Mar 5, 2025
@Recxsmacx Recxsmacx deleted the fix-footer-language branch March 5, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Footer section language not changing when language is changed

4 participants