Skip to content

Refactor: Move I18nContextValue type definition to central types directory #143

@O2sa

Description

@O2sa

Currently, the I18nContextValue type is defined directly within language-provider.tsx. To improve maintainability and follow our project's architectural pattern of separating logic from type definitions, we should move this to a dedicated types file.

Tasks

  • Create types/i18n.ts.
  • Move the following type definition from language-provider.ts to the new location:
export type I18nContextValue = {
  locale: Locale;
  setLocale: (l: Locale) => void;
  t: (key: string, params?: Record<string, string | number>) => string;
  dir: "ltr" | "rtl";
  locales: { value: Locale; label: string }[];
  ready: boolean;
};
  • Export the type from the new file.
  • Update the import statement in language-provider.ts and any other components consuming this type.
  • Make sure the app is running without problems.

Files Involved

  • Source: components/language-provider.tsx (verify path)
  • Destination: types/i18n.ts

Tip

🚀 Want to contribute?
Comment assign me to be automatically assigned to this issue via our GitHub Actions bot. Happy coding! ✨

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions