From 9cf47f0e2ae92abc57e5dd60247b9da153807755 Mon Sep 17 00:00:00 2001 From: Florian THIERRY Date: Sun, 22 Sep 2024 12:27:59 +0200 Subject: [PATCH] test --- Dockerfile-frontend | 2 +- frontend/angular.json | 5 ++++- frontend/conf/nginx.conf | 15 +++------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Dockerfile-frontend b/Dockerfile-frontend index 48aa7b0..a77f978 100644 --- a/Dockerfile-frontend +++ b/Dockerfile-frontend @@ -2,7 +2,7 @@ FROM node:22-alpine AS builder WORKDIR /app COPY frontend /app RUN npm install -RUN npm run build-prod-en +# RUN npm run build-prod-en RUN npm run build-prod-fr FROM nginx:1.27-alpine AS final diff --git a/frontend/angular.json b/frontend/angular.json index e9546d3..f198d38 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -16,7 +16,10 @@ "i18n": { "sourceLocale": "en", "locales": { - "fr": "src/locale/messages-fr.json" + "fr": { + "translation": "src/locale/messages-fr.json" + } + } }, "architect": { diff --git a/frontend/conf/nginx.conf b/frontend/conf/nginx.conf index 861c8c1..b686bfc 100644 --- a/frontend/conf/nginx.conf +++ b/frontend/conf/nginx.conf @@ -35,18 +35,9 @@ http { } # Everything under the Angular app is always redirected to Angular in the correct language - location ~ ^/fr/ { - alias /usr/share/nginx/html/fr/; - try_files $uri$args $uri$args/ /fr/index.html?$args; - proxy_set_header Host $host:$server_port; - proxy_set_header X-Forwarded-Host $server_name; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location ~ ^/en/ { - alias /usr/share/nginx/html/en/; - try_files $uri$args $uri$args/ /en/index.html?$args; + location ~ ^/(fr|en)/ { + alias /usr/share/nginx/html/$1/; + try_files $uri /$1/index.html?$args; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr;