catalog.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
  2. package ui
  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 := messageKeyToIndex[key]
  14. start, end := d.index[p], d.index[p+1]
  15. if start == end {
  16. return "", false
  17. }
  18. return d.data[start:end], true
  19. }
  20. func init() {
  21. dict := map[string]catalog.Dictionary{
  22. "en": &dictionary{index: enIndex, data: enData},
  23. "fr": &dictionary{index: frIndex, data: frData},
  24. }
  25. fallback := language.MustParse("en")
  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{
  33. "On Post": 0,
  34. }
  35. var enIndex = []uint32{ // 2 elements
  36. 0x00000000, 0x00000008,
  37. } // Size: 32 bytes
  38. const enData string = "\x02On Post"
  39. var frIndex = []uint32{ // 2 elements
  40. 0x00000000, 0x00000000,
  41. } // Size: 32 bytes
  42. const frData string = ""
  43. // Total table size 72 bytes (0KiB); checksum: B4FE2088