Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Docker] "Add Contact" page crashes on en-US locale due to missing localization file #7910

@nathanwang16

Description

@nathanwang16

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Monica's Code of Conduct.

Bug description

When running the Docker container with a browser locale set to en-US (English - United States), specific pages (such as the "Add Contact" page) fail to render form fields correctly. The browser console displays a 404 Not Found error for /lang/en-US.json. This happens because while en.json exists, the specific en-US.json file is not generated or copied during the Docker build process, causing the frontend to crash or render incompletely when it attempts to load that specific locale.

Steps to reproduce

  1. Run the official Monica Docker image.
  2. Set your browser's preferred language to en-US.
  3. Log in and navigate to the Add Contact page.
  4. Observe that the form fields are empty or missing labels.
  5. Open the browser developer tools (Console/Network tab) and observe a 404 error for the request to /lang/en-US.json

Expected behavior

The application should correctly load the English translations for en-US users (falling back to or using en.json content), and the forms should render with all fields visible and labeled.

Environment

Your own self-hosted instance (v5 a.k.a chandler version or main branch)

Version of Monica

v5.0.0-beta.5

Installation method

Docker image

Web server

Apache

Database engine version

MariaDB

Additional info

I have verified that the issue is caused by the missing en-US.json file in the final Docker image.
A proposed fix is to explicitly copy en.json to en-US.json during the Docker build process. I have tested this locally by modifying scripts/docker/Dockerfile and scripts/docker/Dockerfile-fpm, which resolved the issue. Should I submit a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions