示例#1
0
文件: i18n.go 项目: fujitsu-cf/cli
func loadAsset(assetName string) {
	assetBytes, err := resources.Asset(assetName)
	if err != nil {
		panic(fmt.Sprintf("Could not load asset '%s': %s", assetName, err.Error()))
	}

	err = go_i18n.ParseTranslationFileBytes(assetName, assetBytes)
	if err != nil {
		panic(fmt.Sprintf("Could not load translations '%s': %s", assetName, err.Error()))
	}
}
示例#2
0
文件: i18n.go 项目: fujitsu-cf/cli
func loadAsset(assetName string) error {
	assetBytes, err := resources.Asset(assetName)
	if err != nil {
		return fmt.Errorf("Could not load asset '%s': %s", assetName, err.Error())
	}

	err = i18n.ParseTranslationFileBytes(assetName, assetBytes)
	if err != nil {
		return fmt.Errorf("Could not load translations '%s': %s", assetName, err.Error())
	}
	return nil
}