support for th_cn and tw in language format -> moving to the correct zh-Hans and Hant

This commit is contained in:
honzapatCZ 2025-06-06 17:27:03 +02:00
parent 0b49c447e0
commit d7b2844480

View File

@ -62,6 +62,11 @@ export function useLanguageFormat(){
const { i18n } = useTranslation(); const { i18n } = useTranslation();
return useCallback((language: string) => { return useCallback((language: string) => {
if(language.toLowerCase() == "zh_cn")
language = "zh-Hans";
else if (language.toLowerCase() == "zh_tw")
language = "zh-Hant";
return new Intl.DisplayNames(i18n.language, { return new Intl.DisplayNames(i18n.language, {
type: "language", type: "language",
style: "short", style: "short",