feat:multi cluster application

This commit is contained in:
pengcong06
2020-05-25 22:38:03 +08:00
parent d4b7d88b4b
commit 59839439d5
73 changed files with 9838 additions and 6278 deletions

View File

@@ -13,15 +13,20 @@ import (
"google.golang.org/grpc/status"
"openpitrix.io/openpitrix/pkg/logger"
"openpitrix.io/openpitrix/pkg/pb"
"openpitrix.io/openpitrix/pkg/util/ctxutil"
)
const En = "en"
const ZhCN = "zh_cn"
const DefaultLocale = ZhCN
const DefaultLocale = En
func newStatus(ctx context.Context, code codes.Code, err error, errMsg ErrorMessage, a ...interface{}) *status.Status {
locale := DefaultLocale
locale := ctxutil.GetLocale(ctx)
if len(locale) == 0 {
locale = DefaultLocale
}
s := status.New(code, errMsg.Message(locale, err, a...))