[add] migrate fs & i18n

This commit is contained in:
Max 2023-02-02 11:29:58 +08:00
parent bee77eca24
commit a9f304060b
3 changed files with 6 additions and 6 deletions

View file

@ -9,7 +9,7 @@ COMMIT := $(shell git log | head -n 1 | awk '{print substr($$2, 0, 12)}')
NOW := $(shell date +"%FT%T%z")
# ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TESTFOLDER := $(shell $(GO) list ./... | grep -E 'api|model|flow|script' | grep -vE 'examples|tests*|config|widgets')
TESTFOLDER := $(shell $(GO) list ./... | grep -E 'api|model|flow|script|fs|i18n' | grep -vE 'examples|tests*|config|widgets')
TESTTAGS ?= ""
# TESTWIDGETS := $(shell $(GO) list ./widgets/...)

View file

@ -3,7 +3,6 @@ package i18n
import (
"crypto/sha256"
"fmt"
"path/filepath"
"strings"
"sync"
"time"
@ -45,8 +44,7 @@ func Load(cfg config.Config) error {
}
// Load langs
root := filepath.Join(cfg.Root, "langs")
err = lang.Load(root)
err = lang.Load("langs")
if err != nil {
return err
}

View file

@ -6,11 +6,13 @@ import (
"github.com/stretchr/testify/assert"
"github.com/yaoapp/gou/lang"
"github.com/yaoapp/yao/config"
"github.com/yaoapp/yao/share"
"github.com/yaoapp/yao/test"
)
func TestLoad(t *testing.T) {
share.DBConnect(config.Conf.DB)
test.Prepare(t, config.Conf)
defer test.Clean()
err := Load(config.Conf)
if err != nil {
t.Fatal(err)