- Rewrite @plane/i18n package with type-safe t() function - Generate TypeScript types from English translation JSON - Fix ICU plural format parsing in type generator - Add 'as const' assertions to i18n fields in constants - Create AST-based check:i18n script for each app - Add turbo task for parallel i18n validation - Convert translation files from TS to JSON format - Rename locale directories (ua→uk, vi-VN→vi, tr-TR→tr) - Add missing translation keys and fix key mismatches - Export KeysWithoutParams type for dynamic key handling Scripts: - pnpm check:i18n (per app) - AST-based missing key detection - pnpm i18n:validate - Cross-locale validation - pnpm i18n:generate-types - Generate TS types from JSON All apps pass type checking with 0 errors.
25 lines
690 B
TypeScript
25 lines
690 B
TypeScript
import React from "react";
|
|
// plane package imports
|
|
import { useTranslation } from "@plane/i18n";
|
|
import type {KeysWithoutParams, PrefixedKeyWithoutParams} from "@plane/i18n";
|
|
import { cn } from "@plane/utils";
|
|
|
|
type Props = {
|
|
i18nTitle: KeysWithoutParams<"translation"> | PrefixedKeyWithoutParams;
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
};
|
|
|
|
function AnalyticsWrapper(props: Props) {
|
|
const { i18nTitle, children, className } = props;
|
|
const { t } = useTranslation();
|
|
return (
|
|
<div className={cn("px-6 py-4", className)}>
|
|
<h1 className={"mb-4 text-20 font-bold md:mb-6"}>{t(i18nTitle)}</h1>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default AnalyticsWrapper;
|