Replace i18next with next-intl for translations and dynamic imports. Refactor System API calls to use os.platform() for accurate platform detection. Simplify and clean up dependencies in package.json.

This commit is contained in:
natreex
2025-12-24 15:57:18 -05:00
parent a315e96633
commit 55cd5d8ed0
4 changed files with 28 additions and 3504 deletions

View File

@@ -1,7 +1,7 @@
import {faSearch} from "@fortawesome/free-solid-svg-icons"; import {faSearch} from "@fortawesome/free-solid-svg-icons";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {ChangeEvent, Dispatch, SetStateAction} from "react"; import {ChangeEvent, Dispatch, SetStateAction} from "react";
import {t} from "i18next"; import {useTranslations} from "next-intl";
import TextInput from "@/components/form/TextInput"; import TextInput from "@/components/form/TextInput";
export default function SearchBook( export default function SearchBook(
@@ -12,6 +12,7 @@ export default function SearchBook(
searchQuery: string; searchQuery: string;
setSearchQuery: Dispatch<SetStateAction<string>> setSearchQuery: Dispatch<SetStateAction<string>>
}) { }) {
const t = useTranslations();
return ( return (
<div className="flex items-center relative my-5 w-full max-w-3xl"> <div className="flex items-center relative my-5 w-full max-w-3xl">

View File

@@ -1,5 +1,7 @@
import axios, {AxiosResponse} from "axios"; import axios, {AxiosResponse} from "axios";
import {configs} from "@/lib/configs"; import {configs} from "@/lib/configs";
import * as electron from "electron";
import * as os from "node:os";
export default class System{ export default class System{
static verifyInput(input: string): boolean { static verifyInput(input: string): boolean {
@@ -34,7 +36,7 @@ export default class System{
}, },
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
...params ...params
}, },
url: configs.apiUrl + url, url: configs.apiUrl + url,
@@ -75,7 +77,7 @@ export default class System{
}, },
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
}, },
url: configs.apiUrl + url, url: configs.apiUrl + url,
data: data data: data
@@ -103,7 +105,7 @@ export default class System{
}, },
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
}, },
url: configs.apiUrl + url, url: configs.apiUrl + url,
data: data data: data
@@ -131,7 +133,7 @@ export default class System{
url: configs.apiUrl + url, url: configs.apiUrl + url,
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
}, },
data: data data: data
}) })
@@ -159,7 +161,7 @@ export default class System{
url: configs.apiUrl + url, url: configs.apiUrl + url,
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
}, },
data: data data: data
}) })
@@ -218,7 +220,7 @@ export default class System{
url: configs.apiUrl + url, url: configs.apiUrl + url,
params: { params: {
lang: lang, lang: lang,
plateforme: 'web', plateforme: os.platform(),
}, },
data: data data: data
}) })

3497
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{ {
"name": "eritorsscribe", "name": "eritorsscribe",
"productName": "ERitors Scribe", "productName": "ERitors Scribe",
"version": "1.0.0", "version": "0.0.1",
"type": "module", "type": "module",
"main": "dist/electron/main.js", "main": "dist/electron/main.js",
"scripts": { "scripts": {
@@ -17,27 +17,18 @@
"description": "", "description": "",
"devDependencies": { "devDependencies": {
"@electron/notarize": "^3.1.1", "@electron/notarize": "^3.1.1",
"@types/js-cookie": "^3.0.6",
"@types/jsonwebtoken": "^9.0.10", "@types/jsonwebtoken": "^9.0.10",
"@types/node": "^24.10.1", "@types/node": "^24.10.1",
"@types/react": "^19.2.5", "@types/react": "^19.2.5",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"concurrently": "^9.2.1", "concurrently": "^9.2.1",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"electron": "^39.2.1", "electron": "^39.2.1",
"electron-builder": "^26.0.12", "electron-builder": "^26.0.12",
"electron-rebuild": "^3.2.9",
"electronmon": "^2.0.4",
"esbuild": "^0.27.2",
"tsx": "^4.20.6",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vite": "^7.2.2",
"vite-plugin-electron-renderer": "^0.14.6",
"wait-on": "^9.0.3" "wait-on": "^9.0.3"
}, },
"dependencies": { "dependencies": {
"@emotion/css": "^11.13.5",
"@fortawesome/fontawesome-svg-core": "^7.1.0", "@fortawesome/fontawesome-svg-core": "^7.1.0",
"@fortawesome/free-brands-svg-icons": "^7.1.0", "@fortawesome/free-brands-svg-icons": "^7.1.0",
"@fortawesome/free-regular-svg-icons": "^7.1.0", "@fortawesome/free-regular-svg-icons": "^7.1.0",
@@ -52,22 +43,15 @@
"@tiptap/react": "^3.10.7", "@tiptap/react": "^3.10.7",
"@tiptap/starter-kit": "^3.10.7", "@tiptap/starter-kit": "^3.10.7",
"@types/bcrypt": "^6.0.0", "@types/bcrypt": "^6.0.0",
"antd": "^5.28.1",
"autoprefixer": "^10.4.22", "autoprefixer": "^10.4.22",
"axios": "^1.13.2", "axios": "^1.13.2",
"bcrypt": "^6.0.0", "bcrypt": "^6.0.0",
"i18next": "^25.6.2",
"js-cookie": "^3.0.5",
"next": "^16.0.3", "next": "^16.0.3",
"next-export-i18n": "^2.4.3",
"next-intl": "^4.5.3", "next-intl": "^4.5.3",
"node-sqlite3-wasm": "^0.8.51", "node-sqlite3-wasm": "^0.8.51",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"react": "^19.2.0", "react": "^19.2.0",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
"react-i18next": "^16.3.3",
"react-router-dom": "^7.9.6",
"react-slick": "^0.31.0",
"tailwindcss": "^4.1.17" "tailwindcss": "^4.1.17"
}, },
"build": { "build": {