Refactor localization system and migrate to Fyne's built-in support
Replaced the `i18n` and `toml` dependencies with Fyne's built-in language system for localization management. Updated the `Localizer` implementation to handle translations using JSON files and embed functionality. Simplified language selection and persisted settings via Fyne's preferences API.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
fyneTheme "fyne.io/fyne/v2/theme"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
"image/color"
|
||||
)
|
||||
|
||||
@@ -92,25 +91,19 @@ func (inf themeInfo) GetVariant() fyne.ThemeVariant {
|
||||
|
||||
func getThemes(localizer kernel.LocalizerContract) map[string]ThemeInfoContract {
|
||||
themesNameDefault := &themeInfo{
|
||||
name: "default",
|
||||
title: localizer.GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "themesNameDefault",
|
||||
}),
|
||||
name: "default",
|
||||
title: localizer.GetMessage("themesNameDefault"),
|
||||
}
|
||||
|
||||
themesNameLight := &themeInfo{
|
||||
name: "light",
|
||||
title: localizer.GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "themesNameLight",
|
||||
}),
|
||||
name: "light",
|
||||
title: localizer.GetMessage("themesNameLight"),
|
||||
variant: fyneTheme.VariantLight,
|
||||
}
|
||||
|
||||
themesNameDark := &themeInfo{
|
||||
name: "dark",
|
||||
title: localizer.GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "themesNameDark",
|
||||
}),
|
||||
name: "dark",
|
||||
title: localizer.GetMessage("themesNameDark"),
|
||||
variant: fyneTheme.VariantDark,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user