1"use strict";(globalThis.webpackChunkgasnet_org=globalThis.webpackChunkgasnet_org||[]).push([[6838],{11350(e,n,t){t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>s,toc:()=>d});const s=JSON.parse('{"id":"operations/i18n","title":"Internationalization (i18n)","description":"How to add and manage translations for Gasnet.org","source":"@site/docs/operations/i18n.md","sourceDirName":"operations","slug":"/operations/i18n","permalink":"/docs/operations/i18n","draft":false,"unlisted":false,"tags":[{"inline":true,"label":"operations","permalink":"/docs/tags/operations"},{"inline":true,"label":"i18n","permalink":"/docs/tags/i-18-n"},{"inline":true,"label":"translation","permalink":"/docs/tags/translation"}],"version":"current","frontMatter":{"title":"Internationalization (i18n)","description":"How to add and manage translations for Gasnet.org","slug":"/operations/i18n","tags":["operations","i18n","translation"]},"sidebar":"docs","previous":{"title":"Features Demo","permalink":"/docs/features-demo"}}');var r=t(74848),a=t(28453);const o={title:"Internationalization (i18n)",description:"How to add and manage translations for Gasnet.org",slug:"/operations/i18n",tags:["operations","i18n","translation"]},i=void 0,l={},d=[{value:"Current Status",id:"current-status",level:2},{value:"Adding a New Language",id:"adding-a-new-language",level:2},{value:"1. Update Docusaurus Config",id:"1-update-docusaurus-config",level:3},{value:"2. Create Translation Directory Structure",id:"2-create-translation-directory-structure",level:3},{value:"3. Translate Documents",id:"3-translate-documents",level:3},{value:"4. Translate Theme Strings",id:"4-translate-theme-strings",level:3},{value:"5. Extract and Translate",id:"5-extract-and-translate",level:3},{value:"Translation Workflow",id:"translation-workflow",level:2},{value:"Supported Locales",id:"supported-locales",level:2},{value:"Resources",id:"resources",level:2}];function c(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"This document describes how to add translations to Gasnet.org."}),"\n",(0,r.jsx)(n.h2,{id:"current-status",children:"Current Status"}),"\n",(0,r.jsxs)(n.p,{children:["Gasnet.org currently supports ",(0,r.jsx)(n.strong,{children:"English only"}),". Previous attempts to add Chinese translations (",(0,r.jsx)(n.code,{children:"zh-CN"}),") were incomplete and have been removed."]}),"\n",(0,r.jsx)(n.h2,{id:"adding-a-new-language",children:"Adding a New Language"}),"\n",(0,r.jsx)(n.h3,{id:"1-update-docusaurus-config",children:"1. Update Docusaurus Config"}),"\n",(0,r.jsxs)(n.p,{children:["Edit ",(0,r.jsx)(n.code,{children:"/docusaurus.config.js"})," to add the new locale:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"i18n: {\n defaultLocale: 'en',\n locales: ['en', 'zh-CN'], // Add your locale here\n localeConfigs: {\n en: { label: 'English' },\n 'zh-CN': { label: '\u7b80\u4f53\u4e2d\u6587' },\n },\n},\n"})}),"\n",(0,r.jsx)(n.p,{children:"Add the locale dropdown to the navbar (only after translations exist):"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"navbar: {\n items: [\n // ... other items\n {\n type: 'localeDropdown',\n position: 'right',\n },\n ],\n},\n"})}),"\n",(0,r.jsx)(n.h3,{id:"2-create-translation-directory-structure",children:"2. Create Translation Directory Structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"# Docusaurus will create this structure automatically\nmkdir -p i18n/zh-CN/docusaurus-plugin-content-docs/current\n"})}),"\n",(0,r.jsx)(n.h3,{id:"3-translate-documents",children:"3. Translate Documents"}),"\n",(0,r.jsxs)(n.p,{children:["For each markdown file in ",(0,r.jsx)(n.code,{children:"docs/"}),", create a corresponding translation:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docs/01-getting-started/intro.md\n \u2192 i18n/zh-CN/docusaurus-plugin-content-docs/current/01-getting-started/intro.md\n"})}),"\n",(0,r.jsx)(n.h3,{id:"4-translate-theme-strings",children:"4. Translate Theme Strings"}),"\n",(0,r.jsxs)(n.p,{children:["Create ",(0,r.jsx)(n.code,{children:"i18n/zh-CN/docusaurus-theme-classic/navbar.json"}),":"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "title": {\n "message": "Gasnet.org",\n "description": "Navbar title"\n },\n "item.label.Docs": {\n "message": "\u6587\u6863",\n "description": "Navbar item label"\n }\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"5-extract-and-translate",children:"5. Extract and Translate"}),"\n",(0,r.jsx)(n.p,{children:"Use Docusaurus CLI to extract translatable str
1ings:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"npm run write-translations -- --locale zh-CN\n"})}),"\n",(0,r.jsx)(n.h2,{id:"translation-workflow",children:"Translation Workflow"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Only add a locale when translations are complete"})," - Don't add empty/partial locales"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Translate all docs before enabling the dropdown"})," - Incomplete translations create poor UX"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Use professional translation or native speakers"})," - Technical HPC terminology requires precision"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Keep translations in sync"})," - When updating English docs, update translations too"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"supported-locales",children:"Supported Locales"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Locale"}),(0,r.jsx)(n.th,{children:"Label"}),(0,r.jsx)(n.th,{children:"Status"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"en"})}),(0,r.jsx)(n.td,{children:"English"}),(0,r.jsx)(n.td,{children:"\u2705 Complete"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"zh-CN"})}),(0,r.jsx)(n.td,{children:"\u7b80\u4f53\u4e2d\u6587"}),(0,r.jsx)(n.td,{children:"Planned"})]})]})]}),"\n",(0,r.jsx)(n.h2,{id:"resources",children:"Resources"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docusaurus.io/docs/i18n/introduction",children:"Docusaurus i18n Guide"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://docusaurus.io/docs/i18n/crowdin",children:"Crowdin for Docusaurus"})}),"\n",(0,r.jsx)(n.li,{children:(0,r.jsx)(n.a,{href:"https://www.techonthenet.com/js/language_tags.cfm",children:"Locale codes (BCP 47)"})}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},28453(e,n,t){t.d(n,{R:()=>o,x:()=>i});var s=t(96540);const r={},a=s.createContext(r);function o(e){const n=s.useContext(a);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]);
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.