Skip to content

Commit

Permalink
[#21] Rename env variable LANGUAGE to APP_LANGUAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
palagdan authored and blcham committed Oct 31, 2024
1 parent 4733f1d commit 0876819
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .docker/config.js.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ window.__config__ = {
API_URL: '${API_URL}',
APP_TITLE: '${APP_TITLE}',
APP_INFO: '${APP_INFO}',
LANGUAGE: '${LANGUAGE}',
APP_LANGUAGE: '${APP_LANGUAGE}',
NAVIGATOR_LANGUAGE: '${NAVIGATOR_LANGUAGE}',
BASENAME: '${BASENAME}',
EXTENSIONS: '${EXTENSIONS}',
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
set -eu

envsubst '${API_URL} ${APP_TITLE} ${APP_INFO} ${LANGUAGE} ${NAVIGATOR_LANGUAGE} ${BASENAME} ${EXTENSIONS} ${AUTHENTICATION} ${AUTH_SERVER_URL} ${AUTH_CLIENT_ID} ${ANALYTICS_URL}' < /etc/nginx/config.js.template > /var/www/config.js
envsubst '${API_URL} ${APP_TITLE} ${APP_INFO} ${APP_LANGUAGE} ${NAVIGATOR_LANGUAGE} ${BASENAME} ${EXTENSIONS} ${AUTHENTICATION} ${AUTH_SERVER_URL} ${AUTH_CLIENT_ID} ${ANALYTICS_URL}' < /etc/nginx/config.js.template > /var/www/config.js

exec "$@"
2 changes: 1 addition & 1 deletion .env.ava
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RECORD_MANAGER_API_URL=http://localhost/ava/services/record-manager-server
RECORD_MANAGER_APP_TITLE=Record Manager
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
RECORD_MANAGER_BASENAME=/
RECORD_MANAGER_EXTENSIONS=supplier
Expand Down
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RECORD_MANAGER_API_URL=http://localhost:1235/services/record-manager-server
RECORD_MANAGER_APP_TITLE=Record Manager Dev
RECORD_MANAGER_APP_INFO=
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
RECORD_MANAGER_BASENAME=/
RECORD_MANAGER_EXTENSIONS=supplier
Expand Down
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RECORD_MANAGER_APP_TITLE=OFN Record Manager
# Information shown in footer of the Record Manager
RECORD_MANAGER_APP_INFO=
# Language of UI chosen if RECORD_MANAGER_NAVIGATOR_LANGUAGE=false. Possible values: en, cs, ..
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
# Flag if language of the UI should be determined from browser settings. Possible values: true, false.
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
# Context path added to URL or "/" in case application path should not be modified.
Expand Down
2 changes: 1 addition & 1 deletion .env.internal-auth
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RECORD_MANAGER_API_URL=http://localhost:1235/services/record-manager-server
RECORD_MANAGER_APP_TITLE=Record Manager
RECORD_MANAGER_APP_INFO=
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
RECORD_MANAGER_BASENAME=/
RECORD_MANAGER_EXTENSIONS=supplier
Expand Down
2 changes: 1 addition & 1 deletion .env.keycloak-auth
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RECORD_MANAGER_API_URL=http://localhost:1235/services/record-manager-server
RECORD_MANAGER_APP_TITLE=Record Manager
RECORD_MANAGER_APP_INFO=
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
RECORD_MANAGER_BASENAME=/
RECORD_MANAGER_EXTENSIONS=supplier
Expand Down
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RECORD_MANAGER_API_URL=http://localhost:1235/services/record-manager-server
RECORD_MANAGER_APP_TITLE=Record Manager Prod
RECORD_MANAGER_APP_INFO=
RECORD_MANAGER_LANGUAGE=cs
RECORD_MANAGER_APP_LANGUAGE=cs
RECORD_MANAGER_NAVIGATOR_LANGUAGE=true
RECORD_MANAGER_BASENAME=/
RECORD_MANAGER_EXTENSIONS=supplier
Expand Down
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RECORD_MANAGER_API_URL=http://localhost:8080/record-manager
RECORD_MANAGER_APP_TITLE=OFN Record Manager
RECORD_MANAGER_APP_INFO=
RECORD_MANAGER_LANGUAGE=en
RECORD_MANAGER_APP_LANGUAGE=en
RECORD_MANAGER_NAVIGATOR_LANGUAGE=false
RECORD_MANAGER_BASENAME=/record-manager
RECORD_MANAGER_EXTENSIONS=
Expand Down
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getEnv = (name, defaultValue) => {

export const API_URL = getEnv("API_URL");
export const APP_TITLE = getEnv("APP_TITLE", "Record Manager");
export const LANGUAGE = getEnv("LANGUAGE", "en");
export const APP_LANGUAGE = getEnv("APP_LANGUAGE", "en");
export const NAVIGATOR_LANGUAGE = JSON.parse(getEnv("NAVIGATOR_LANGUAGE", "true"));
export const BASENAME = getEnv("BASENAME", "");
export const EXTENSIONS = getEnv("EXTENSIONS", "");
Expand Down
2 changes: 1 addition & 1 deletion deploy/internal-auth/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FORMGEN_SERVICE_URL=http://s-pipes-engine:8080/s-pipes/service?_pId=clone-form

RECORD_MANAGER_APP_TITLE=Record Manager

LANGUAGE=en
APP_LANGUAGE=en

# Internal address where record manager server runs which should be accessible from inside of docker. Use `http://host.docker.internal` to access http://localhost of the host computer.
#INTERNAL_RECORD_MANAGER_SERVER_SERVICE=http://host.docker.internal:8080
2 changes: 1 addition & 1 deletion deploy/internal-auth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
API_URL: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}${APP_ROOT_PATH:-}/services/record-manager-server"
APP_INFO: "${RECORD_MANAGER_APP_INFO:-}"
APP_TITLE: "${RECORD_MANAGER_APP_TITLE:-Record Manager}"
LANGUAGE: "${LANGUAGE:-en}"
APP_LANGUAGE: "${APP_LANGUAGE:-en}"
NAVIGATOR_LANGUAGE: "false"
BASENAME: "${APP_ROOT_PATH:-}${RECORD_MANAGER_PATH:-/record-manager}"
ANALYTICS_URL: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}${APP_ROOT_PATH:-}${ANALYTICS_PATH:-/statistics}"
Expand Down
2 changes: 1 addition & 1 deletion deploy/keycloak-auth/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FORMGEN_SERVICE_URL=http://s-pipes-engine:8080/s-pipes/service?_pId=clone-form

RECORD_MANAGER_APP_TITLE=Record Manager

LANGUAGE=en
APP_LANGUAGE=en

# Internal address where record manager server runs which should be accessible from inside of docker. Use `http://host.docker.internal` to access http://localhost of the host computer.
#INTERNAL_RECORD_MANAGER_SERVER_SERVICE=http://host.docker.internal:8080
2 changes: 1 addition & 1 deletion deploy/keycloak-auth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
API_URL: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}${APP_ROOT_PATH:-}/services/record-manager-server"
APP_INFO: "${RECORD_MANAGER_APP_INFO:-}"
APP_TITLE: "${RECORD_MANAGER_APP_TITLE:-Record Manager}"
LANGUAGE: "${LANGUAGE:-en}"
APP_LANGUAGE: "${APP_LANGUAGE:-en}"
NAVIGATOR_LANGUAGE: "false"
BASENAME: "${APP_ROOT_PATH:-}${RECORD_MANAGER_PATH:-/record-manager}"
AUTHENTICATION: "oidc"
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function selectNavigatorLocalization() {
}

function selectEnvLocalization() {
if (config.LANGUAGE === "cs") {
if (config.APP_LANGUAGE === "cs") {
return csLang;
}
return enLang;
Expand Down

0 comments on commit 0876819

Please sign in to comment.