Rename extraMessages -> messageBundle
This commit is contained in:
@ -7,12 +7,12 @@ import {
|
|||||||
} from "./i18n";
|
} from "./i18n";
|
||||||
import { Reflect } from "tsafe/Reflect";
|
import { Reflect } from "tsafe/Reflect";
|
||||||
|
|
||||||
export function createUseI18n<ExtraMessageKey extends string = never>(extraMessages: {
|
export function createUseI18n<ExtraMessageKey extends string = never>(messageBundle: {
|
||||||
[languageTag: string]: { [key in ExtraMessageKey]: string };
|
[languageTag: string]: { [key in ExtraMessageKey]: string };
|
||||||
}) {
|
}) {
|
||||||
type I18n = GenericI18n<MessageKey | ExtraMessageKey>;
|
type I18n = GenericI18n<MessageKey | ExtraMessageKey>;
|
||||||
|
|
||||||
const { getI18n } = createGetI18n(extraMessages);
|
const { getI18n } = createGetI18n(messageBundle);
|
||||||
|
|
||||||
function useI18n(params: { kcContext: KcContextLike }): { i18n: I18n } {
|
function useI18n(params: { kcContext: KcContextLike }): { i18n: I18n } {
|
||||||
const { kcContext } = params;
|
const { kcContext } = params;
|
||||||
|
@ -7,12 +7,12 @@ import {
|
|||||||
} from "./i18n";
|
} from "./i18n";
|
||||||
import { Reflect } from "tsafe/Reflect";
|
import { Reflect } from "tsafe/Reflect";
|
||||||
|
|
||||||
export function createUseI18n<ExtraMessageKey extends string = never>(extraMessages: {
|
export function createUseI18n<ExtraMessageKey extends string = never>(messageBundle: {
|
||||||
[languageTag: string]: { [key in ExtraMessageKey]: string };
|
[languageTag: string]: { [key in ExtraMessageKey]: string };
|
||||||
}) {
|
}) {
|
||||||
type I18n = GenericI18n<MessageKey | ExtraMessageKey>;
|
type I18n = GenericI18n<MessageKey | ExtraMessageKey>;
|
||||||
|
|
||||||
const { getI18n } = createGetI18n(extraMessages);
|
const { getI18n } = createGetI18n(messageBundle);
|
||||||
|
|
||||||
function useI18n(params: { kcContext: KcContextLike }): { i18n: I18n } {
|
function useI18n(params: { kcContext: KcContextLike }): { i18n: I18n } {
|
||||||
const { kcContext } = params;
|
const { kcContext } = params;
|
||||||
|
Reference in New Issue
Block a user