StevenWeathers / thunderdome-planning-poker

⚡ Thunderdome is an open source agile planning poker, sprint retro, and story mapping tool
https://thunderdome.dev
Apache License 2.0
396 stars 103 forks source link

Fix: Setting config.default_locale / CONFIG_DEFAULT_LOCALE updates default locale of the site #578

Closed tbiering closed 4 days ago

tbiering commented 2 months ago

Description

This pull requests includes a fix for the non-working configuration option config.default_locale / CONFIG_DEFAULT_LOCALE. Setting the value now properly applies the locale for any unregistered user visiting the site. Visiting the site as a registered user still applies the locale set in the user's profile.

The fix has been tested by using configuration value set in the environment variables of the docker-compose.yml

Example for CONFIG_DEFAULT_LOCALE="de"

services:
  thunderdome:
    build:
      context: .
      dockerfile: ./build/Dockerfile
    restart: always
    ports:
      - "8080:8080"
    depends_on:
      - db
    links:
      - db
    networks:
      - asgard
    environment:
      APP_DOMAIN: ".127.0.0.1"
      COOKIE_SECURE: "false"
      # CONFIGURATION FOR TESTING
      CONFIG_DEFAULT_LOCALE: "de"
      # --- CONFIGURATION FOR TESTING
      SMTP_SECURE: "false"
      SMTP_HOST: mail
      SMTP_PORT: 1025
      DB_NAME: thunderdome
      DB_USER: thor
      DB_PASS: odinson
    volumes:
      - ./etc:/etc/thunderdome
[...]

What type of PR is this? (check all applicable)

Related Tickets & Documents

Fixes #577

Screenshots/Recordings

Before fix: before-fix_locale-all

After fix:

Steps to QA

  1. Set environment variable CONFIG_DEFAULT_LOCALE to "de" using configuration in docker-compose.yml (see above)
  2. Start up using docker-compose up --build
  3. Validate that the preselected language is now german using the language selector button.
  4. Parts of the site are now displayed in german - use the "login"-button for reference. It should now be labeled "Anmeldung". (Note: Only parts of the translation file are currently translated)
tbiering commented 2 months ago

I just notices that my fix included modifications to an auto-generated file 🤦‍♂️. I will work on the fix and update the PR accordinly.