Skip to content

Commit

Permalink
add DOCUSAURUS_CURRENT_LOCALE for start script + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 17, 2023
1 parent c4531fd commit adaf6f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/docusaurus/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function build(
): Promise<string> {
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
process.env.DOCUSAURUS_CURRENT_LOCALE = cliOptions.locale;

const siteDir = await fs.realpath(siteDirParam);

Expand Down
7 changes: 5 additions & 2 deletions packages/docusaurus/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ export async function start(
siteDirParam: string = '.',
cliOptions: Partial<StartCLIOptions> = {},
): Promise<void> {
// Temporary workaround to unlock the ability to translate the site config
// We'll remove it if a better official API can be designed
// See https://github.com/facebook/docusaurus/issues/4542
process.env.DOCUSAURUS_CURRENT_LOCALE = cliOptions.locale;

const siteDir = await fs.realpath(siteDirParam);

process.env.NODE_ENV = 'development';
process.env.BABEL_ENV = 'development';
logger.info('Starting the development server...');

function loadSite() {
Expand Down

0 comments on commit adaf6f3

Please sign in to comment.