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:
@@ -8,7 +8,6 @@ import (
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/helper"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
|
||||
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/setting"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
)
|
||||
|
||||
type ConvertorHandlerContract interface {
|
||||
@@ -134,25 +133,19 @@ func (h ConvertorHandler) checkingFFPathUtilities() bool {
|
||||
func (h ConvertorHandler) saveSettingFFPath(ffmpegPath string, ffprobePath string, ffplayPath string) error {
|
||||
ffmpegChecking, _ := h.app.GetConvertorService().ChangeFFmpegPath(ffmpegPath)
|
||||
if ffmpegChecking == false {
|
||||
errorText := h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "errorFFmpeg",
|
||||
})
|
||||
errorText := h.app.GetLocalizerService().GetMessage("errorFFmpeg")
|
||||
return errors.New(errorText)
|
||||
}
|
||||
|
||||
ffprobeChecking, _ := h.app.GetConvertorService().ChangeFFprobePath(ffprobePath)
|
||||
if ffprobeChecking == false {
|
||||
errorText := h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "errorFFprobe",
|
||||
})
|
||||
errorText := h.app.GetLocalizerService().GetMessage("errorFFprobe")
|
||||
return errors.New(errorText)
|
||||
}
|
||||
|
||||
ffplayChecking, _ := h.app.GetConvertorService().ChangeFFplayPath(ffplayPath)
|
||||
if ffplayChecking == false {
|
||||
errorText := h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
||||
MessageID: "errorFFplay",
|
||||
})
|
||||
errorText := h.app.GetLocalizerService().GetMessage("errorFFplay")
|
||||
return errors.New(errorText)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user