-
I wanted to make sure that a used key is set in for all language files. A solution I found is to use SharedUnionFieldsDeep from type-fest. Is there a recommended way to do this or is there there any reason not do this? // globals.ts
import type { SharedUnionFieldsDeep } from "type-fest";
import type germanMessages from "./messages/de.json";
import type messages from "./messages/en.json";
type Messages = SharedUnionFieldsDeep<typeof messages | typeof germanMessages>;
declare module "next-intl" {
interface AppConfig {
// ...
Messages: Messages;
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
amannn
May 16, 2025
Replies: 1 comment
-
That’s definitely a cool solution! If you don’t mind installing another dependency, I can also recommend i18n-check. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Robstei
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That’s definitely a cool solution! If you don’t mind installing another dependency, I can also recommend i18n-check.