feat(i18n): add fr localization support (#902)

* feat: add fr support

* fix(i18n): ensure langs are sorted before being displayed.
This commit is contained in:
Dan Ditomaso
2025-10-21 19:42:56 -04:00
committed by GitHub
parent c3f073a380
commit 80c9306db3
4 changed files with 14 additions and 7 deletions
+6 -1
View File
@@ -50,6 +50,11 @@ function useLang() {
[i18n.language, i18n.changeLanguage, setLanguageInStorage],
);
const getSupportedLangs = useMemo(
() => supportedLanguages.toSorted((a, b) => a.name.localeCompare(b.name)),
[],
);
const compare = useCallback(
(a: string, b: string) => {
return collator.compare(a, b);
@@ -57,7 +62,7 @@ function useLang() {
[collator],
);
return { compare, set, currentLanguage };
return { compare, set, current: currentLanguage, getSupportedLangs };
}
export default useLang;