Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 26, 2024
1 parent 87001f2 commit 8d4ae57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/useLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function setInitialLocale(locale: string) {
localeSignal.value = locale
}

export function useLocale() {
export function useLocale(): LocaleContextProps {
const context = useContext(LocaleContext)
return {
locale: localeSignal.value,
Expand Down
4 changes: 3 additions & 1 deletion src/useTranslation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useLocale } from './useLocale.ts'
import { useEffect, useState } from 'preact/hooks'

export function useTranslation(namespace: string) {
export function useTranslation(
namespace: string,
): { t: (key: string) => string } {
const { locale, loadNamespaceTranslations } = useLocale()
const [translations, setTranslations] = useState<Record<string, string>>({})

Expand Down

0 comments on commit 8d4ae57

Please sign in to comment.