generated from dave/wails-template
Implement localization
This commit is contained in:
12
app.go
12
app.go
@@ -125,3 +125,15 @@ func (a *App) SelectDirectory() (res StringResponse) {
|
||||
res.Data = path
|
||||
return
|
||||
}
|
||||
|
||||
func (a *App) GetLocale() string {
|
||||
if settings.Locale == "" {
|
||||
return "en"
|
||||
}
|
||||
return settings.Locale
|
||||
}
|
||||
|
||||
func (a *App) SetLocale(locale string) error {
|
||||
settings.Locale = locale
|
||||
return SaveSettings(*settings)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user