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

feat(fetch): Add fallback languages configuration. #402

Merged
merged 2 commits into from
Mar 1, 2018

Conversation

Romakita
Copy link
Contributor

@Romakita Romakita commented Mar 1, 2018

fallbackLanguages give the possibility to configure a list of languages which must used the default language when a page is missing in the requested language.

Example

fallbackLanguages

  • type: Array<string>

List of languages that will fallback to the default language when a page is request and didn't exists for the given local.

Example:

  • try to fetch the page of /de/overview. If this page exists, it'll be displayed
  • then try to fetch the default page /overview (depending on the default language). If this page exists, it'll be displayed
  • then display 404 page.
window.$docsify = {
  fallbackLanguages: [
    "fr",
    "de"
  ]
};

Please makes sure these boxes are checked before submitting your PR, thank you!

  • Make sure you are merging your commits to master branch.
  • Add some descriptions and refer relative issues for you PR.
  • DO NOT include files inside lib directory.

fallbackLanguages give the possibility to configure a list of languages which must used the default language when a page is missing in the requested language.
@QingWei-Li QingWei-Li merged commit ecc0e04 into docsifyjs:master Mar 1, 2018
@Romakita Romakita deleted the feat_fallback_languages branch March 3, 2018 07:30
@Lalilu
Copy link

Lalilu commented Mar 7, 2019

Hey guys, I don't understand how fallback languages works…

Can you guys explain me what I have to do to make it work in my instance?

Scenario (based on my assumption how it works):

/fr/documentA.md
/fr/documentB.md
/de/documentB.md

–> when I open /de/documentA, it gets redirected to /fr/documentA

Is that correct?

@gigaga
Copy link

gigaga commented Nov 29, 2019

Hello,

I don't understand too.

Currently, I have :

/fr/
/myDoc.md

with fallbackLanguages: ["fr"].

When I consult /myDoc it works, but when I try to go to /fr/myDoc I get a 404 error rather to redirect to /myDoc.

In fact, I think it is because I use basePath: "/src/" too :(

Thanks a lot

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.

4 participants