Skip to content
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

feat: Apply i18n codemods #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codemod[bot]
Copy link

@codemod codemod bot commented Dec 6, 2024

This PR applies i18n codemods

Summary by Sourcery

Apply i18n codemods to refactor text content across the codebase, enabling internationalization support by integrating translation functions and keys.

New Features:

  • Introduce i18n support across multiple components and pages by integrating translation functions.

Enhancements:

  • Refactor existing text content to use translation keys and functions for internationalization.

Copy link

sourcery-ai bot commented Dec 6, 2024

Reviewer's Guide by Sourcery

This PR implements internationalization (i18n) codemods across multiple components and templates. The changes involve extracting hardcoded text strings into translation keys and adding corresponding translation files in JSON format. The implementation uses the useTranslation hook from i18next and introduces locale-specific JSON files containing the translations.

Class diagram for i18n implementation

classDiagram
    class TeamInviteEmail {
        +useTranslation()
        +getTypeOfInvite(props)
        +getHeading()
    }
    class OrganizationCreationEmail {
        +useTranslation()
    }
    class OAuthClientCard {
        +useTranslation()
    }
    class AppForm {
        +useTranslation()
    }
    class Bookings {
        +useTranslation()
    }
    class BrokenVideoIntegration {
        +useTranslation()
    }
    class SlugReplacementEmail {
        +useTranslation()
    }
    class OrganizationAdminNoSlotsEmail {
        +useTranslation()
    }
    class AdminOrganizationNotificationEmail {
        +useTranslation()
    }
    class Navbar {
        +useTranslation()
    }
    class OAuthClientForm {
        +useTranslation()
    }
    class Verify {
        +useTranslation()
    }
    class LockStatusTable {
        +useTranslation()
    }
    class Index {
        +useTranslation()
    }
    class EventTypesStepCard {
        +useTranslation()
    }
    class NoPlatformPlan {
        +useTranslation()
    }
    class MaintenancePage {
        +useTranslation()
    }
    class Bookings {
        +useTranslation()
    }
    class Authorize {
        +useTranslation()
    }
    class BookingConfirmationForm {
        +useTranslation()
    }
    class ManagedUserHeader {
        +useTranslation()
    }
    class OAuthClientsList {
        +useTranslation()
    }
    class LockedSMSView {
        +useTranslation()
    }
    class PlatformBillingUpgrade {
        +useTranslation()
    }
    class EditOAuthClient {
        +useTranslation()
    }
    class PlatformPlans {
        +useTranslation()
    }
    class Signup {
        +useTranslation()
    }
    class MoveTeamToOrg {
        +useTranslation()
    }
    class DeleteForm {
        +useTranslation()
    }
    class DailyVideoDownloadRecordingEmail {
        +useTranslation()
    }
    class Home {
        +useTranslation()
    }
    class ToolbarPlugin {
        +useTranslation()
    }
    class PremiumTextfield {
        +useTranslation()
    }
    class SingleAppPage {
        +useTranslation()
    }
    class RerouteDialog {
        +useTranslation()
    }
    class ManagedUserTable {
        +useTranslation()
    }
    class ConnectAndJoin {
        +useTranslation()
    }
    class InfiniteEventTypeList {
        +useTranslation()
    }
    class Platform {
        +useTranslation()
    }
    class Custom404 {
        +useTranslation()
    }
    class Error500 {
        +useTranslation()
    }
    class IconsPage {
        +useTranslation()
    }
    class RemoveTeamFromOrg {
        +useTranslation()
    }
    class RemoveUserFromOrg {
        +useTranslation()
    }
    class DialogComponent {
        +useTranslation()
    }
    class RefundInformation {
        +useTranslation()
    }
    class Embed {
        +useTranslation()
    }
    class Page {
        +useTranslation()
    }
    class AppPage {
        +useTranslation()
    }
    class MinutesField {
        +useTranslation()
    }
    class OAuthView {
        +useTranslation()
    }
    class EditOAuthClientWebhooks {
        +useTranslation()
    }
    class MeetingUnavailable {
        +useTranslation()
    }
    class NotFound {
        +useTranslation()
    }
    class Page {
        +useTranslation()
    }
    class AppListCard {
        +useTranslation()
    }
    class AppCard {
        +useTranslation()
    }
    class ErrorBoundary {
        +useTranslation()
    }
Loading

File-Level Changes

Change Details Files
Added i18n support to email templates
  • Added useTranslation hook and replaced hardcoded strings with translation keys
  • Created translation JSON files for email templates
  • Implemented Trans components for complex text with variables and HTML elements
packages/emails/src/templates/TeamInviteEmail.tsx
packages/emails/src/templates/OrganizationCreationEmail.tsx
packages/emails/src/templates/BrokenIntegrationEmail.tsx
packages/emails/src/templates/SlugReplacementEmail.tsx
packages/emails/src/templates/locales/en.json
Internationalized platform and web components
  • Added useTranslation hook to React components
  • Replaced static text with translation keys
  • Created locale-specific JSON files for components
apps/web/components/settings/platform/oauth-clients/OAuthClientCard.tsx
apps/web/components/settings/platform/dashboard/NoPlatformPlan.tsx
apps/web/components/settings/platform/dashboard/managed-user-header/index.tsx
apps/web/components/settings/platform/locales/en.json
apps/web/components/settings/platform/dashboard/locales/en.json
Added i18n support to example apps and platform components
  • Implemented translations in example apps
  • Created translation files for platform components
  • Added useTranslation hook to platform components
packages/platform/examples/base/src/pages/[bookingUid].tsx
packages/platform/examples/base/src/pages/index.tsx
packages/platform/examples/base/src/pages/locales/en.json
example-apps/credential-sync/pages/index.tsx
example-apps/credential-sync/pages/locales/en.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. It seems to have been created by a bot (hey, codemod[bot]!). We assume it knows what it's doing!

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.

0 participants