feat: Add i18n support and adapt for Headscale v0.28 (with ACL management)#98
feat: Add i18n support and adapt for Headscale v0.28 (with ACL management)#98serein-213 wants to merge 14 commits into
Conversation
- Integrated svelte-i18n for localization. - Extracted hardcoded strings to locale files. - Added English (en) and Chinese Simplified (zh) localizations.
- Updated API integration for Headscale v0.27/v0.28 changes. - Added ACL management UI (Policies, SSH Rules, Groups, Tag Owners). - Refactored state management using States.svelte.ts.
9965274 to
b6c54b5
Compare
…icies - Implemented ExportModal for exporting data in JSON and CSV formats. - Added BatchOperationsBar for batch actions on nodes including delete and tag operations. - Enhanced nodes, routes, settings, and users pages with export buttons. - Created export utility functions for various data types. - Introduced a new page for displaying individual node details. - Updated Svelte configuration for base path handling. - Added support for batch operations in the nodes view.
…ve error handling
|
many of the ui features reference |
Align Headscale 0.28 API and add first-run language gate
Good catch. At the moment, localizations in this project are maintained manually rather than generated automatically. We load the locale files directly through svelte-i18n, and there is currently no extraction/sync script in the project to generate missing keys or enforce key ordering. So in practice, new localization entries are added by hand to src/lib/locales/en.json and src/lib/locales/zh.json, and the JSON key order is also maintained manually to match the existing structure. In this PR, I missed syncing several cards.* entries into the English locale file. Those keys do exist in zh.json, and some of them are already referenced by the UI, but they were not added to en.json. I’ll follow up by syncing the missing English keys and aligning the ordering with the existing locale structure. Longer term, I agree it would be better to add a small validation or sync step so missing localization keys and ordering drift can be caught automatically. |
29fac93 to
b388ca9
Compare
|
awesome, just tested 07cf626 and locale is now looking great! long term, it would be no small feat to add community translation through something like tolgee. now, just waiting on @GoodiesHQ ... |
Description
This PR integrates Internationalization (i18n) support and updates the admin panel to fully support Headscale v0.28.0 features, including a new ACL management interface.
I have organized the changes into two clean commits for easier review:
Key Changes
🌐 Internationalization (i18n)
svelte-i18nto handle localization.🚀 Headscale v0.28 Features
States.svelte.tsfor improved reactivity.Motivation
To make the tool accessible to non-English speakers and to expose the powerful ACL configuration features available in newer Headscale versions.
Testing
en/zhlanguage switching.