Skip to content

Conversation

digforit
Copy link

  • Added 'defaultFallbackLanguage' parameter to avoid the need of having the default language in root folder.

This way we can have exactly formatted folders for each language including the default one without having to mix the default language with root files.

Summary

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:


  • DO NOT include files inside lib directory.

+ Added 'defaultFallbackLanguage' parameter to avoid the need of having the default language in root folder.
@digforit digforit changed the title Update index.js Added 'defaultFallbackLanguage' config parameter. Aug 31, 2019
}
const newPath = path.replace(new RegExp(`^/${local}`), '')

var defaultLanguage = '';
Copy link

Choose a reason for hiding this comment

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

Suggested change
var defaultLanguage = '';
let defaultLanguage = '';

@stale
Copy link

stale bot commented Feb 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 4, 2020
}
const newPath = path.replace(new RegExp(`^/${local}`), '')

var defaultLanguage = '';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var defaultLanguage = '';
var defaultLanguage = defaultFallbackLanguage ? defaultFallbackLanguage : '';

and remove the if stmt.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case you could convert this to a const and not a let as mentioned


proto._fetchFallbackPage = function (path, qs, cb = noop) {
const {requestHeaders, fallbackLanguages, loadSidebar} = this.config
const {requestHeaders, defaultFallbackLanguage, fallbackLanguages, loadSidebar} = this.config
Copy link
Member

Choose a reason for hiding this comment

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

Update the docs as well

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

Successfully merging this pull request may close these issues.

4 participants