Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix daemon packaging error #529

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions langselector1/locale.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ func (lang *LangSelector) deleteLocale(locale string) error {
return nil
}

func getCurrentLocaleRegion() (string, error) {
func getCurrentLocaleRegion(path string) (string, error) {
var currentLocaleRegion string

infos, err := readEnvFile(localeConfigFile)
infos, err := readEnvFile(path)
if err != nil {
return currentLocaleRegion, err
}
Expand All @@ -692,7 +692,7 @@ func getCurrentLocaleRegion() (string, error) {

// 获取当前用户的locale region, 如果没有设置过,使用系统的locale region
func (lang *LangSelector) getLocaleRegion() (string, error) {
l, err := getCurrentLocaleRegion()
l, err := getCurrentLocaleRegion(localeConfigFile)
if err != nil {
logger.Warning("failed to get current locale region", err)
return lang.CurrentLocale, nil
Expand Down
2 changes: 1 addition & 1 deletion langselector1/locale_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ func Test_WriteLocaleRegionsEnvFile(t *testing.T) {
}

func Test_getCurrentLocaleRegione(t *testing.T) {
_, err := getCurrentLocaleRegion()
_, err := getCurrentLocaleRegion("testdata/pam_environment")
assert.NoError(t, err)
}
Loading