Add i18n support #5

Closed
stne3960 wants to merge 13 commits from basic-scaffolding-frontend-lingui into basic-scaffolding-frontend
6 changed files with 1134 additions and 1130 deletions
Showing only changes of commit 52d5dcf91b - Show all commits

View File

@ -1,3 +0,0 @@
{
"plugins": ["@lingui/babel-plugin-lingui-macro"]
}

15
frontend/.swcrc Normal file
View File

@ -0,0 +1,15 @@
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"experimental": {
"plugins": [
[
"@lingui/swc-plugin",
{
// Additional Configuration
}
]
]
}
}
}

View File

@ -9,5 +9,4 @@ export default defineConfig({
include: ["src"],
},
],
compileNamespace: "ts",
});

File diff suppressed because it is too large Load Diff

View File

@ -4,17 +4,15 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "concurrently \"npm:dev:vite\" \"npm:i18n:watch\"",
"dev:vite": "vite",
"build": "lingui compile --typescript && tsc -b && vite build",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"format": "prettier . --write",
"update-api": "openapi-typescript http://localhost:8080/v3/api-docs --output src/lib/api.d.ts",
"preview": "vite preview",
"extract": "lingui extract",
"extract-clean": "lingui extract --clean",
"compile": "lingui compile --typescript",
"i18n:watch": "lingui compile --typescript --watch"
"compile": "lingui compile --typescript"
},
"dependencies": {
"@lingui/react": "^5.3.0",
@ -25,13 +23,12 @@
},
"devDependencies": {
"@eslint/js": "^9.21.0",
"@lingui/babel-plugin-lingui-macro": "^5.3.0",
"@lingui/cli": "^5.3.0",
"@lingui/swc-plugin": "^5.5.1",
"@lingui/vite-plugin": "^5.3.0",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-react": "^4.3.4",
"concurrently": "^9.1.2",
"@vitejs/plugin-react-swc": "^3.8.0",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-react-hooks": "^5.1.0",
@ -42,5 +39,8 @@
"typescript": "~5.7.2",
"typescript-eslint": "^8.24.1",
"vite": "^6.2.0"
},
"overrides": {
"@swc/core": "1.3.56"
}
}

View File

@ -1,16 +1,11 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import react from "@vitejs/plugin-react-swc";
import { lingui } from "@lingui/vite-plugin";
export default defineConfig({
build: {
target: "esnext",
},
plugins: [
react({
babel: {
plugins: ["@lingui/babel-plugin-lingui-macro"],
},
plugins: [["@lingui/swc-plugin", {}]],
}),
lingui(),
],