func GetTranslationFunc(reader LocaleReader) (TranslateFunc, error) {
	locale, err := determineLocale(reader)
	if err != nil {
		locale = defaultLocale
	}
	rawTranslation, err := loadAssetFromResources(locale)
	if err != nil {
		rawTranslation, err = loadAssetFromResources(defaultLocale)
		if err != nil {
			return nil, err
		}
	}
	return generateTranslationFunc(rawTranslation)
}
GetTranslationFunc will return back a function that can be used to translate
strings into the currently set locale.
package ui
import (
	"bytes"
	"encoding/json"
	"fmt"
	"strings"
	"text/template"
	"code.cloudfoundry.org/cli/i18n/resources"
	"golang.org/x/text/language"
)
const (
	assetPath = "resources/%s.all.json"
	chineseBase = "zh"
	defaultLocale = "en-us"
	unspecifiedScript = "Zzzz"
)
type LocaleReader interface {
	Locale() string
}
type TranslationEntry struct {
	ID string `json:"id"`
	Translation string `json:"translation"`
}
type TranslateFunc func(translationID string, args ...interface{}) string