| // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. |
| |
| package main |
| |
| import ( |
| "golang.org/x/text/language" |
| "golang.org/x/text/message" |
| "golang.org/x/text/message/catalog" |
| ) |
| |
| type dictionary struct { |
| index []uint32 |
| data string |
| } |
| |
| func (d *dictionary) Lookup(key string) (data string, ok bool) { |
| p, ok := messageKeyToIndex[key] |
| if !ok { |
| return "", false |
| } |
| start, end := d.index[p], d.index[p+1] |
| if start == end { |
| return "", false |
| } |
| return d.data[start:end], true |
| } |
| |
| func init() { |
| dict := map[string]catalog.Dictionary{} |
| fallback := language.MustParse("en-US") |
| cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) |
| if err != nil { |
| panic(err) |
| } |
| message.DefaultCatalog = cat |
| } |
| |
| var messageKeyToIndex = map[string]int{} |