mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
use i18n resource item to replace ambiguous configuration item
This commit is contained in:
@@ -145,8 +145,6 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultAppName string = "ezBookkeeping"
|
||||
|
||||
defaultHttpAddr string = "0.0.0.0"
|
||||
defaultHttpPort uint16 = 8080
|
||||
defaultDomain string = "localhost"
|
||||
@@ -267,7 +265,6 @@ type MultiLanguageContentConfig struct {
|
||||
// Config represents the global setting config
|
||||
type Config struct {
|
||||
// Global
|
||||
AppName string
|
||||
Mode SystemMode
|
||||
WorkingPath string
|
||||
|
||||
@@ -595,8 +592,6 @@ func GetDefaultConfigFilePath() (string, error) {
|
||||
}
|
||||
|
||||
func loadGlobalConfiguration(config *Config, configFile *ini.File, sectionName string) error {
|
||||
config.AppName = getConfigItemStringValue(configFile, sectionName, "app_name", defaultAppName)
|
||||
|
||||
if getConfigItemStringValue(configFile, sectionName, "mode") == "production" {
|
||||
config.Mode = MODE_PRODUCTION
|
||||
} else if getConfigItemStringValue(configFile, sectionName, "mode") == "development" {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package settings
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mayswind/ezbookkeeping/pkg/core"
|
||||
)
|
||||
|
||||
// ConfigContainer contains the current setting config
|
||||
type ConfigContainer struct {
|
||||
@@ -27,8 +31,8 @@ func (c *ConfigContainer) GetCurrentConfig() *Config {
|
||||
|
||||
func GetUserAgent() string {
|
||||
if Version == "" {
|
||||
return "ezBookkeeping"
|
||||
return core.ApplicationName
|
||||
}
|
||||
|
||||
return fmt.Sprintf("ezBookkeeping/%s", Version)
|
||||
return fmt.Sprintf("%s/%s", core.ApplicationName, Version)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user