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

Default locale in subdirectory but with root / address? #290

Closed
sformisano opened this issue Apr 28, 2018 · 9 comments
Closed

Default locale in subdirectory but with root / address? #290

sformisano opened this issue Apr 28, 2018 · 9 comments

Comments

@sformisano
Copy link

Hey all,

been playing with VuePress and loving it.

I have one question: both docs sites and blogs with many languages could benefit from having all languages each under its subdirectory, e.g. en/it/de/jp, while still selecting one of these as the default language to deploy under the root directory.

I read the docs and found no way to do this (if I'm wrong and this is possible please do tell me).

If this is in fact not an option at the moment, would anyone be interested in such a feature if I submit a PR for it?

I imagine that being in a static context the simplest way to accomplish this would be extracting main locale subdirectories and files into the root directory at build time. I'd have to think a bit more about a solution in dev environment.

Thoughts?

@yyx990803
Copy link
Member

You don't have to put it under root... You can do exactly what you are trying to do.

@sformisano
Copy link
Author

@yyx990803 but wouldn't that mean I'd get urls like mydocs.com/en/resource as opposed to mydocs.com/resource? That's what I would like to have, pick a language as the default that doesn't get the prefix in the url, whereas all the others get the url prefix, all while having the default language sit in its subdirectory.

@Dafrok
Copy link

Dafrok commented May 8, 2018

the same issue #363

@Dafrok
Copy link

Dafrok commented May 8, 2018

I tried to put my default docs into /docs/en/**, the /docs/README.md would rendered like this:

v3e a j xm4 8 4tm qm i

All options had been choosen and I can't click anyone.

@ycmjason
Copy link
Contributor

ycmjason commented May 8, 2018

@sformisano @Dafrok
I think it is more intuitive to have the the directory structure corresponding to url path. I don't think it make sense to add more complexity to the config just to facilitate "default language" given that the config can be quite complex already.

@Dafrok
Copy link

Dafrok commented May 8, 2018

@ycmjason It's really a problem when mixing language folders and default documents. For example, I just created a lib which contains augment reality API, and I want to support Arabic, how can I distinguish between the folder Arabic(ar) and augment reality(ar)? It's horrible.

docs/
  - ar/
    - ar/
      - api.md
      - README.md
    - vr/
      - README.md
    - README.md
  - ar/ ========> How can I put this folder in?
    - api.md
    - README.md
  - vr/
    - README.md
  - README.md

@ycmjason
Copy link
Contributor

ycmjason commented May 8, 2018

@Dafrok

I see where you are coming from. But this would not be a problem if you use:

docs/
  - ar/
    - ar/
      - api.md
      - README.md
    - vr/
      - README.md
    - README.md
  - en/
    - ar/
      - api.md
      - README.md
    - vr/
      - README.md
    - README.md

@Dafrok
Copy link

Dafrok commented May 8, 2018

Sure, I just did this. but when I visit the root route, language selector in the top right corner went wrong, and I tried to close or hide the navbar, but failed.

All options had been choosen and I can't click anyone.
see #290 (comment)

@sformisano
Copy link
Author

@ycmjason more intuitive indeed, but not necessarily more useful. I also can't imagine this adding excessive complexity but I may be wrong. Let us see how others feel about this too I guess :)

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

No branches or pull requests

4 participants