docs(multi lang support): work on getting multi lang support working
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# ---> Node
|
# ---> Node
|
||||||
app/src/docs
|
app/src/docs
|
||||||
app/src/frontend
|
app/src/frontend
|
||||||
|
lstDocs/i18n
|
||||||
lstWrapper/bin
|
lstWrapper/bin
|
||||||
lstWrapper/obj
|
lstWrapper/obj
|
||||||
lstWrapper/publish
|
lstWrapper/publish
|
||||||
|
|||||||
21
.vscode/settings.json
vendored
@@ -24,5 +24,24 @@
|
|||||||
},
|
},
|
||||||
"[handlebars]": {
|
"[handlebars]": {
|
||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true
|
||||||
}
|
},
|
||||||
|
"[go]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "golang.go"
|
||||||
|
},
|
||||||
|
"[powershell]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "ms-vscode.powershell" // requires PowerShell extension
|
||||||
|
},
|
||||||
|
"[bat]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "foxundermoon.shell-format" // supports .sh, .bat, .cmd
|
||||||
|
},
|
||||||
|
"[cmd]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.defaultFormatter": "foxundermoon.shell-format"
|
||||||
|
},
|
||||||
|
|
||||||
|
// Optional: Configure goimports instead of gofmt
|
||||||
|
"go.formatTool": "goimports"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
meta {
|
meta {
|
||||||
name: build app V2
|
name: version
|
||||||
type: http
|
type: http
|
||||||
seq: 2
|
seq: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
post {
|
get {
|
||||||
url: http://localhost:8080/build
|
url: http://localhost:8080/version
|
||||||
body: none
|
body: none
|
||||||
auth: inherit
|
auth: inherit
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,24 @@ func main() {
|
|||||||
|
|
||||||
// POST /build -> run npm build + increment .build
|
// POST /build -> run npm build + increment .build
|
||||||
r.POST("/build", func(c *gin.Context) {
|
r.POST("/build", func(c *gin.Context) {
|
||||||
|
host, err := os.Hostname()
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(500, gin.H{"error": "Could not retrieve hostname"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println(host)
|
||||||
|
if strings.Contains(host, "VMS") || strings.Contains(host, "vms") {
|
||||||
|
c.JSON(500, gin.H{"error": "You are not allowed to run the build on a production server"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// run the old builder first this will be removed once we switch fully over here and shut down the old version
|
||||||
|
if err := runNpmV2Build(); err != nil {
|
||||||
|
c.JSON(500, gin.H{"error": "npm build failed on lstV2", "details": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// the new builder
|
||||||
if err := runNpmBuild(); err != nil {
|
if err := runNpmBuild(); err != nil {
|
||||||
c.JSON(500, gin.H{"error": "npm build failed", "details": err.Error()})
|
c.JSON(500, gin.H{"error": "npm build failed", "details": err.Error()})
|
||||||
return
|
return
|
||||||
@@ -59,29 +77,9 @@ func main() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
r.POST("/buildv2", func(c *gin.Context) {
|
|
||||||
if err := runNpmV2Build(); err != nil {
|
|
||||||
c.JSON(500, gin.H{"error": "npm build failed on lstV2", "details": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
buildNum, err := bumpBuild()
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(500, gin.H{"error": "failed updating build counter", "details": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
c.JSON(200, gin.H{
|
|
||||||
"message": "build successful",
|
|
||||||
"build": buildNum,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// GET /version -> read current build version
|
// GET /version -> read current build version
|
||||||
r.GET("/version", func(c *gin.Context) {
|
r.GET("/version", func(c *gin.Context) {
|
||||||
data, err := os.ReadFile(".build")
|
data, err := os.ReadFile("../.build")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(404, gin.H{"error": "no build info"})
|
c.JSON(404, gin.H{"error": "no build info"})
|
||||||
return
|
return
|
||||||
@@ -91,4 +89,3 @@ func main() {
|
|||||||
|
|
||||||
r.Run(":8080") // serve API
|
r.Run(":8080") // serve API
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
5
lang/de.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"intro.title": "Einführung",
|
||||||
|
"intro.heading": "Willkommen zu unserer Dokumentation",
|
||||||
|
"intro.body": "Dies ist der deutsche Einführungsabsatz."
|
||||||
|
}
|
||||||
5
lang/en.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"intro.title": "Introduction",
|
||||||
|
"intro.heading": "Welcome to our Docs",
|
||||||
|
"intro.body": "This is the English introduction paragraph."
|
||||||
|
}
|
||||||
5
lang/es.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"intro.title": "Introducción",
|
||||||
|
"intro.heading": "Bienvenido a nuestra Documentación",
|
||||||
|
"intro.body": "Este es el párrafo de introducción en español."
|
||||||
|
}
|
||||||
@@ -15,28 +15,28 @@ Please note that if you plan to utlize the scanner app you must use IIS to run a
|
|||||||
1. Open IIS
|
1. Open IIS
|
||||||
2. Expand the plant and select application pools
|
2. Expand the plant and select application pools
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. Right click and create application
|
3. Right click and create application
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
4. Name is Logistics Support Tool
|
4. Name is Logistics Support Tool
|
||||||
|
|
||||||
- Change .NET CLR verion to not managed
|
- Change .NET CLR verion to not managed
|
||||||
- leave the rest as default
|
- leave the rest as default
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Create the website
|
## Create the website
|
||||||
|
|
||||||
1. Expand the Sites
|
1. Expand the Sites
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2. Right click on default site and click "Add Application..."
|
2. Right click on default site and click "Add Application..."
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
3. Fill out the form like below
|
3. Fill out the form like below
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ Please note that if you plan to utlize the scanner app you must use IIS to run a
|
|||||||
E:\LST\lstWrapper
|
E:\LST\lstWrapper
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Making sure websocket is enabled
|
## Making sure websocket is enabled
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 2
|
sidebar_position: 2
|
||||||
|
id: install
|
||||||
---
|
---
|
||||||
|
|
||||||
# Install Process
|
# Install Process
|
||||||
@@ -105,7 +106,7 @@ Make sure you have installed both
|
|||||||
open the app in vs code
|
open the app in vs code
|
||||||
open terminal
|
open terminal
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
run the install command
|
run the install command
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
|
id: intro
|
||||||
|
title: intro.title
|
||||||
|
---
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Logisitcs Support Tool Intro
|
# Logisitcs Support Tool Intro
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
sidebar_position: 1
|
sidebar_position: 1
|
||||||
|
id: ocp
|
||||||
---
|
---
|
||||||
|
|
||||||
# Material Consumption
|
# Material Consumption
|
||||||
@@ -22,7 +23,7 @@ here you will be able to see the logs for the last 4 hours to identifty what the
|
|||||||
|
|
||||||
below is an example of missing materials.
|
below is an example of missing materials.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
as you see this lot is missing a lot of items. if the packer keeps pressing the pause button you will see quite a few of these.
|
as you see this lot is missing a lot of items. if the packer keeps pressing the pause button you will see quite a few of these.
|
||||||
|
|
||||||
@@ -39,16 +40,16 @@ To correct these errors follow each error.
|
|||||||
|
|
||||||
Grab a scanner and scan the Consume non-prepared material
|
Grab a scanner and scan the Consume non-prepared material
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
next grab the production work order of the lot you will be running the material on.
|
next grab the production work order of the lot you will be running the material on.
|
||||||
Then scan the top barcode.
|
Then scan the top barcode.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Lastly scan the cage of preforms, resin, or color you will be consuming to the lot.
|
Lastly scan the cage of preforms, resin, or color you will be consuming to the lot.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Consuming new manual material via LST.
|
## Consuming new manual material via LST.
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ Click on material helper on the left side bar.
|
|||||||
|
|
||||||
Enter the lot and running number and click consume, the card also comes with basic insturctions.
|
Enter the lot and running number and click consume, the card also comes with basic insturctions.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
This will do the exact same process as using the scanner.
|
This will do the exact same process as using the scanner.
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ then you will want to add the enter the running number and the original quantity
|
|||||||
|
|
||||||
label example to show where to look
|
label example to show where to look
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
NOTE: preforms have there quantity on the label as well and you can still use the external running number(iowas perform running numebr) to move to the next lot.
|
NOTE: preforms have there quantity on the label as well and you can still use the external running number(iowas perform running numebr) to move to the next lot.
|
||||||
|
|
||||||
@@ -83,15 +84,15 @@ Last part you will need is the lot number you will be moving the material too.
|
|||||||
|
|
||||||
Like in the consume lst comes with basic insturctions as well.
|
Like in the consume lst comes with basic insturctions as well.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Please see example errors that you could see when utlizeing the lotTransfer card.
|
Please see example errors that you could see when utlizeing the lotTransfer card.
|
||||||
|
|
||||||
   
|
   
|
||||||
|
|
||||||
The below specfic and very generic error is more than likely an input error. And that could be the running number is wrong and never actually was in the system, but in the event everything was checked and you still get the error please report by entering a helpdesk ticket.
|
The below specfic and very generic error is more than likely an input error. And that could be the running number is wrong and never actually was in the system, but in the event everything was checked and you still get the error please report by entering a helpdesk ticket.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Manual return and consume
|
## Manual return and consume
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ Grab your label you are wanting to move to the next lot
|
|||||||
|
|
||||||
Note the running number and qty. you will not ever be able to reprint for more than the qty that is currenty on the label
|
Note the running number and qty. you will not ever be able to reprint for more than the qty that is currenty on the label
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
next open up alpla label (any version of alpla label will work for this step) and click on the reprint tab.
|
next open up alpla label (any version of alpla label will work for this step) and click on the reprint tab.
|
||||||
|
|
||||||
@@ -120,13 +121,13 @@ NOTE: if you see the yellow triangle like in the below example this indicates th
|
|||||||
|
|
||||||
please reach out to your manager or supervisor to ask for next steps on what to do.
|
please reach out to your manager or supervisor to ask for next steps on what to do.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Next take the newly printed label, a scanner, workorder, and location barcode.
|
Next take the newly printed label, a scanner, workorder, and location barcode.
|
||||||
|
|
||||||
scan
|
scan
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Scan the unit (The label you reprinted).
|
- Scan the unit (The label you reprinted).
|
||||||
- Scan the lane (location where you will be returning this material/preforms to)
|
- Scan the lane (location where you will be returning this material/preforms to)
|
||||||
@@ -136,10 +137,10 @@ Grab the new work order
|
|||||||
|
|
||||||
Scan
|
Scan
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Scan the top bar code on the production order
|
- Scan the top bar code on the production order
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Scan the barcode of the label you reprinted
|
- Scan the barcode of the label you reprinted
|
||||||
|
|||||||
@@ -33,7 +33,30 @@ const config: Config = {
|
|||||||
// may want to replace "en" with "zh-Hans".
|
// may want to replace "en" with "zh-Hans".
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
locales: ["en"],
|
locales: ["en", "es"],
|
||||||
|
// localeConfigs: {
|
||||||
|
// en: {
|
||||||
|
// label: "English",
|
||||||
|
// direction: "ltr",
|
||||||
|
// htmlLang: "en-US",
|
||||||
|
// calendar: "gregory",
|
||||||
|
// path: "en",
|
||||||
|
// },
|
||||||
|
// es: {
|
||||||
|
// label: "Español",
|
||||||
|
// direction: "ltr",
|
||||||
|
// htmlLang: "es-ES",
|
||||||
|
// calendar: "gregory",
|
||||||
|
// path: "es",
|
||||||
|
// },
|
||||||
|
// de: {
|
||||||
|
// label: "Deutsch",
|
||||||
|
// direction: "ltr",
|
||||||
|
// htmlLang: "de-DE",
|
||||||
|
// calendar: "gregory",
|
||||||
|
// path: "de",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
|
|
||||||
presets: [
|
presets: [
|
||||||
@@ -92,6 +115,10 @@ const config: Config = {
|
|||||||
// label: "GitHub",
|
// label: "GitHub",
|
||||||
// position: "right",
|
// position: "right",
|
||||||
// },
|
// },
|
||||||
|
// {
|
||||||
|
// type: "localeDropdown",
|
||||||
|
// position: "right",
|
||||||
|
// },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
|
|||||||
*/
|
*/
|
||||||
const sidebars: SidebarsConfig = {
|
const sidebars: SidebarsConfig = {
|
||||||
// By default, Docusaurus generates a sidebar from the docs folder structure
|
// By default, Docusaurus generates a sidebar from the docs folder structure
|
||||||
|
// docsSidebar: [
|
||||||
|
// { type: "doc", id: "intro" },
|
||||||
|
// { type: "doc", id: "install" },
|
||||||
|
// { type: "doc", id: "ocp/ocp" },
|
||||||
|
// ],
|
||||||
docsSidebar: [{ type: "autogenerated", dirName: "." }],
|
docsSidebar: [{ type: "autogenerated", dirName: "." }],
|
||||||
|
|
||||||
// But you can create a sidebar manually
|
// But you can create a sidebar manually
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 220 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
@@ -6,7 +6,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"dev:app": "dotenvx run -f .env -- tsx watch app/src/main.ts",
|
"dev:app": "dotenvx run -f .env -- tsx watch app/src/main.ts",
|
||||||
"dev:docs": "cd lstDocs && npm start",
|
"dev:docs": "npm run translateDocs && cd lstDocs && npm start",
|
||||||
"dev:front": "cd frontend && npm run dev",
|
"dev:front": "cd frontend && npm run dev",
|
||||||
"dev": "npm run dev:app",
|
"dev": "npm run dev:app",
|
||||||
"copy:docs": "node scripts/lstDocCopy.mjs",
|
"copy:docs": "node scripts/lstDocCopy.mjs",
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
"commit": "cz",
|
"commit": "cz",
|
||||||
"deploy": "standard-version --conventional-commits && npm run build",
|
"deploy": "standard-version --conventional-commits && npm run build",
|
||||||
"db:migrate": "npx drizzle-kit push --config=drizzle-dev.config.ts",
|
"db:migrate": "npx drizzle-kit push --config=drizzle-dev.config.ts",
|
||||||
"db:generate": "npx drizzle-kit generate --config=drizzle-dev.config.ts"
|
"db:generate": "npx drizzle-kit generate --config=drizzle-dev.config.ts",
|
||||||
|
"translateDocs": "cd scripts && node translateScript.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
88
scripts/translateScript.js
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
// scripts/sync-translations.js
|
||||||
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
|
const locales = ["en", "es", "de"];
|
||||||
|
|
||||||
|
const docsDir = path.join(process.cwd(), "../lstDocs/docs"); // canonical English docs
|
||||||
|
const i18nDir = path.join(process.cwd(), "../lstDocs/i18n"); // output localized docs
|
||||||
|
const langDir = path.join(process.cwd(), "../lang"); // json translations
|
||||||
|
|
||||||
|
// load translations
|
||||||
|
const translations = {};
|
||||||
|
for (const locale of locales) {
|
||||||
|
const filePath = path.join(langDir, `${locale}.json`);
|
||||||
|
translations[locale] = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// lookup helper with English fallback
|
||||||
|
function t(key, locale) {
|
||||||
|
return translations[locale][key] || translations["en"][key] || key;
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy directory recursively
|
||||||
|
function copyDir(src, dest) {
|
||||||
|
if (!fs.existsSync(src)) return;
|
||||||
|
fs.mkdirSync(dest, { recursive: true });
|
||||||
|
for (const item of fs.readdirSync(src)) {
|
||||||
|
const s = path.join(src, item);
|
||||||
|
const d = path.join(dest, item);
|
||||||
|
const stat = fs.statSync(s);
|
||||||
|
if (stat.isDirectory()) copyDir(s, d);
|
||||||
|
else fs.copyFileSync(s, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// recursive doc processor
|
||||||
|
function processDir(srcDir, relDir = "") {
|
||||||
|
for (const item of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
||||||
|
const srcPath = path.join(srcDir, item.name);
|
||||||
|
const relPath = path.join(relDir, item.name);
|
||||||
|
|
||||||
|
if (item.isDirectory()) {
|
||||||
|
processDir(srcPath, relPath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.isFile() && item.name.endsWith(".md")) {
|
||||||
|
const baseContent = fs.readFileSync(srcPath, "utf8");
|
||||||
|
|
||||||
|
for (const locale of locales) {
|
||||||
|
// replace keys with translations
|
||||||
|
const localizedContent = baseContent.replace(
|
||||||
|
/([a-z]+(\.[a-z]+)+)/g,
|
||||||
|
(match) => t(match, locale)
|
||||||
|
);
|
||||||
|
|
||||||
|
// output directory preserves structure
|
||||||
|
const outDir = path.join(
|
||||||
|
i18nDir,
|
||||||
|
locale,
|
||||||
|
"docusaurus-plugin-content-docs/current",
|
||||||
|
relDir
|
||||||
|
);
|
||||||
|
fs.mkdirSync(outDir, { recursive: true });
|
||||||
|
|
||||||
|
const outFile = path.join(outDir, item.name);
|
||||||
|
fs.writeFileSync(outFile, localizedContent, "utf8");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there's an "img" folder alongside docs, copy it once for each locale
|
||||||
|
if (item.isDirectory() && item.name === "img") {
|
||||||
|
for (const locale of locales) {
|
||||||
|
const outDir = path.join(
|
||||||
|
i18nDir,
|
||||||
|
locale,
|
||||||
|
"docusaurus-plugin-content-docs/current",
|
||||||
|
relDir,
|
||||||
|
"img"
|
||||||
|
);
|
||||||
|
copyDir(srcPath, outDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// run
|
||||||
|
processDir(docsDir);
|
||||||
@@ -17,7 +17,14 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"app/src",
|
"app/src",
|
||||||
"scripts/**/*.ts",
|
"scripts/**/*.ts",
|
||||||
"database/testFiles/test-tiPostOrders.ts"
|
"database/testFiles/test-tiPostOrders.ts",
|
||||||
|
"scripts/translateScript.js"
|
||||||
],
|
],
|
||||||
"exclude": ["node_modules", "frontend", "dist", "lstDocs","database/testFiles"]
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"frontend",
|
||||||
|
"dist",
|
||||||
|
"lstDocs",
|
||||||
|
"database/testFiles"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||