Skip to content

404 when resource path in the URL path doesn't exist - #4409

Open
mathjazz wants to merge 1 commit into
mozilla:mainfrom
mathjazz:4353-resource-404
Open

404 when resource path in the URL path doesn't exist#4409
mathjazz wants to merge 1 commit into
mozilla:mainfrom
mathjazz:4353-resource-404

Conversation

@mathjazz

Copy link
Copy Markdown
Collaborator

Fix #4353.

The translate view validated the locale, the project and the ProjectLocale, but took the resource straight from the URL. A path that the locale has no resource for rendered the view with the path in the navigation and an empty string list, which reads as an empty resource rather than as a wrong URL.

Require the path to name a resource the locale has a TranslatedResource for, unless it is all-resources — the same set the paths menu offers. A resource that is obsolete is a 404 too, and so is one belonging to a locale still waiting for its first sync, which has nothing to translate..

The translate view validated the locale, the project and the
ProjectLocale, but took the resource straight from the URL. A path that
the locale has no resource for rendered the view with the path in the
navigation and an empty string list, which reads as an empty resource
rather than as a wrong URL.

Require the path to name a resource the locale has a TranslatedResource
for, unless it is `all-resources` — the same set the paths menu offers. A
resource that is obsolete is a 404 too, and so is one belonging to a
locale still waiting for its first sync, which has nothing to translate..
@mathjazz
mathjazz requested a review from ayshushus August 13, 2026 21:12

@ayshushus ayshushus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!!

This doesn't 404 http://localhost:8000/ab/all-projects/foo-i-made-up/also-random.ftl/
because we expect all-projects/all-resources in the slug (and the other case changes the is a different URL anyway) but just curious if that edge case is something we'd want to consider since this is a URL PR.

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.

Show the 404 page when the resource in the URL path doesn't exist

2 participants