remove old code, add german lang

This commit is contained in:
Eduard Gert
2026-05-15 12:56:09 +02:00
parent 17cae1a75c
commit 5411fa4350
25 changed files with 175 additions and 827 deletions

View File

@@ -2,10 +2,10 @@
// This file is automatically generated. DO NOT EDIT
/**
* I18n holds the embedded translation bundles and serves them to both the
* tray (Translate, used on every menu rebuild) and the frontend (Bundle,
* optional Wails-bound endpoint for runtime fetches). The bundles are
* loaded once at construction and never mutated.
* I18n is the Wails-bound facade over i18n.Bundle. It exists only to give
* the binding generator a service type with the context.Context-first
* signatures it expects; the translation logic, locale loading and the
* LanguageCode type all live in client/ui/i18n.
* @module
*/
@@ -15,50 +15,30 @@ import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Cr
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
import * as i18n$0 from "../i18n/models.js";
/**
* Bundle returns the full key->text map for one language. Bound to React via
* Wails as an optional endpoint — the frontend can either import the JSON
* files directly through Vite or fetch them through this RPC. The returned
* map is a copy.
* Bundle returns the full key->text map for one language, letting the
* React side drive its own translation library (i18next, etc.) off the
* same source bundles the tray uses.
*/
export function Bundle(code: string): $CancellablePromise<{ [_ in string]?: string }> {
export function Bundle(code: i18n$0.LanguageCode): $CancellablePromise<{ [_ in string]?: string }> {
return $Call.ByID(1780869897, code).then(($result: any) => {
return $$createType0($result);
});
}
/**
* HasLanguage reports whether a bundle is loaded for the given code.
* Preferences.SetLanguage uses this to validate input.
* Languages exposes the list of shipped locales to the frontend so the
* settings page can populate its language picker.
*/
export function HasLanguage(code: string): $CancellablePromise<boolean> {
return $Call.ByID(3348861033, code);
}
/**
* Languages returns the list of available locales. Bound to React via Wails
* so the settings page can populate its language selector.
*/
export function Languages(): $CancellablePromise<$models.Language[]> {
export function Languages(): $CancellablePromise<i18n$0.Language[]> {
return $Call.ByID(768152924).then(($result: any) => {
return $$createType2($result);
});
}
/**
* Translate resolves key for the given language with a placeholder pass.
* Args must come in {placeholderName, value} pairs (e.g. "version", "1.2.3"
* substitutes "{version}"). Unknown keys fall back to the default language;
* if even that fails, the key itself is returned (debug-friendly — a missed
* key is visible in the UI rather than blank).
*/
export function Translate(lang: string, key: string, ...args: string[]): $CancellablePromise<string> {
return $Call.ByID(2739709937, lang, key, args);
}
// Private type creation functions
const $$createType0 = $Create.Map($Create.Any, $Create.Any);
const $$createType1 = $models.Language.createFrom;
const $$createType1 = i18n$0.Language.createFrom;
const $$createType2 = $Create.Array($$createType1);

View File

@@ -36,7 +36,6 @@ export {
DebugBundleResult,
Features,
ForwardingRule,
Language,
LocalPeer,
LogLevel,
LoginParams,
@@ -53,7 +52,6 @@ export {
SetConfigParams,
Status,
SystemEvent,
UIPreferences,
UpParams,
UpdateAvailable,
UpdateProgress,

View File

@@ -344,41 +344,6 @@ export class ForwardingRule {
}
}
/**
* Language describes one shipped UI locale. Code is the BCP-47-ish key the
* frontend and the preferences file use; DisplayName is shown in the language
* picker in its own script (so a Hungarian user sees "Magyar" even when the
* current UI language is English).
*/
export class Language {
"code": string;
"displayName": string;
"englishName": string;
/** Creates a new Language instance. */
constructor($$source: Partial<Language> = {}) {
if (!("code" in $$source)) {
this["code"] = "";
}
if (!("displayName" in $$source)) {
this["displayName"] = "";
}
if (!("englishName" in $$source)) {
this["englishName"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new Language instance from a string or object.
*/
static createFrom($$source: any = {}): Language {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new Language($$parsedSource as Partial<Language>);
}
}
/**
* LocalPeer mirrors LocalPeerState — what this client looks like on the mesh.
*/
@@ -1073,32 +1038,6 @@ export class SystemEvent {
}
}
/**
* UIPreferences is the user-scope UI state mirrored to disk and to the
* frontend. Pointer-free because the whole document is rewritten on every
* change — there are no per-field partial updates.
*/
export class UIPreferences {
"language": string;
/** Creates a new UIPreferences instance. */
constructor($$source: Partial<UIPreferences> = {}) {
if (!("language" in $$source)) {
this["language"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new UIPreferences instance from a string or object.
*/
static createFrom($$source: any = {}): UIPreferences {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new UIPreferences($$parsedSource as Partial<UIPreferences>);
}
}
/**
* UpParams selects the profile the daemon should bring up.
*/

View File

@@ -2,9 +2,10 @@
// This file is automatically generated. DO NOT EDIT
/**
* Preferences is the user-scope UI preferences service. Read at app start,
* updated by the React settings page (Wails-bound SetLanguage), and observed
* by the tray which re-renders its menu in the new language.
* Preferences is the Wails-bound facade over preferences.Store. The store
* itself owns persistence and the subscription channel; this type just
* re-exposes Get and SetLanguage with the context.Context-first signature
* the Wails binding generator wants.
* @module
*/
@@ -14,34 +15,26 @@ import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Cr
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
import * as i18n$0 from "../i18n/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as preferences$0 from "../preferences/models.js";
/**
* Get returns a copy of the current preferences. Bound to React via Wails.
* Get returns the current user-scope preferences.
*/
export function Get(): $CancellablePromise<$models.UIPreferences> {
export function Get(): $CancellablePromise<preferences$0.UIPreferences> {
return $Call.ByID(3500743391).then(($result: any) => {
return $$createType0($result);
});
}
/**
* SetLanguage validates and persists a new language preference, then
* broadcasts the change to the frontend and to internal subscribers (tray).
* Bound to React via Wails.
* SetLanguage validates and persists a new UI language.
*/
export function SetLanguage(lang: string): $CancellablePromise<void> {
export function SetLanguage(lang: i18n$0.LanguageCode): $CancellablePromise<void> {
return $Call.ByID(3710099805, lang);
}
/**
* Subscribe returns a channel that receives every persisted change. The
* unsubscribe function closes the channel and removes it from the list;
* callers must not close the channel themselves.
*/
export function Subscribe(): $CancellablePromise<[any, any]> {
return $Call.ByID(2696446779);
}
// Private type creation functions
const $$createType0 = $models.UIPreferences.createFrom;
const $$createType0 = preferences$0.UIPreferences.createFrom;

View File

@@ -6,6 +6,9 @@
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as preferences$0 from "../../../../netbirdio/netbird/client/ui/preferences/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as services$0 from "../../../../netbirdio/netbird/client/ui/services/models.js";
@@ -22,7 +25,7 @@ function configure() {
// Private type creation functions
const $$createType0 = services$0.SystemEvent.createFrom;
const $$createType1 = services$0.UIPreferences.createFrom;
const $$createType1 = preferences$0.UIPreferences.createFrom;
const $$createType2 = services$0.Status.createFrom;
const $$createType3 = services$0.UpdateAvailable.createFrom;
const $$createType4 = services$0.UpdateProgress.createFrom;

View File

@@ -5,6 +5,9 @@
// @ts-ignore: Unused imports
import type { Events } from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import type * as preferences$0 from "../../../../netbirdio/netbird/client/ui/preferences/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import type * as services$0 from "../../../../netbirdio/netbird/client/ui/services/models.js";
@@ -13,7 +16,7 @@ declare module "@wailsio/runtime" {
namespace Events {
interface CustomEvents {
"netbird:event": services$0.SystemEvent;
"netbird:preferences:changed": services$0.UIPreferences;
"netbird:preferences:changed": preferences$0.UIPreferences;
"netbird:status": services$0.Status;
"netbird:update:available": services$0.UpdateAvailable;
"netbird:update:progress": services$0.UpdateProgress;