Skip to content

Commit 5363baa

Browse files
committed
Add inlang/paraglide-js localization
Remove the temporary directory after extracting buildkit Localize the extension popovers. Update package and fix tsconfig.json Expand development directory guide Move messages under localization Popovers and sidebar Update Chinese translations Accidentally lost the changes that @ym provided, brought them back File formatting pass Localized all components, hooks, providers, hooks Localize all pages except Settings Bump packages Settings Access page Settings local auth page Fix ref lint warning Settings Advanced page Fix UI lint warnings There were a bunch of ref and useEffect violations. Settings appearance page Settings general pages Settings hardware page Settings keyboard page Settings macros pages Settings mouse page Settings page Settings video page Settings network page Fix compilation issues Ran machine translate
1 parent e755a6e commit 5363baa

File tree

124 files changed

+10668
-2084
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+10668
-2084
lines changed

.devcontainer/docker/devcontainer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
}
99
},
1010
"mounts": [
11-
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
11+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
12+
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
1213
],
1314
"onCreateCommand": ".devcontainer/install-deps.sh",
1415
"customizations": {
@@ -31,8 +32,11 @@
3132
// Frontend
3233
"esbenp.prettier-vscode",
3334
"dbaeumer.vscode-eslint",
34-
"bradlc.vscode-tailwindcss"
35+
"bradlc.vscode-tailwindcss",
36+
"codeandstuff.package-json-upgrade",
37+
// Localization
38+
"inlang.vs-code-extension"
3539
]
3640
}
3741
}
38-
}
42+
}

.devcontainer/install-deps.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ wget https://github.com/jetkvm/rv1106-system/releases/download/${BUILDKIT_VERSIO
3232
sudo mkdir -p /opt/jetkvm-native-buildkit && \
3333
sudo tar --use-compress-program="unzstd --long=31" -xvf buildkit.tar.zst -C /opt/jetkvm-native-buildkit && \
3434
rm buildkit.tar.zst
35-
popd
35+
popd
36+
rm -rf "${BUILDKIT_TMPDIR}"

.vscode/extensions.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"recommendations": [
3+
// coding styles
4+
"chrislajoie.vscode-modelines",
5+
"editorconfig.editorconfig",
6+
// GitHub
7+
"GitHub.vscode-pull-request-github",
8+
"github.vscode-github-actions",
9+
// Golang
10+
"golang.go",
11+
// C / C++
12+
"ms-vscode.cpptools",
13+
"ms-vscode.cpptools-extension-pack",
14+
// CMake / Makefile
15+
"ms-vscode.makefile-tools",
16+
"ms-vscode.cmake-tools",
17+
// Frontend
18+
"esbenp.prettier-vscode",
19+
"dbaeumer.vscode-eslint",
20+
"bradlc.vscode-tailwindcss",
21+
"codeandstuff.package-json-upgrade",
22+
// Localization
23+
"inlang.vs-code-extension"
24+
]
25+
}

DEVELOPMENT.md

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -97,38 +97,42 @@ tail -f /var/log/jetkvm.log
9797

9898
```
9999
/kvm/
100-
├── main.go # App entry point
101-
├── config.go # Settings & configuration
102-
├── display.go # Device UI control
103-
├── web.go # API endpoints
104-
├── cmd/ # Command line main
105-
├── internal/ # Internal Go packages
106-
│ ├── confparser/ # Configuration file implementation
107-
│ ├── hidrpc/ # HIDRPC implementation for HID devices (keyboard, mouse, etc.)
108-
│ ├── logging/ # Logging implementation
109-
│ ├── mdns/ # mDNS implementation
110-
│ ├── native/ # CGO / Native code glue layer (on-device hardware)
111-
│ │ ├── cgo/ # C files for the native library (HDMI, Touchscreen, etc.)
112-
│ │ └── eez/ # EEZ Studio Project files (for Touchscreen)
113-
│ ├── network/ # Network implementation
114-
│ ├── timesync/ # Time sync/NTP implementation
115-
│ ├── tzdata/ # Timezone data and generation
116-
│ ├── udhcpc/ # DHCP implementation
117-
│ ├── usbgadget/ # USB gadget
118-
│ ├── utils/ # SSH handling
119-
│ └── websecure/ # TLS certificate management
120-
├── resource/ # netboot iso and other resources
121-
├── scripts/ # Bash shell scripts for building and deploying
122-
└── static/ # (react client build output)
123-
└── ui/ # React frontend
124-
├── public/ # UI website static images and fonts
125-
└── src/ # Client React UI
126-
├── assets/ # UI in-page images
127-
├── components/ # UI components
128-
├── hooks/ # Hooks (stores, RPC handling, virtual devices)
129-
├── keyboardLayouts/ # Keyboard layout definitions
130-
├── providers/ # Feature flags
131-
└── routes/ # Pages (login, settings, etc.)
100+
├── main.go # App entry point
101+
├── config.go # Settings & configuration
102+
├── display.go # Device UI control
103+
├── web.go # API endpoints
104+
├── cmd/ # Command line main
105+
├── internal/ # Internal Go packages
106+
│ ├── confparser/ # Configuration file implementation
107+
│ ├── hidrpc/ # HIDRPC implementation for HID devices (keyboard, mouse, etc.)
108+
│ ├── logging/ # Logging implementation
109+
│ ├── mdns/ # mDNS implementation
110+
│ ├── native/ # CGO / Native code glue layer (on-device hardware)
111+
│ │ ├── cgo/ # C files for the native library (HDMI, Touchscreen, etc.)
112+
│ │ └── eez/ # EEZ Studio Project files (for Touchscreen)
113+
│ ├── network/ # Network implementation
114+
│ ├── timesync/ # Time sync/NTP implementation
115+
│ ├── tzdata/ # Timezone data and generation
116+
│ ├── udhcpc/ # DHCP implementation
117+
│ ├── usbgadget/ # USB gadget
118+
│ ├── utils/ # SSH handling
119+
│ └── websecure/ # TLS certificate management
120+
├── resource/ # netboot iso and other resources
121+
├── scripts/ # Bash shell scripts for building and deploying
122+
└── static/ # (react client build output)
123+
└── ui/ # React frontend
124+
├── localization/ # Client UI localization (i18n)
125+
│ ├── jetKVM.UI.inlang/ # Settings for inlang
126+
│ └── messages/ # Messages localized
127+
├── public/ # UI website static images and fonts
128+
└── src/ # Client React UI
129+
├── assets/ # UI in-page images
130+
├── components/ # UI components
131+
├── hooks/ # Hooks (stores, RPC handling, virtual devices)
132+
├── keyboardLayouts/ # Keyboard layout definitions
133+
│ ├── paraglide/ # (localization compiled messages output)
134+
├── providers/ # Feature flags
135+
└── routes/ # Pages (login, settings, etc.)
132136
```
133137

134138
**Key files for beginners:**

ui/eslint.config.cjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const {
99
fixupConfigRules,
1010
} = require("@eslint/compat");
1111

12-
const tsParser = require("@typescript-eslint/parser");
13-
const reactRefresh = require("eslint-plugin-react-refresh");
1412
const js = require("@eslint/js");
1513

1614
const {
@@ -23,6 +21,9 @@ const compat = new FlatCompat({
2321
allConfig: js.configs.all
2422
});
2523

24+
const tsParser = require("@typescript-eslint/parser");
25+
const reactRefresh = require("eslint-plugin-react-refresh");
26+
2627
module.exports = defineConfig([{
2728
languageOptions: {
2829
globals: {
@@ -66,7 +67,7 @@ module.exports = defineConfig([{
6667
groups: ["builtin", "external", "internal", "parent", "sibling"],
6768
"newlines-between": "always",
6869
}],
69-
70+
7071
"@typescript-eslint/no-unused-vars": ["warn", {
7172
"argsIgnorePattern": "^_", "varsIgnorePattern": "^_"
7273
}],
@@ -81,7 +82,10 @@ module.exports = defineConfig([{
8182
map: [
8283
["@components", "./src/components"],
8384
["@routes", "./src/routes"],
85+
["@hooks", "./src/hooks"],
86+
["@providers", "./src/providers"],
8487
["@assets", "./src/assets"],
88+
["@localizations", "./localization/paraglide"],
8589
["@", "./src"],
8690
],
8791

ui/index.html

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,39 @@
4545
<link rel="shortcut icon" href="/favicon.ico" />
4646
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
4747
<meta name="apple-mobile-web-app-title" content="JetKVM" />
48-
<link rel="manifest" href="/site.webmanifest" />
48+
<link rel="manifest" href="/public/site.webmanifest" />
4949
<meta name="theme-color" content="#051946" />
50-
<meta name="description" content="A web-based KVM console for managing remote servers." />
50+
<meta
51+
name="description"
52+
content="A web-based KVM console for managing remote servers."
53+
/>
5154
<script>
5255
function applyThemeFromPreference() {
5356
// dark theme setup
54-
var darkDesired = localStorage.theme === "dark" ||
57+
var darkDesired =
58+
localStorage.theme === "dark" ||
5559
(!("theme" in localStorage) &&
56-
window.matchMedia("(prefers-color-scheme: dark)").matches)
60+
window.matchMedia("(prefers-color-scheme: dark)").matches);
5761

58-
document.documentElement.classList.toggle("dark", darkDesired)
62+
document.documentElement.classList.toggle("dark", darkDesired);
5963
}
6064

6165
// initial theme application
6266
applyThemeFromPreference();
6367

6468
// Listen for system theme changes
65-
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", applyThemeFromPreference);
66-
window.matchMedia("(prefers-color-scheme: light)").addEventListener("change", applyThemeFromPreference);
69+
window
70+
.matchMedia("(prefers-color-scheme: dark)")
71+
.addEventListener("change", applyThemeFromPreference);
72+
window
73+
.matchMedia("(prefers-color-scheme: light)")
74+
.addEventListener("change", applyThemeFromPreference);
6775
</script>
6876
</head>
6977
<body
70-
class="h-full w-full bg-[#f3f9ff] font-sans text-sm antialiased dark:bg-slate-900 md:text-base"
78+
class="h-full w-full bg-[#f3f9ff] font-sans text-sm antialiased md:text-base dark:bg-slate-900"
7179
>
72-
<div id="root" class="w-full h-full"></div>
80+
<div id="root" class="h-full w-full"></div>
7381
<script type="module" src="/src/main.tsx"></script>
7482
</body>
7583
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TI1a2RjjH4qkImNj0w
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://inlang.com/schema/project-settings",
3+
"baseLocale": "en",
4+
"sourceLanguageTag": "en",
5+
"locales": [
6+
"en",
7+
"da",
8+
"de",
9+
"es",
10+
"fr",
11+
"it",
12+
"nb",
13+
"sv",
14+
"zh"
15+
],
16+
"languageTags": [
17+
"en",
18+
"da",
19+
"de",
20+
"es",
21+
"fr",
22+
"it",
23+
"nb",
24+
"sv",
25+
"zh"
26+
],
27+
"modules": [
28+
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
29+
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
30+
],
31+
"plugin.inlang.messageFormat": {
32+
"pathPattern": "./messages/{locale}.json"
33+
},
34+
"strategy": [
35+
"cookie",
36+
"localStorage",
37+
"preferredLanguage",
38+
"baseLocale"
39+
]
40+
}

0 commit comments

Comments
 (0)