mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-05 13:09:07 +02:00
[client] UI refactor (#6069)
Refactor UI --------- Co-authored-by: Eduard Gert <kontakt@eduardgert.de> Co-authored-by: braginini <bangvalo@gmail.com> Co-authored-by: Pascal Fischer <32096965+pascal-fischer@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: riccardom <riccardomanfrin@gmail.com>
This commit is contained in:
co-authored by
Eduard Gert
braginini
Pascal Fischer
Claude
riccardom
parent
679c7182a4
commit
8b7ce337d8
@@ -0,0 +1,30 @@
|
||||
//go:build !android && !ios && !freebsd && !js
|
||||
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/netbirdio/netbird/client/ui/i18n"
|
||||
)
|
||||
|
||||
// I18n is the Wails-bound facade over i18n.Bundle; the translation logic lives
|
||||
// in client/ui/i18n.
|
||||
type I18n struct {
|
||||
bundle *i18n.Bundle
|
||||
}
|
||||
|
||||
func NewI18n(bundle *i18n.Bundle) *I18n {
|
||||
return &I18n{bundle: bundle}
|
||||
}
|
||||
|
||||
// Languages returns the shipped locales.
|
||||
func (s *I18n) Languages(_ context.Context) ([]i18n.Language, error) {
|
||||
return s.bundle.Languages(), nil
|
||||
}
|
||||
|
||||
// Bundle returns the full key->text map so the React side can drive its own
|
||||
// translation library off the same source bundles.
|
||||
func (s *I18n) Bundle(_ context.Context, code i18n.LanguageCode) (map[string]string, error) {
|
||||
return s.bundle.BundleFor(code)
|
||||
}
|
||||
Reference in New Issue
Block a user