Skip to content

Fix translations.json fetch path for subfolder installations#54

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-subfolder-installation-issue
Open

Fix translations.json fetch path for subfolder installations#54
Copilot wants to merge 2 commits intomainfrom
copilot/fix-subfolder-installation-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

When REDAXO is installed in a subfolder, the hardcoded absolute path /assets/addons/vidstack/translations.json resolves against the server root rather than the installation base, producing a 404.

Change

Derive the translations.json URL dynamically from document.currentScript.src at script parse time, using the standard URL constructor to resolve the sibling file correctly regardless of install path:

const translationsUrl = document.currentScript?.src
    ? new URL('translations.json', document.currentScript.src).href
    : '/assets/addons/vidstack/translations.json';

This naturally handles ?buster=… query strings on the script URL and falls back to the previous absolute path if currentScript is unavailable.

Copilot AI linked an issue May 5, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix problem with subfolder installation errors Fix translations.json fetch path for subfolder installations May 5, 2026
Copilot AI requested a review from TobiasKrais May 5, 2026 08:39
@TobiasKrais TobiasKrais marked this pull request as ready for review May 5, 2026 08:42
Copy link
Copy Markdown
Member

@TobiasKrais TobiasKrais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works

@TobiasKrais TobiasKrais requested a review from skerbis May 5, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with subfolder installation

2 participants