Skip to content

Commit b59bd66

Browse files
refactor(frontend): change how clientside translations are handled
1 parent e5b5c07 commit b59bd66

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

frontend/app/routes/api/translations.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export async function loader({ context, params, request }: Route.LoaderArgs) {
1212

1313
const language = url.searchParams.get('lng');
1414
const namespace = url.searchParams.get('ns');
15-
const buildRevision = url.searchParams.get('v');
1615

1716
if (!language || !namespace) {
1817
return Response.json(
@@ -31,8 +30,10 @@ export async function loader({ context, params, request }: Route.LoaderArgs) {
3130
);
3231
}
3332

34-
// cache if the build revision is anything other than the default value
35-
const shouldCache = buildRevision !== serverDefaults.BUILD_REVISION;
33+
// cache if the requested revision is anything other
34+
// than the default build revision used during development
35+
const revision = url.searchParams.get('v') ?? serverDefaults.BUILD_REVISION;
36+
const shouldCache = revision !== serverDefaults.BUILD_REVISION;
3637

3738
return Response.json(resourceBundle, {
3839
headers: shouldCache //

0 commit comments

Comments
 (0)