Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pistonite/celera",
"version": "0.1.2",
"version": "0.1.3",
"type": "module",
"private": true,
"description": "In-house UI framework",
Expand Down
13 changes: 11 additions & 2 deletions src/i18n/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ import type { TranslatorFn } from "./types.ts";
*
* This wraps `useTranslation` from `react-i18next`.
*/
export const useTranslation = (namespace?: string): TranslatorFn => {
const { t } = useTranslation_(namespace);
export const useTranslation = (
namespace?: string,
options?: UseTranslationOptions,
): TranslatorFn => {
const { t } = useTranslation_(namespace, options);
return t;
};

/** Partial options for `useTranslation` from `react-i18next` */
export interface UseTranslationOptions {
/** set to "default" to return empty string if not found */
nsMode?: "fallback" | "default";
}

/** The i18next instance */
export const i18next = i18next_;
/**
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export {
type LocaleOptions,
type LoadLanguageFn,
type TranslatorFn,
type UseTranslationOptions,
} from "#i18n";

export {
Expand Down
Loading