コード例 #1
0
ファイル: i18n.go プロジェクト: beatgammit/ginta
/*
	Returns a resource by simple name matching
*/
func (l Locale) GetResource(key string) (string, error) {
	locale := string(l)
	internal.Activate(locale)
	return internal.Request(locale, key, false)
}
コード例 #2
0
ファイル: i18n.go プロジェクト: beatgammit/ginta
/*
	Resolves a resource by its hierarchical key.
*/
func (l Locale) ResolveResource(k types.HierarchicalKey) (string, error) {
	locale := string(l)
	internal.Activate(locale)
	return internal.Request(locale, string(k), true)
}