Версия 0.3.0 #3

Merged
kor-elf merged 13 commits from develop into main 2024-02-04 20:50:55 +06:00
3 changed files with 12 additions and 13 deletions
Showing only changes of commit f09dd01b6d - Show all commits

View File

@ -135,15 +135,15 @@ func (h ConvertorHandler) checkingFFPath() bool {
return true
}
type progress struct {
type Progress struct {
totalDuration float64
progressbar *widget.ProgressBar
protocol string
localizerService localizer.ServiceContract
}
func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) progress {
return progress{
func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) Progress {
return Progress{
totalDuration: totalDuration,
progressbar: progressbar,
protocol: "pipe:",
@ -151,11 +151,11 @@ func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localiz
}
}
func (p progress) GetProtocole() string {
func (p Progress) GetProtocole() string {
return p.protocol
}
func (p progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error {
func (p Progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error {
isProcessCompleted := false
var errorText string

View File

@ -61,7 +61,7 @@ func (h MenuHandler) GetMainMenu() *fyne.MainMenu {
func (h MenuHandler) LanguageSelection() {
h.localizerView.LanguageSelection(func(lang localizer.Lang) {
h.localizerRepository.Save(lang.Code)
_, _ = h.localizerRepository.Save(lang.Code)
h.menuMessageReload()
h.convertorHandler.MainConvertor()
})

View File

@ -68,12 +68,12 @@ func initLanguages(directory string, bundle *i18n.Bundle) ([]Lang, error) {
return nil, err
}
for _, file := range files {
language, err := bundle.LoadMessageFile(file)
lang, err := bundle.LoadMessageFile(file)
if err != nil {
return nil, err
}
title := cases.Title(language.Tag).String(display.Self.Name(language.Tag))
languages = append(languages, Lang{Code: language.Tag.String(), Title: title})
title := cases.Title(lang.Tag).String(display.Self.Name(lang.Tag))
languages = append(languages, Lang{Code: lang.Tag.String(), Title: title})
}
sort.Sort(languagesSort(languages))
@ -103,13 +103,12 @@ func (s Service) SetCurrentLanguage(lang Lang) error {
}
func (s Service) SetCurrentLanguageByCode(code string) error {
language, err := language.Parse(code)
lang, err := language.Parse(code)
if err != nil {
return err
}
title := cases.Title(language).String(display.Self.Name(language))
lang := Lang{Code: language.String(), Title: title}
return s.SetCurrentLanguage(lang)
title := cases.Title(lang).String(display.Self.Name(lang))
return s.SetCurrentLanguage(Lang{Code: lang.String(), Title: title})
}
func (s Service) GetCurrentLanguage() *CurrentLanguage {