Skip to content

Commit d542824

Browse files
authored
feat(preferences): add api port to preference option (#631)
* feat(preferences): add api port to preference option * revert(non rleated files): workflow and contributing * fix(localizations): properly setup and use localizations
1 parent 8e14be7 commit d542824

File tree

22 files changed

+175
-2
lines changed

22 files changed

+175
-2
lines changed

scripts/api-generate.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const child_process = require('node:child_process')
22
const { styleText } = require('node:util')
3+
const Store = require('electron-store')
34

4-
const url = `http://localhost:4321/swagger/json`
5+
const store = new Store({ name: 'preferences', cwd: 'v2' })
6+
const apiPort = store.get('apiPort', 4321)
7+
const url = `http://localhost:${apiPort}/swagger/json`
58

69
async function generateApi() {
710
try {

src/main/i18n/locales/cs_CZ/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Renderer kódových bloků"
49+
},
50+
"api": {
51+
"label": "API Port",
52+
"port": {
53+
"label": "API Port",
54+
"description": "Číslo portu pro API server (vyžaduje restart aplikace). Platný rozsah: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/de_DE/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Code-Block Renderer"
49+
},
50+
"api": {
51+
"label": "API-Port",
52+
"port": {
53+
"label": "API-Port",
54+
"description": "Portnummer für den API-Server (erfordert Neustart der App). Gültiger Bereich: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/el_GR/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Code block Renderer"
49+
},
50+
"api": {
51+
"label": "Θύρα API",
52+
"port": {
53+
"label": "Θύρα API",
54+
"description": "Αριθμός θύρας για τον διακομιστή API (απαιτείται επανεκκίνηση της εφαρμογής). Έγκυρο εύρος: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/en_US/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,12 @@
6868
"markdown": {
6969
"label": "Markdown",
7070
"codeRenderer": "Code block Renderer"
71+
},
72+
"api": {
73+
"label": "API Port",
74+
"port": {
75+
"label": "API Port",
76+
"description": "Port number for the API server (requires app restart to take effect). Valid range: 1024-65535."
77+
}
7178
}
7279
}

src/main/i18n/locales/es_ES/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Renderizador de Bloques de Código"
49+
},
50+
"api": {
51+
"label": "Puerto API",
52+
"port": {
53+
"label": "Puerto API",
54+
"description": "Número de puerto para el servidor API (requiere reiniciar la aplicación). Rango válido: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/fa_IR/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "رندرکننده بلوک کد"
49+
},
50+
"api": {
51+
"label": "پورت API",
52+
"port": {
53+
"label": "پورت API",
54+
"description": "شماره پورت برای سرور API (نیاز به راه‌اندازی مجدد برنامه دارد). محدوده معتبر: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/fr_FR/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Rendu des blocs de code"
49+
},
50+
"api": {
51+
"label": "Port API",
52+
"port": {
53+
"label": "Port API",
54+
"description": "Numéro de port pour le serveur API (nécessite un redémarrage de l'application). Plage valide: 1024-65535."
55+
}
4956
}
5057
}

src/main/i18n/locales/ja_JP/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "コードブロックレンダラー"
49+
},
50+
"api": {
51+
"label": "APIポート",
52+
"port": {
53+
"label": "APIポート",
54+
"description": "APIサーバーのポート番号(アプリの再起動が必要です)。有効範囲:1024-65535。"
55+
}
4956
}
5057
}

src/main/i18n/locales/pl_PL/preferences.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@
4646
"markdown": {
4747
"label": "Markdown",
4848
"codeRenderer": "Renderer bloków kodu"
49+
},
50+
"api": {
51+
"label": "Port API",
52+
"port": {
53+
"label": "Port API",
54+
"description": "Numer portu dla serwera API (wymaga ponownego uruchomienia aplikacji). Prawidłowy zakres: 1024-65535."
55+
}
4956
}
5057
}

0 commit comments

Comments
 (0)