Skip to content

feat(lab): complete EN translations for blog, docs and homepage#69

Merged
GMNAPI merged 12 commits into
masterfrom
feature/lab-i18n-en-translations
Mar 12, 2026
Merged

feat(lab): complete EN translations for blog, docs and homepage#69
GMNAPI merged 12 commits into
masterfrom
feature/lab-i18n-en-translations

Conversation

@GMNAPI

@GMNAPI GMNAPI commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add EN translations for all content: blog post, docs intro, and 3 architecture guides (Clean Architecture, Testing Strategy, i18n Patterns)
  • Add _category_.json EN override for sidebar label ("Architecture Guides")
  • Fix cross-plugin link in EN blog post (/docs/intro/en/docs/intro)
  • Add <Translate> to homepage components (buttons, tagline, feature cards) and register EN strings in code.json

Test plan

  • npx docusaurus start --locale en --port 3002 — home shows EN text
  • Navbar shows "Guides" (not "Guías"), locale dropdown visible
  • Blog post at /en/blog/bienvenida-al-blog-lab shows EN content
  • "Guides" link in blog post navigates to /en/docs/intro
  • Docs sidebar shows "Architecture Guides"
  • All 3 guides (Clean Architecture, Testing Strategy, i18n Patterns) show EN content
  • ES locale (localhost:3001) unaffected

@vercel

vercel Bot commented Mar 12, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

There is no GitHub account connected to this Vercel account.

@vercel

vercel Bot commented Mar 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
desenvolupadormaster Ready Ready Preview, Comment Mar 12, 2026 3:10pm

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the internationalization capabilities of the Lab documentation and blog by adding full English translations across various content types and UI elements. Concurrently, it refines the user experience of the portfolio application's skills section through a modular component redesign, making skill details more accessible and interactive. These changes collectively improve content reach and maintainability while ensuring the stability of new features through updated testing.

Highlights

  • English Translations Added: Comprehensive English translations have been introduced for the Docusaurus-based Lab blog, documentation (intro, Clean Architecture, Testing Strategy, i18n Patterns), and homepage components, ensuring multi-language support.
  • Docusaurus Configuration Updates: The Docusaurus configuration was updated to disable trailing slashes, enable the blog feature, and integrate blog links into the navigation bar and footer.
  • Refactored Skills Section in Portfolio: The 'Skills' section within the portfolio application has been refactored to utilize new SkillCard and SkillModal components, improving the display and detailed presentation of skill categories.
  • New Documentation Pages: Dedicated English documentation pages for 'Clean Architecture', 'Testing Strategy', and 'i18n Patterns' have been added to provide in-depth guides on these architectural topics.
  • Enhanced Test Coverage for Skills Components: New test files were added for the SkillCard and SkillModal components, and existing Skills tests were updated to ensure robust functionality and accessibility of the refactored skill display.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/lab/blog/2025-03-12-bienvenida-al-blog-lab.md
    • Added a new blog post titled 'Bienvenida al Blog de Lab' in Spanish.
  • apps/lab/blog/tags.yml
    • Updated blog tags, replacing generic entries with technology-specific tags like TypeScript, Next.js, DevOps, and Clean Architecture.
  • apps/lab/docs/intro.md
    • Modified internal links within the introduction document to use absolute paths for guides.
  • apps/lab/docusaurus.config.js
    • Configured Docusaurus to disable trailing slashes for cleaner URLs.
    • Enabled the blog feature and added its link to the navbar and footer navigation.
  • apps/lab/i18n/en/code.json
    • Added English translation strings for the homepage tagline, call-to-action buttons, and feature cards.
  • apps/lab/i18n/en/docusaurus-plugin-content-blog/2025-03-12-bienvenida-al-blog-lab.md
    • Added the English translation for the new blog post 'Welcome to the Lab Blog'.
  • apps/lab/i18n/en/docusaurus-plugin-content-blog/options.json
    • Updated the blog sidebar title to 'Recent articles' in English.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current.json
    • Updated English translation keys for the docs sidebar, changing 'Tutorial - Basics' to 'Architecture Guides' and adding a descriptive text.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current/guides/category.json
    • Added a new category configuration file for 'Architecture Guides' in English.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current/guides/clean-architecture.md
    • Added a new English documentation page detailing 'Clean Architecture in DevPortfolio'.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current/guides/i18n-patterns.md
    • Added a new English documentation page explaining 'i18n Patterns in DevPortfolio'.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current/guides/testing-strategy.md
    • Added a new English documentation page outlining the 'Testing Strategy in DevPortfolio'.
  • apps/lab/i18n/en/docusaurus-plugin-content-docs/current/intro.md
    • Added the English translation for the main documentation introduction page, 'Welcome to the Lab'.
  • apps/lab/i18n/en/docusaurus-theme-classic/footer.json
    • Updated English translations for footer link titles ('Content', 'Social') and labels ('Home', 'Guides', 'Projects', 'Contact').
  • apps/lab/i18n/en/docusaurus-theme-classic/navbar.json
    • Updated English translation for the navbar 'Guides' label.
  • apps/lab/src/components/HomepageFeatures/index.tsx
    • Modified homepage features to use the Translate component for titles and descriptions, enabling internationalization.
    • Integrated Link components for feature cards to provide navigation.
  • apps/lab/src/components/HomepageFeatures/styles.module.css
    • Added CSS styles for feature links to enhance hover effects and overall presentation.
  • apps/lab/src/pages/index.module.css
    • Added CSS to allow homepage buttons to wrap on smaller screens.
  • apps/lab/src/pages/index.tsx
    • Imported the Translate component for internationalization.
    • Updated the homepage tagline and buttons to use translated strings.
    • Adjusted layout properties for improved responsiveness.
  • apps/portfolio/messages/en.json
    • Added ARIA labels for skill category modals to improve accessibility.
  • apps/portfolio/messages/es.json
    • Added ARIA labels for skill category modals to improve accessibility.
  • apps/portfolio/package.json
    • Added a new script dev:lab to simplify starting the Docusaurus Lab application.
  • apps/portfolio/src/features/skills/Skills.tsx
    • Refactored the Skills component to delegate rendering to SkillCard and SkillModal components.
    • Implemented state management for selectedCategory to control modal visibility.
  • apps/portfolio/src/features/skills/components/SkillCard.tsx
    • Added a new SkillCard component to display a summary of a skill category with interactive hover effects.
  • apps/portfolio/src/features/skills/components/SkillModal.tsx
    • Added a new SkillModal component to present detailed information about a selected skill category.
  • apps/portfolio/src/shared/constants/skills.ts
    • Extended the SkillCategory interface to include a 'leadership' ID, expanding the range of definable skill types.
  • apps/portfolio/tests/features/skills/Skills.test.tsx
    • Updated tests for the Skills component to align with the new SkillCard and SkillModal structure, focusing on interaction and modal behavior.
  • apps/portfolio/tests/features/skills/components/SkillCard.test.tsx
    • Added new tests for the SkillCard component, covering rendering, interaction, and accessibility.
  • apps/portfolio/tests/features/skills/components/SkillModal.test.tsx
    • Added new tests for the SkillModal component, covering rendering, content display, and close interactions.
Activity
  • GMNAPI initiated this pull request to implement comprehensive English translations for the Docusaurus Lab site.
  • New documentation pages were created for 'Clean Architecture', 'Testing Strategy', and 'i18n Patterns', along with an English blog post.
  • The Docusaurus configuration was adjusted to support the new content and improve URL structure.
  • The 'Skills' component in the portfolio application underwent a significant refactoring, introducing dedicated SkillCard and SkillModal components for better user experience.
  • New unit tests were added for the SkillCard and SkillModal components, and existing tests for the Skills section were updated to reflect the architectural changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant step forward, successfully adding English translations across the lab's blog and documentation, and refactoring the portfolio's skills section into more modular and interactive components. The changes are well-structured and improve both internationalization and user experience. I've identified a few minor areas for improvement within the newly added documentation files to ensure the examples follow best practices for Docusaurus i18n and test mocking, enhancing maintainability and correctness.

- **Portfolio**: Next.js 15, React 19, Tailwind, Framer Motion
- **Lab**: Docusaurus 2.4 for documentation and this blog

Feel free to explore the [Guides](/en/docs/intro) for more structured documentation on architecture, i18n, and testing.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The link to the guides includes a hardcoded /en locale prefix. While this works, the recommended practice in Docusaurus is to use root-relative links (e.g., /docs/intro). Docusaurus's i18n system is designed to automatically prepend the correct locale prefix based on the current language context. Relying on this automatic behavior improves maintainability and makes the content more robust against future changes to URL structures or locale configurations.

Suggested change
Feel free to explore the [Guides](/en/docs/intro) for more structured documentation on architecture, i18n, and testing.
Feel free to explore the [Guides](/docs/intro) for more structured documentation on architecture, i18n, and testing.

Comment on lines +431 to +472
```typescript
// src/shared/components/layout/LocaleSwitcher.tsx
'use client';

import { useRouter, usePathname } from 'next/navigation';
import { useLocale } from 'next-intl';

export function LocaleSwitcher() {
const router = useRouter();
const pathname = usePathname();
const currentLocale = useLocale();

const switchLocale = (newLocale: string) => {
// Remove current locale prefix from pathname
const pathWithoutLocale = pathname.replace(`/${currentLocale}`, '');

// Add new locale prefix (except for default locale 'es')
const newPath = newLocale === 'es'
? pathWithoutLocale || '/'
: `/${newLocale}${pathWithoutLocale || ''}`;

router.push(newPath);
};

return (
<div className="flex gap-2">
<button
onClick={() => switchLocale('es')}
className={currentLocale === 'es' ? 'font-bold' : ''}
>
ES
</button>
<button
onClick={() => switchLocale('en')}
className={currentLocale === 'en' ? 'font-bold' : ''}
>
EN
</button>
</div>
);
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The documented example for the LocaleSwitcher component uses manual path manipulation to switch locales. This approach is fragile and not recommended. next-intl provides its own useRouter and usePathname hooks (from next-intl/client) that offer a much cleaner and more robust API for this purpose. Using router.replace(pathname, {locale: newLocale}) simplifies the logic, reduces the chance of errors, and correctly handles various routing scenarios, such as preserving search parameters.

// src/shared/components/layout/LocaleSwitcher.tsx
'use client';

import { usePathname, useRouter } from 'next-intl/client';
import { useLocale } from 'next-intl';

export function LocaleSwitcher() {
  const router = useRouter();
  const pathname = usePathname();
  const currentLocale = useLocale();

  const switchLocale = (newLocale: string) => {
    // Use the router to switch the locale, preserving the current path.
    router.replace(pathname, {locale: newLocale});
  };

  return (
    <div className="flex gap-2">
      <button
        onClick={() => switchLocale('es')}
        className={currentLocale === 'es' ? 'font-bold' : ''}
      >
        ES
      </button>
      <button
        onClick={() => switchLocale('en')}
        className={currentLocale === 'en' ? 'font-bold' : ''}
      >
        EN
      </button>
    </div>
  );
}

Comment on lines +520 to +527
vi.mock('framer-motion', () => ({
motion: {
div: 'div',
button: 'button',
section: 'section',
},
AnimatePresence: ({ children }: { children: React.ReactNode }) => children,
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The documented mock for framer-motion is incorrect. Assigning a string like 'div' to motion.div will cause React to throw an error during testing, as it expects a component function, not a string. The mock should provide a valid React component that renders the underlying DOM element and passes through its props.

Suggested change
vi.mock('framer-motion', () => ({
motion: {
div: 'div',
button: 'button',
section: 'section',
},
AnimatePresence: ({ children }: { children: React.ReactNode }) => children,
}));
vi.mock('framer-motion', () => ({
motion: {
div: (props) => <div {...props} />,
button: (props) => <button {...props} />,
section: (props) => <section {...props} />,
},
AnimatePresence: ({ children }: { children: React.ReactNode }) => <>{children}</>,
}));

@github-actions

Copy link
Copy Markdown

CI Pipeline passed! All checks completed successfully.

@github-actions

Copy link
Copy Markdown

CI Pipeline passed! All checks completed successfully.

@GMNAPI GMNAPI merged commit 4fc3b7d into master Mar 12, 2026
10 checks passed
@GMNAPI GMNAPI deleted the feature/lab-i18n-en-translations branch March 12, 2026 15:20
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.

2 participants