From 2fa7c464f019f67c5c0494aaf5ac0f5ecc1ee7a7 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 16 Jan 2018 12:03:31 -0500 Subject: Updated dependencies and added avct/uasurfer (#8089) * Updated dependencies and added avct/uasurfer * Added uasurfer to NOTICE.txt --- vendor/golang.org/x/text/message/catalog.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'vendor/golang.org/x/text/message/catalog.go') diff --git a/vendor/golang.org/x/text/message/catalog.go b/vendor/golang.org/x/text/message/catalog.go index 2f65b4bbc..068271def 100644 --- a/vendor/golang.org/x/text/message/catalog.go +++ b/vendor/golang.org/x/text/message/catalog.go @@ -12,10 +12,18 @@ import ( "golang.org/x/text/message/catalog" ) +// MatchLanguage reports the matched tag obtained from language.MatchStrings for +// the Matcher of the DefaultCatalog. +func MatchLanguage(preferred ...string) language.Tag { + c := DefaultCatalog + tag, _ := language.MatchStrings(c.Matcher(), preferred...) + return tag +} + // DefaultCatalog is used by SetString. -var DefaultCatalog *catalog.Catalog = defaultCatalog +var DefaultCatalog catalog.Catalog = defaultCatalog -var defaultCatalog = catalog.New() +var defaultCatalog = catalog.NewBuilder() // SetString calls SetString on the initial default Catalog. func SetString(tag language.Tag, key string, msg string) error { -- cgit v1.2.3-1-g7c22