Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Question/Feature Request) Allow default language to not have prepended slug #169

Open
bufke opened this issue Oct 23, 2019 · 6 comments
Open

Comments

@bufke
Copy link

bufke commented Oct 23, 2019

Is there any current way of providing a url structure like this? Assume English is default

/ (English)
/fr/
/es/
etc

This conflicts with Wagtail's tree structure. Typically wagtailtrans's Translatable site root page would occupy "/" and English would have a slug such as /en/

This creates hardship migrating a site in one language to many as all the previous links change. Sometimes it's not desired to have the "en" slug for the default language.

How to reproduce?

  • Create a translatable site root page as noted in documentation
  • Create a home page under the translatable root page

We see the homepage requires a slug which makes it something like /en/

Other info

It's possible I could work on this feature if it was desired upstream. I'm waiting for direction from a client.

Potential work around

One could just make two sites. One for the default language and one for everything else. It might involve minor trickery as both sites may be on the same domain.

@jjanssen
Copy link
Member

jjanssen commented Dec 5, 2019

Hi @bufke

We have had some offline discussion about this and we'd be happy to have this available: it makes total sense. Perhaps with a configurable setting to which you can opt-in to. That way we don't change the current behaviour directly and maintain backwards-compatibility.

I know we've neglected to answer your question earlier but would you still be willing to make a PR for this? Otherwise it is open for grabs.

@kaedroho
Copy link
Contributor

kaedroho commented Dec 5, 2019

The way Django's i18n_patterns solves this is to prefix all URLs that have content, and when someone makes a request that isn't prefixed they get redirected to the prefixed version based on the language configured in their browser.

@bufke
Copy link
Author

bufke commented Jan 6, 2020

No worries, it took a long time for our client to decide anyway and they went with moving the en site to a path. Unfortunately that means I won't be able to make the PR unless we get another client who wants it.

@matiasmm
Copy link

matiasmm commented May 3, 2020

Is there any workaround for this? I'd really like to have this functionality

@George-on
Copy link

It will be really very useful.

@jkevingutierrez
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants