From 097673b845a48e8d7155214e80c2e1bca00ca6b1 Mon Sep 17 00:00:00 2001 From: GuoQing Liu <842607283@qq.com> Date: Fri, 14 Nov 2025 23:36:46 +0800 Subject: [PATCH] chore: i18n use cache key (#20885) * chore: i18n use cache key * Fix indentation in Dockerfile for pip command * Add build argument for GIT_COMMIT_HASH in CI workflow * Add short-sha output to action.yml * Update build args to use short SHA output * build: use vite .env * Remove unnecessary newline in Dockerfile * Define proxy host variable in vite.config.ts Add a new line to define the proxy host variable. --- .gitignore | 1 + Makefile | 1 + web/.gitignore | 1 + web/src/utils/i18n.ts | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8456d9be0..660a378b0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ frigate/version.py web/build web/node_modules web/coverage +web/.env core !/web/**/*.ts .idea/* diff --git a/Makefile b/Makefile index 2baac5aad..d1427b6df 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ push-boards: $(BOARDS:%=push-%) version: echo 'VERSION = "$(VERSION)-$(COMMIT_HASH)"' > frigate/version.py + echo 'VITE_GIT_COMMIT_HASH=$(COMMIT_HASH)' > web/.env local: version docker buildx build --target=frigate --file docker/main/Dockerfile . \ diff --git a/web/.gitignore b/web/.gitignore index a547bf36d..1cac5597e 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -22,3 +22,4 @@ dist-ssr *.njsproj *.sln *.sw? +.env \ No newline at end of file diff --git a/web/src/utils/i18n.ts b/web/src/utils/i18n.ts index 1a386ccb3..eba5ff7a5 100644 --- a/web/src/utils/i18n.ts +++ b/web/src/utils/i18n.ts @@ -33,7 +33,7 @@ i18n fallbackLng: "en", // use en if detected lng is not available backend: { - loadPath: "locales/{{lng}}/{{ns}}.json", + loadPath: `locales/{{lng}}/{{ns}}.json?v=${import.meta.env.VITE_GIT_COMMIT_HASH || "unknown"}`, }, ns: [