mirror of https://gitee.com/answerdev/answer.git
18 lines
435 B
Go
18 lines
435 B
Go
|
package translator
|
||
|
|
||
|
import (
|
||
|
"github.com/google/wire"
|
||
|
myTran "github.com/segmentfault/pacman/contrib/i18n"
|
||
|
"github.com/segmentfault/pacman/i18n"
|
||
|
)
|
||
|
|
||
|
// ProviderSet is providers.
|
||
|
var ProviderSet = wire.NewSet(NewTranslator)
|
||
|
var GlobalTrans i18n.Translator
|
||
|
|
||
|
// NewTranslator new a translator
|
||
|
func NewTranslator(c *I18n) (tr i18n.Translator, err error) {
|
||
|
GlobalTrans, err = myTran.NewTranslator(c.BundleDir)
|
||
|
return GlobalTrans, err
|
||
|
}
|