You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
closed: wontfixA fix will bring significant overhead, or is out of scope (for feature requests)domain: dxRelated to developer experience of working on Docusaurus sitesfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.
This is a technical limitation. We use Webpack dev server, which only supports one Webpack process per port. I don't have a decisive answer about whether it's possible or not, but I can't think of a possible way to do this.
Closing because of lack of response and no defense against my challenges.
I'm not against this feature, but it requires changes too significant to be beneficial. It's probably not useful for most sites, because pages don't interlink between languages that much.
@VitaliiKuzennyi Each locale is an individual SPA, so in development, you can only start one SPA. During production, we will build all locales one-by-one, and essentially deploy N SPAs where N is the number of locales. When you use the locale dropdown, you are switching between those SPAs, each of them being pretty much ignorant about the state of the other. You can see them as separate sites, essentially, that happen to be deployed under the same URL.
If it's important for you to preview both locales at the same time, I suggest you use yarn start for your primary locale, and yarn start --port 3001 --locale zh-Hans for your second locale. You won't get to use the locale dropdown, but at least you can compare them side-by-side.
Update: both locales will try to write generated files to the same directory, so if you are starting two locales in parallel, you have to change the generated directory of one locale, for example: cross-env DOCUSAURUS_GENERATED_FILES_DIR_NAME=.docusaurus/zh-Hans yarn start --locale zh-Hans --port 3001
If it's important for you to preview both locales at the same time, I suggest you use yarn start for your primary locale, and yarn start --port 3001 --locale zh-Hans for your second locale. You won't get to use the locale dropdown, but at least you can compare them side-by-side.
Update: both locales will try to write generated files to the same directory, so if you are starting two locales in parallel, you have to change the generated directory of one locale, for example: cross-env DOCUSAURUS_GENERATED_FILES_DIR_NAME=.docusaurus/zh-Hans yarn start --locale zh-Hans --port 3001
Hi, @Josh-Cena
Regarding to your update. Is there some documentation about using cross-env. Did I get it right, this can resolve problem of starting project with two localisations available?
cross-env is an npm package. In practice, if you are using Unix, you may not install it. I'm only adding this because setting environment variables on Windows is tricky. The main idea is you need to set the DOCUSAURUS_GENERATED_FILES_DIR environment variable.
late to the party on this ticket. This is really making the contribution to multi-language sites tedious. it's also not mentioned clearly in the documentation.
closed: wontfixA fix will bring significant overhead, or is out of scope (for feature requests)domain: dxRelated to developer experience of working on Docusaurus sitesfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Activity
Josh-Cena commentedon May 9, 2022
This is a technical limitation. We use Webpack dev server, which only supports one Webpack process per port. I don't have a decisive answer about whether it's possible or not, but I can't think of a possible way to do this.
Josh-Cena commentedon May 10, 2022
In order to support this, we need to support:
I highly doubt its feasibility and ROI.
Josh-Cena commentedon Jun 4, 2022
Closing because of lack of response and no defense against my challenges.
I'm not against this feature, but it requires changes too significant to be beneficial. It's probably not useful for most sites, because pages don't interlink between languages that much.
VitaliiKuzennyi commentedon Jun 15, 2022
Did I get right, that it is not possible to localize page in different languages and turn between them while working? If so, how does https://docusaurus.io/ work?
Josh-Cena commentedon Jun 15, 2022
@VitaliiKuzennyi Each locale is an individual SPA, so in development, you can only start one SPA. During production, we will build all locales one-by-one, and essentially deploy N SPAs where N is the number of locales. When you use the locale dropdown, you are switching between those SPAs, each of them being pretty much ignorant about the state of the other. You can see them as separate sites, essentially, that happen to be deployed under the same URL.
Josh-Cena commentedon Jun 15, 2022
If it's important for you to preview both locales at the same time, I suggest you use
yarn startfor your primary locale, andyarn start --port 3001 --locale zh-Hansfor your second locale. You won't get to use the locale dropdown, but at least you can compare them side-by-side.Update: both locales will try to write generated files to the same directory, so if you are starting two locales in parallel, you have to change the generated directory of one locale, for example:
cross-env DOCUSAURUS_GENERATED_FILES_DIR_NAME=.docusaurus/zh-Hans yarn start --locale zh-Hans --port 3001VitaliiKuzennyi commentedon Jun 15, 2022
@Josh-Cena Thanks for your answer. It`s clear.
VitaliiKuzennyi commentedon Jun 27, 2022
Hi, @Josh-Cena
Regarding to your update. Is there some documentation about using cross-env. Did I get it right, this can resolve problem of starting project with two localisations available?
Josh-Cena commentedon Jun 27, 2022
cross-envis an npm package. In practice, if you are using Unix, you may not install it. I'm only adding this because setting environment variables on Windows is tricky. The main idea is you need to set theDOCUSAURUS_GENERATED_FILES_DIRenvironment variable.AntoineGlacet commentedon Nov 25, 2025
late to the party on this ticket. This is really making the contribution to multi-language sites tedious. it's also not mentioned clearly in the documentation.