Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#5093 from DDMeaqua/feat-i18n
Browse files Browse the repository at this point in the history
feat: update i18n
  • Loading branch information
lloydzhou authored Aug 16, 2024
2 parents 87325fa + e033bef commit f64763b
Show file tree
Hide file tree
Showing 17 changed files with 5,705 additions and 1,687 deletions.
3 changes: 2 additions & 1 deletion app/config/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import md5 from "spark-md5";
import { DEFAULT_MODELS } from "../constant";
import { DEFAULT_MODELS, DEFAULT_GA_ID } from "../constant";

declare global {
namespace NodeJS {
Expand Down Expand Up @@ -211,6 +211,7 @@ export const getServerSideConfig = () => {
cloudflareKVTTL: process.env.CLOUDFLARE_KV_TTL,

gtmId: process.env.GTM_ID,
gaId: process.env.GA_ID || DEFAULT_GA_ID,

needCode: ACCESS_CODES.size > 0,
code: process.env.CODE,
Expand Down
1 change: 1 addition & 0 deletions app/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,5 @@ export const internalAllowedWebDavEndpoints = [
"https://app.koofr.net/dav/Koofr",
];

export const DEFAULT_GA_ID = "G-89WN60ZK2E";
export const PLUGINS = [{ name: "Stable Diffusion", path: Path.Sd }];
7 changes: 6 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getClientConfig } from "./config/client";
import type { Metadata, Viewport } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server";
import { GoogleTagManager } from "@next/third-parties/google";
import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google";
const serverConfig = getServerSideConfig();

export const metadata: Metadata = {
Expand Down Expand Up @@ -56,6 +56,11 @@ export default function RootLayout({
<GoogleTagManager gtmId={serverConfig.gtmId} />
</>
)}
{serverConfig?.gaId && (
<>
<GoogleAnalytics gaId={serverConfig.gaId} />
</>
)}
</body>
</html>
);
Expand Down
Loading

0 comments on commit f64763b

Please sign in to comment.