format code

This commit is contained in:
expload 2024-05-13 09:30:40 +00:00
parent 311ca1c990
commit ec5e28ba9f
4 changed files with 17 additions and 3 deletions

View file

@ -11,4 +11,4 @@ export { default as tr } from "./tr/translation.json";
export { default as be } from "./be/translation.json";
export { default as uk } from "./uk/translation.json";
export { default as zh } from "./zh/translation.json";
export { default as id } from "./id/translation.json";
export { default as id } from "./id/translation.json";

View file

@ -6,7 +6,7 @@
"surprise_me": "向我推荐",
"no_results": "没有找到结果"
},
"sidebar": {
"sidebar": {
"catalogue": "游戏目录",
"downloads": "下载中心",
"settings": "设置",

View file

@ -25,6 +25,7 @@ export const getSteamLanguage = (language: string) => {
if (language.startsWith("it")) return "italian";
if (language.startsWith("hu")) return "hungarian";
if (language.startsWith("pl")) return "polish";
if (language.startsWith("zh")) return "chinese";
return "english";
};

View file

@ -1,6 +1,18 @@
import { formatDistance } from "date-fns";
import type { FormatDistanceOptions } from "date-fns";
import { ptBR, enUS, es, fr, pl, hu, tr, ru, it, be } from "date-fns/locale";
import {
ptBR,
enUS,
es,
fr,
pl,
hu,
tr,
ru,
it,
be,
zhCN,
} from "date-fns/locale";
import { useTranslation } from "react-i18next";
export function useDate() {
@ -18,6 +30,7 @@ export function useDate() {
if (language.startsWith("ru")) return ru;
if (language.startsWith("it")) return it;
if (language.startsWith("be")) return be;
if (language.startsWith("zh")) return zhCN;
return enUS;
};