PageSourceSearch

https://dev-mountain.vercel.app/assets/js/e44a2883.7198c860.js

js dev-mountain.vercel.app collected 2026-10-03 07:14:57 UTC 5,787 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdev_mountain=globalThis.webpackChunkdev_mountain||[]).push([[4736],{28453(e,n,r){r.d(n,{R:()=>i,x:()=>o});var t=r(96540);const s={},a=t.createContext(s);function i(e){const n=t.useContext(a);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),t.createElement(a.Provider,{value:n},e.children)}},68379(e,n,r){r.d(n,{A:()=>t});const t=r.p+"assets/images/localeDropdown-f0d995e751e7656a1b0dbbc1134e49c2.png"},83274(e,n,r){r.r(n),r.d(n,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"tutorial-extras/translate-your-site","title":"Translate Your Site","description":"Dev-Mountain currently runs in English only, but Docusaurus has built-in i18n (internationalisation) support if a multi-language version is ever needed. Below is the full reference for enabling it.","source":"@site/docs/tutorial-extras/translate-your-site.md","sourceDirName":"tutorial-extras","slug":"/tutorial-extras/translate-your-site","permalink":"/docs/tutorial-extras/translate-your-site","draft":false,"unlisted":false,"editUrl":"https://github.com/AbdulDevHub/Docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/tutorial-extras/translate-your-site.md","tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2},"sidebar":"tutorialSidebar","previous":{"title":"Manage Docs Versions","permalink":"/docs/tutorial-extras/manage-docs-versions"}}');var s=r(74848),a=r(28453);const i={sidebar_position:2},o="Translate Your Site",l={},d=[{value:"Configure i18n",id:"configure-i18n",level:2},{value:"Translate a doc",id:"translate-a-doc",level:2},{value:"Start your localized site",id:"start-your-localized-site",level:2},{value:"Add a Locale Dropdown",id:"add-a-locale-dropdown",level:2},{value:"Build your localized site",id:"build-your-localized-site",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",img:"img",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"translate-your-site",children:"Translate Your Site"})}),"\n",(0,s.jsxs)(n.p,{children:["Dev-Mountain currently runs in English only, but Docusaurus has built-in ",(0,s.jsx)(n.strong,{children:"i18n (internationalisation)"})," support if a multi-language version is ever needed. Below is the full reference for enabling it."]}),"\n",(0,s.jsx)(n.h2,{id:"configure-i18n",children:"Configure i18n"}),"\n",(0,s.jsxs)(n.p,{children:["Modify ",(0,s.jsx)(n.code,{children:"docusaurus.config.js"})," to add support for the ",(0,s.jsx)(n.code,{children:"fr"})," locale:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n  i18n: {\n    defaultLocale: 'en',\n    locales: ['en', 'fr'],\n  },\n};\n"})}),"\n",(0,s.jsx)(n.h2,{id:"translate-a-doc",children:"Translate a doc"}),"\n",(0,s.jsxs)(n.p,{children:["Copy the ",(0,s.jsx)(n.code,{children:"docs/intro.md"})," file to the ",(0,s.jsx)(n.code,{children:"i18n/fr"})," folder:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/\n\ncp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Translate ",(0,s.jsx)(n.code,{children:"i18n/fr/docusaurus-plugin-content-docs/current/intro.md"})," in French."]}),"\n",(0,s.jsx)(n.h2,{id:"start-your-localized-site",children:"Start your localized site"}),"\n",(0,s.jsx)(n.p,{children:"Start your site on the French locale:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm run start -- --locale fr\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Your localized site is accessible at ",(0,s.jsx)(n.a,{href:"http://localhost:3000/fr/",children:"http://localhost:3000/fr/"})," and the ",(0,s.jsx)(n.code,{children:"Getting Started"})," page is translated."]}),"\n",(0,s.jsx)(n.admonition,{type:"caution",children:(0,s.jsx)(n.p,{children:"In development, you can only use one locale at a time."})}),"\n",(0,s.jsx)(n.h2,{id:"add-a-locale-dropdown",children:"Add a Locale Dropdown"}),"\n",(0,s.jsx)(n.p,{children:"To navigate seamlessly across languages, add a locale dropdown."}),"\n",(0,s.jsxs)(n.p,{children:["Modify the ",(0,s.jsx)(n.code,{children:"docusaurus.config.js"})," file:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n  themeConfig: {\
1n    navbar: {\n      items: [\n        // highlight-start\n        {\n          type: 'localeDropdown',\n        },\n        // highlight-end\n      ],\n    },\n  },\n};\n"})}),"\n",(0,s.jsx)(n.p,{children:"The locale dropdown now appears in your navbar:"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.img,{alt:"Locale Dropdown",src:r(68379).A+"",width:"370",height:"302"})}),"\n",(0,s.jsx)(n.h2,{id:"build-your-localized-site",children:"Build your localized site"}),"\n",(0,s.jsx)(n.p,{children:"Build your site for a specific locale:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm run build -- --locale fr\n"})}),"\n",(0,s.jsx)(n.p,{children:"Or build your site to include all the locales at once:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm run build\n"})})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.