33import React , { memo , forwardRef , useId } from "react" ;
44import { fr } from "./fr" ;
55import { symToStr } from "tsafe/symToStr" ;
6- import { createComponentI18nApi } from "./i18n/i18n" ;
6+ import { createComponentI18nApi } from "./i18n/createComponentI18nApi" ;
7+ import { useLang } from "./i18n/useLang" ;
78import { cx } from "./tools/cx" ;
89import type { Equals } from "tsafe" ;
910import { assert } from "tsafe/assert" ;
@@ -30,7 +31,7 @@ export const headerFooterDisplayItem: HeaderProps.QuickAccessItem.Button &
3031 "iconId" : "fr-icon-theme-fill" ,
3132 "text" : ( ( ) => {
3233 function Text ( ) {
33- const { t } = useTranslation ( ) ;
34+ const { t } = getTranslation ( useLang ( ) ) ;
3435 return < > { t ( "display settings" ) } </ > ;
3536 }
3637
@@ -45,7 +46,7 @@ export const Display = memo(
4546
4647 assert < Equals < keyof typeof rest , never > > ( ) ;
4748
48- const { t } = useTranslation ( ) ;
49+ const { t } = getTranslation ( useLang ( ) ) ;
4950
5051 return (
5152 < dialog
@@ -114,7 +115,7 @@ const RadioGroup = memo((props: { theme: "dark" | "light" | "system" }) => {
114115
115116 const inputId = useId ( ) ;
116117
117- const { t } = useTranslation ( ) ;
118+ const { t } = getTranslation ( useLang ( ) ) ;
118119
119120 const pictogramUrl = getAssetUrl (
120121 ( ( ) => {
@@ -163,7 +164,7 @@ const RadioGroup = memo((props: { theme: "dark" | "light" | "system" }) => {
163164
164165RadioGroup . displayName = symToStr ( { RadioGroup } ) ;
165166
166- const { useTranslation , addDisplayTranslations } = createComponentI18nApi ( {
167+ const { getTranslation , addDisplayTranslations } = createComponentI18nApi ( {
167168 "componentName" : symToStr ( { Display } ) ,
168169 "frMessages" : {
169170 /* spell-checker: disable */
0 commit comments