catalog.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. "de": &dictionary{index: deIndex, data: deData},
  26. "en_US": &dictionary{index: en_USIndex, data: en_USData},
  27. "zh": &dictionary{index: zhIndex, data: zhData},
  28. }
  29. fallback := language.MustParse("en-US")
  30. cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback))
  31. if err != nil {
  32. panic(err)
  33. }
  34. message.DefaultCatalog = cat
  35. }
  36. var messageKeyToIndex = map[string]int{
  37. "%.2[1]f miles traveled (%[1]f)": 8,
  38. "%[1]s is visiting %[3]s!\n": 3,
  39. "%d files remaining!": 5,
  40. "%d more files remaining!": 4,
  41. "%s is out of order!": 7,
  42. "%s is visiting %s!\n": 2,
  43. "Hello %s!\n": 1,
  44. "Hello world!\n": 0,
  45. "Use the following code for your discount: %d\n": 6,
  46. }
  47. var deIndex = []uint32{ // 10 elements
  48. 0x00000000, 0x00000011, 0x00000023, 0x0000003d,
  49. 0x00000057, 0x00000076, 0x00000076, 0x00000076,
  50. 0x00000076, 0x00000076,
  51. } // Size: 64 bytes
  52. const deData string = "" + // Size: 118 bytes
  53. "\x04\x00\x01\x0a\x0c\x02Hallo Welt!\x04\x00\x01\x0a\x0d\x02Hallo %[1]s!" +
  54. "\x04\x00\x01\x0a\x15\x02%[1]s besucht %[2]s!\x04\x00\x01\x0a\x15\x02%[1]" +
  55. "s besucht %[3]s!\x02Noch %[1]d Bestände zu gehen!"
  56. var en_USIndex = []uint32{ // 10 elements
  57. 0x00000000, 0x00000012, 0x00000024, 0x00000042,
  58. 0x00000060, 0x000000a3, 0x000000ba, 0x000000ef,
  59. 0x00000106, 0x00000125,
  60. } // Size: 64 bytes
  61. const en_USData string = "" + // Size: 293 bytes
  62. "\x04\x00\x01\x0a\x0d\x02Hello world!\x04\x00\x01\x0a\x0d\x02Hello %[1]sn" +
  63. "\x04\x00\x01\x0a\x19\x02%[1]s is visiting %[2]s!\x04\x00\x01\x0a\x19\x02" +
  64. "%[1]s is visiting %[3]s!\x14\x01\x81\x01\x00\x02\x14\x02One file remaini" +
  65. "ng!\x00&\x02There are %[1]d more files remaining!\x02%[1]d files remaini" +
  66. "ng!\x04\x00\x01\x0a0\x02Use the following code for your discount: %[1]d" +
  67. "\x02%[1]s is out of order!\x02%.2[1]f miles traveled (%[1]f)"
  68. var zhIndex = []uint32{ // 10 elements
  69. 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  70. 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  71. 0x00000000, 0x00000000,
  72. } // Size: 64 bytes
  73. const zhData string = ""
  74. // Total table size 603 bytes (0KiB); checksum: 1D2754EE