Skip to content

Commit

Permalink
Fix the bug that the translation json file cannot be loaded in the wi…
Browse files Browse the repository at this point in the history
…ndow system
  • Loading branch information
gouguoyin committed Oct 29, 2022
1 parent 09b0ad7 commit 25443e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions language.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package carbon
import (
"encoding/json"
"fmt"
"os"
"strconv"
"strings"

Expand All @@ -13,7 +12,7 @@ import (
var (
// default directory
// 默认目录
defaultDir = "lang"
defaultDir = "lang/"

// default locale
// 默认区域
Expand Down Expand Up @@ -55,7 +54,7 @@ func (lang *Language) SetLocale(locale string) {
box := packr.NewBox(lang.dir)
localeName := locale + ".json"
bytes, err := box.Find(localeName)
localePath := lang.dir + string(os.PathSeparator) + localeName
localePath := lang.dir + localeName
if err != nil {
lang.Error = invalidLocaleError(localePath)
return
Expand Down

0 comments on commit 25443e2

Please sign in to comment.