Skip to content

Commit

Permalink
Update gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
chehsunliu committed Oct 24, 2024
1 parent fbcca77 commit 56c4f53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
9 changes: 3 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CWYKM2QQT5"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q3BTR9RJBB"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-CWYKM2QQT5", {
gtag("config", "G-Q3BTR9RJBB", {
send_page_view: false,
});
</script>
Expand All @@ -18,10 +18,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="支援軒轅劍和仙劍奇俠傳部份作品存檔修改,不須安裝且不含伺服器,純瀏覽器上的靜態網頁操作。"
/>
<meta name="description" content="支援軒轅劍和仙劍奇俠傳部份作品存檔修改,純瀏覽器上的靜態網頁操作。" />
<title>Retro</title>
</head>
<body>
Expand Down
8 changes: 1 addition & 7 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import i18n from "i18next";
import HttpBackend, { HttpBackendOptions } from "i18next-http-backend";
import { initReactI18next } from "react-i18next";

const getBackendLoadPath = () => {
// import.meta.env.BASE_URL can be either '/' or '/retro'
const baseUrl = import.meta.env.BASE_URL;
return `${baseUrl}${baseUrl.endsWith("/") ? "" : "/"}locales/{{lng}}/{{ns}}.json`;
};

i18n
.use(HttpBackend)
.use(initReactI18next)
Expand All @@ -18,7 +12,7 @@ i18n
escapeValue: false,
},
backend: {
loadPath: getBackendLoadPath(),
loadPath: `${import.meta.env.BASE_URL}locales/{{lng}}/{{ns}}.json`,
},
})
.then();
Expand Down
3 changes: 1 addition & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { StatsProvider as Swd2eStatsProvider } from "@/features/swd-2e/stats-pro
import { ThemeProvider } from "@/hooks/theme-provider.tsx";
import "@/i18n.ts";
import "@/index.css";
import App from "@/routes/app.tsx";
import PalNewApp from "@/routes/pal-new.tsx";
import PalApp from "@/routes/pal.tsx";
import Root from "@/routes/root.tsx";
Expand All @@ -31,7 +30,7 @@ const router = createHashRouter([
children: [
{
path: "",
element: <App />,
element: <PalApp />,
},
{
path: "pal",
Expand Down

0 comments on commit 56c4f53

Please sign in to comment.