catalog_gen.go 774 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
  2. package main
  3. import (
  4. "golang.org/x/text/language"
  5. "golang.org/x/text/message"
  6. "golang.org/x/text/message/catalog"
  7. )
  8. type dictionary struct {
  9. index []uint32
  10. data string
  11. }
  12. func (d *dictionary) Lookup(key string) (data string, ok bool) {
  13. p, ok := messageKeyToIndex[key]
  14. if !ok {
  15. return "", false
  16. }
  17. start, end := d.index[p], d.index[p+1]
  18. if start == end {
  19. return "", false
  20. }
  21. return d.data[start:end], true
  22. }
  23. func init() {
  24. dict := map[string]catalog.Dictionary{}
  25. fallback := language.MustParse("en-US")
  26. cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback))
  27. if err != nil {
  28. panic(err)
  29. }
  30. message.DefaultCatalog = cat
  31. }
  32. var messageKeyToIndex = map[string]int{}