Basic GUI client, login dialog, various comments fixes after copypaste.
Some checks failed
Linting and tests / Linting (push) Failing after 6s
Some checks failed
Linting and tests / Linting (push) Failing after 6s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package translations
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
@@ -12,7 +13,11 @@ import (
|
||||
"fyne.io/fyne/v2/lang"
|
||||
)
|
||||
|
||||
var _ = core.Translations(&translations{})
|
||||
var (
|
||||
_ = core.Translations(&translations{})
|
||||
|
||||
errTranslations = errors.New("translations core service")
|
||||
)
|
||||
|
||||
type translations struct {
|
||||
app *application.Application
|
||||
@@ -20,14 +25,14 @@ type translations struct {
|
||||
mainWindow core.MainWindow
|
||||
}
|
||||
|
||||
// Initialize инициализирует сервис.
|
||||
// Initialize initializes service.
|
||||
func Initialize(app *application.Application) error {
|
||||
transl := &translations{
|
||||
app: app,
|
||||
}
|
||||
|
||||
if err := app.RegisterService(transl); err != nil {
|
||||
return fmt.Errorf("%w: %w", core.ErrOptions, err)
|
||||
return fmt.Errorf("%w: %w", errTranslations, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -67,7 +72,7 @@ func (t *translations) Initialize() error {
|
||||
t.logger.Info("Current system locale.", "locale", lang.SystemLocale().String(), "LANG", langFromEnv)
|
||||
|
||||
if err := lang.AddTranslationsFS(langfiles.LangFiles, "files"); err != nil {
|
||||
return fmt.Errorf("%w: load translations: %w", core.ErrTranslations, err)
|
||||
return fmt.Errorf("%w: load translations: %w", errTranslations, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user