mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
refactor: add typeScript support to enforce valid translation keys (#6776)
This commit is contained in:
parent
5e3550fc14
commit
f7c3644342
8 changed files with 38 additions and 19 deletions
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
|
||||
import { useI18n } from "../i18n";
|
||||
import { TranslationKeys, useI18n } from "../i18n";
|
||||
|
||||
// Used for splitting i18nKey into tokens in Trans component
|
||||
// Example:
|
||||
|
@ -153,7 +153,7 @@ const Trans = ({
|
|||
children,
|
||||
...props
|
||||
}: {
|
||||
i18nKey: string;
|
||||
i18nKey: TranslationKeys;
|
||||
[key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
|
||||
}) => {
|
||||
const { t } = useI18n();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue