mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Update vendor dependencies
This commit is contained in:
parent
34a3fe426b
commit
459bb4531f
747 changed files with 89857 additions and 39711 deletions
3
vendor/golang.org/x/text/cmd/gotext/common.go
generated
vendored
3
vendor/golang.org/x/text/cmd/gotext/common.go
generated
vendored
|
@ -21,9 +21,6 @@ const (
|
|||
// NOTE: The command line tool already prefixes with "gotext:".
|
||||
var (
|
||||
wrap = func(err error, msg string) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("%s: %v", msg, err)
|
||||
}
|
||||
errorf = fmt.Errorf
|
||||
|
|
28
vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go
generated
vendored
28
vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go
generated
vendored
|
@ -47,26 +47,24 @@ var messageKeyToIndex = map[string]int{
|
|||
}
|
||||
|
||||
var deIndex = []uint32{ // 8 elements
|
||||
0x00000000, 0x00000011, 0x00000023, 0x0000003d,
|
||||
0x00000057, 0x00000076, 0x00000076, 0x00000076,
|
||||
0x00000000, 0x0000000d, 0x0000001b, 0x00000031,
|
||||
0x00000047, 0x00000066, 0x00000066, 0x00000066,
|
||||
} // Size: 56 bytes
|
||||
|
||||
const deData string = "" + // Size: 118 bytes
|
||||
"\x04\x00\x01\x0a\x0c\x02Hallo Welt!\x04\x00\x01\x0a\x0d\x02Hallo %[1]s!" +
|
||||
"\x04\x00\x01\x0a\x15\x02%[1]s besucht %[2]s!\x04\x00\x01\x0a\x15\x02%[1]" +
|
||||
"s besucht %[3]s!\x02Noch %[1]d Bestände zu gehen!"
|
||||
const deData string = "" + // Size: 102 bytes
|
||||
"\x02Hallo Welt!\x0a\x02Hallo %[1]s!\x0a\x02%[1]s besucht %[2]s!\x0a\x02%" +
|
||||
"[1]s besucht %[3]s!\x0a\x02Noch %[1]d Bestände zu gehen!"
|
||||
|
||||
var en_USIndex = []uint32{ // 8 elements
|
||||
0x00000000, 0x00000012, 0x00000024, 0x00000042,
|
||||
0x00000060, 0x000000a3, 0x000000ba, 0x000000d9,
|
||||
0x00000000, 0x0000000e, 0x0000001c, 0x00000036,
|
||||
0x00000050, 0x00000093, 0x000000aa, 0x000000c9,
|
||||
} // Size: 56 bytes
|
||||
|
||||
const en_USData string = "" + // Size: 217 bytes
|
||||
"\x04\x00\x01\x0a\x0d\x02Hello world!\x04\x00\x01\x0a\x0d\x02Hello %[1]s!" +
|
||||
"\x04\x00\x01\x0a\x19\x02%[1]s is visiting %[2]s!\x04\x00\x01\x0a\x19\x02" +
|
||||
"%[1]s is visiting %[3]s!\x14\x01\x81\x01\x00\x02\x14\x02One file remaini" +
|
||||
"ng!\x00&\x02There are %[1]d more files remaining!\x02%[1]s is out of ord" +
|
||||
"er!\x02%.2[1]f miles traveled (%[1]f)"
|
||||
const en_USData string = "" + // Size: 201 bytes
|
||||
"\x02Hello world!\x0a\x02Hello %[1]s!\x0a\x02%[1]s is visiting %[2]s!\x0a" +
|
||||
"\x02%[1]s is visiting %[3]s!\x0a\x04\x01\x81\x01\x00\x02\x14\x02One file" +
|
||||
" remaining!\x00&\x02There are %[1]d more files remaining!\x02%[1]s is ou" +
|
||||
"t of order!\x02%.2[1]f miles traveled (%[1]f)"
|
||||
|
||||
var zhIndex = []uint32{ // 8 elements
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
|
@ -75,4 +73,4 @@ var zhIndex = []uint32{ // 8 elements
|
|||
|
||||
const zhData string = ""
|
||||
|
||||
// Total table size 503 bytes (0KiB); checksum: A968BD6
|
||||
// Total table size 471 bytes (0KiB); checksum: 7746955
|
||||
|
|
34
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/messages.gotext.json
generated
vendored
34
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/messages.gotext.json
generated
vendored
|
@ -2,17 +2,17 @@
|
|||
"language": "de",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"translation": "Hallo Welt!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "Hallo Welt!\n",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:27:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"translation": "Hallo {City}!",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "Hallo {City}!\n",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "City",
|
||||
|
@ -26,10 +26,10 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:31:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"translation": "Hallo {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "Hallo {Town}!\n",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Town",
|
||||
|
@ -44,10 +44,10 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:35:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"translation": "{Person} besucht {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "{Person} besucht {Place}!\n",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Person",
|
||||
|
@ -71,10 +71,10 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:40:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"translation": "{Person} besucht {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "{Person} besucht {Place}!\n",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -123,9 +123,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:67:10"
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}",
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/out.gotext.json
generated
vendored
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/out.gotext.json
generated
vendored
|
@ -2,16 +2,16 @@
|
|||
"language": "de",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:28:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:32:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -44,9 +44,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:36:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -71,9 +71,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:41:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
|
@ -106,13 +106,13 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:56:10"
|
||||
},
|
||||
{
|
||||
"id": "{2} files remaining!",
|
||||
"id": "{} files remaining!",
|
||||
"key": "%d files remaining!",
|
||||
"message": "{2} files remaining!",
|
||||
"message": "{} files remaining!",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "2",
|
||||
"id": "",
|
||||
"string": "%[1]d",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
|
@ -140,9 +140,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:68:10"
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}",
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
32
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/messages.gotext.json
generated
vendored
32
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/messages.gotext.json
generated
vendored
|
@ -2,23 +2,23 @@
|
|||
"language": "en-US",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"translation": "Hello world!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "Hello world!\n",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:27:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"translation": "Hello {City}n"
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "Hello {City}!\n"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"translation": "Hello {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "Hello {Town}!\n",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Town",
|
||||
|
@ -32,16 +32,16 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "{Person} is visiting {Place}!\n"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"translation": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "{Person} is visiting {Place}!\n",
|
||||
"comment": "Person visiting a place."
|
||||
},
|
||||
{
|
||||
|
@ -60,9 +60,9 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}",
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": ""
|
||||
},
|
||||
{
|
||||
|
|
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/out.gotext.json
generated
vendored
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/out.gotext.json
generated
vendored
|
@ -2,16 +2,16 @@
|
|||
"language": "en-US",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:28:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:32:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -44,9 +44,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:36:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -71,9 +71,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:41:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
|
@ -106,13 +106,13 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:56:10"
|
||||
},
|
||||
{
|
||||
"id": "{2} files remaining!",
|
||||
"id": "{} files remaining!",
|
||||
"key": "%d files remaining!",
|
||||
"message": "{2} files remaining!",
|
||||
"message": "{} files remaining!",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "2",
|
||||
"id": "",
|
||||
"string": "%[1]d",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
|
@ -140,9 +140,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:68:10"
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}",
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
206
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/extracted.gotext.json
generated
vendored
Executable file
206
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/extracted.gotext.json
generated
vendored
Executable file
|
@ -0,0 +1,206 @@
|
|||
{
|
||||
"language": "en-US",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:28:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "City",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "city"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:32:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Town",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "town",
|
||||
"comment": "Town"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:36:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Person",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "person",
|
||||
"comment": "The person of matter."
|
||||
},
|
||||
{
|
||||
"id": "Place",
|
||||
"string": "%[2]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 2,
|
||||
"expr": "place",
|
||||
"comment": "Place the person is visiting."
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:41:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Person",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "pp.Person"
|
||||
},
|
||||
{
|
||||
"id": "Place",
|
||||
"string": "%[3]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 3,
|
||||
"expr": "pp.Place",
|
||||
"comment": "Place the person is visiting."
|
||||
},
|
||||
{
|
||||
"id": "Extra",
|
||||
"string": "%[2]v",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
"argNum": 2,
|
||||
"expr": "pp.extra"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:56:10"
|
||||
},
|
||||
{
|
||||
"id": "{} files remaining!",
|
||||
"key": "%d files remaining!",
|
||||
"message": "{} files remaining!",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "",
|
||||
"string": "%[1]d",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
"argNum": 1,
|
||||
"expr": "2"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:63:10"
|
||||
},
|
||||
{
|
||||
"id": "{N} more files remaining!",
|
||||
"key": "%d more files remaining!",
|
||||
"message": "{N} more files remaining!",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "N",
|
||||
"string": "%[1]d",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
"argNum": 1,
|
||||
"expr": "n"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:68:10"
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "ReferralCode",
|
||||
"string": "%[1]d",
|
||||
"type": "golang.org/x/text/cmd/gotext/examples/extract.referralCode",
|
||||
"underlyingType": "int",
|
||||
"argNum": 1,
|
||||
"expr": "c"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:74:10"
|
||||
},
|
||||
{
|
||||
"id": [
|
||||
"msgOutOfOrder",
|
||||
"{Device} is out of order!"
|
||||
],
|
||||
"key": "%s is out of order!",
|
||||
"message": "{Device} is out of order!",
|
||||
"translation": "",
|
||||
"comment": "FOO\n",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Device",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "device"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:82:10"
|
||||
},
|
||||
{
|
||||
"id": "{Miles} miles traveled ({Miles_1})",
|
||||
"key": "%.2[1]f miles traveled (%[1]f)",
|
||||
"message": "{Miles} miles traveled ({Miles_1})",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "Miles",
|
||||
"string": "%.2[1]f",
|
||||
"type": "float64",
|
||||
"underlyingType": "float64",
|
||||
"argNum": 1,
|
||||
"expr": "miles"
|
||||
},
|
||||
{
|
||||
"id": "Miles_1",
|
||||
"string": "%[1]f",
|
||||
"type": "float64",
|
||||
"underlyingType": "float64",
|
||||
"argNum": 1,
|
||||
"expr": "miles"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:86:10"
|
||||
}
|
||||
]
|
||||
}
|
20
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/messages.gotext.json
generated
vendored
20
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/messages.gotext.json
generated
vendored
|
@ -2,16 +2,16 @@
|
|||
"language": "zh",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:27:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:31:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -44,9 +44,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:35:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -71,9 +71,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:40:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
|
|
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/out.gotext.json
generated
vendored
30
vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/out.gotext.json
generated
vendored
|
@ -2,16 +2,16 @@
|
|||
"language": "zh",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello world!",
|
||||
"id": "Hello world!\n",
|
||||
"key": "Hello world!\n",
|
||||
"message": "Hello world!",
|
||||
"message": "Hello world!\n",
|
||||
"translation": "",
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:28:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {City}!",
|
||||
"id": "Hello {City}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {City}!",
|
||||
"message": "Hello {City}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -26,9 +26,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:32:10"
|
||||
},
|
||||
{
|
||||
"id": "Hello {Town}!",
|
||||
"id": "Hello {Town}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {Town}!",
|
||||
"message": "Hello {Town}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -44,9 +44,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:36:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%s is visiting %s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -71,9 +71,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:41:10"
|
||||
},
|
||||
{
|
||||
"id": "{Person} is visiting {Place}!",
|
||||
"id": "{Person} is visiting {Place}!\n",
|
||||
"key": "%[1]s is visiting %[3]s!\n",
|
||||
"message": "{Person} is visiting {Place}!",
|
||||
"message": "{Person} is visiting {Place}!\n",
|
||||
"translation": "",
|
||||
"comment": "Person visiting a place.",
|
||||
"placeholders": [
|
||||
|
@ -106,13 +106,13 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:56:10"
|
||||
},
|
||||
{
|
||||
"id": "{2} files remaining!",
|
||||
"id": "{} files remaining!",
|
||||
"key": "%d files remaining!",
|
||||
"message": "{2} files remaining!",
|
||||
"message": "{} files remaining!",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "2",
|
||||
"id": "",
|
||||
"string": "%[1]d",
|
||||
"type": "int",
|
||||
"underlyingType": "int",
|
||||
|
@ -140,9 +140,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract/main.go:68:10"
|
||||
},
|
||||
{
|
||||
"id": "Use the following code for your discount: {ReferralCode}",
|
||||
"id": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"key": "Use the following code for your discount: %d\n",
|
||||
"message": "Use the following code for your discount: {ReferralCode}",
|
||||
"message": "Use the following code for your discount: {ReferralCode}\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
8
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json
generated
vendored
8
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json
generated
vendored
|
@ -2,9 +2,9 @@
|
|||
"language": "de",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello {From}!",
|
||||
"id": "Hello {From}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {From}!",
|
||||
"message": "Hello {From}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -19,9 +19,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:22:11"
|
||||
},
|
||||
{
|
||||
"id": "Do you like your browser ({User_Agent})?",
|
||||
"id": "Do you like your browser ({User_Agent})?\n",
|
||||
"key": "Do you like your browser (%s)?\n",
|
||||
"message": "Do you like your browser ({User_Agent})?",
|
||||
"message": "Do you like your browser ({User_Agent})?\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
"language": "en-US",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello {From}!",
|
||||
"id": "Hello {From}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {From}!",
|
||||
"message": "Hello {From}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -19,9 +19,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:22:11"
|
||||
},
|
||||
{
|
||||
"id": "Do you like your browser ({User_Agent})?",
|
||||
"id": "Do you like your browser ({User_Agent})?\n",
|
||||
"key": "Do you like your browser (%s)?\n",
|
||||
"message": "Do you like your browser ({User_Agent})?",
|
||||
"message": "Do you like your browser ({User_Agent})?\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
39
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json
generated
vendored
Executable file
39
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json
generated
vendored
Executable file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"language": "en-US",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello {From}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {From}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "From",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "r.Header.Get(\"From\")"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:22:11"
|
||||
},
|
||||
{
|
||||
"id": "Do you like your browser ({User_Agent})?\n",
|
||||
"key": "Do you like your browser (%s)?\n",
|
||||
"message": "Do you like your browser ({User_Agent})?\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
"id": "User_Agent",
|
||||
"string": "%[1]s",
|
||||
"type": "string",
|
||||
"underlyingType": "string",
|
||||
"argNum": 1,
|
||||
"expr": "r.Header.Get(\"User-Agent\")"
|
||||
}
|
||||
],
|
||||
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:24:11"
|
||||
}
|
||||
]
|
||||
}
|
8
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json
generated
vendored
8
vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json
generated
vendored
|
@ -2,9 +2,9 @@
|
|||
"language": "zh",
|
||||
"messages": [
|
||||
{
|
||||
"id": "Hello {From}!",
|
||||
"id": "Hello {From}!\n",
|
||||
"key": "Hello %s!\n",
|
||||
"message": "Hello {From}!",
|
||||
"message": "Hello {From}!\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
@ -19,9 +19,9 @@
|
|||
"position": "golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go:22:11"
|
||||
},
|
||||
{
|
||||
"id": "Do you like your browser ({User_Agent})?",
|
||||
"id": "Do you like your browser ({User_Agent})?\n",
|
||||
"key": "Do you like your browser (%s)?\n",
|
||||
"message": "Do you like your browser ({User_Agent})?",
|
||||
"message": "Do you like your browser ({User_Agent})?\n",
|
||||
"translation": "",
|
||||
"placeholders": [
|
||||
{
|
||||
|
|
32
vendor/golang.org/x/text/cmd/gotext/extract.go
generated
vendored
32
vendor/golang.org/x/text/cmd/gotext/extract.go
generated
vendored
|
@ -11,6 +11,7 @@ import (
|
|||
"path/filepath"
|
||||
|
||||
"golang.org/x/text/internal"
|
||||
"golang.org/x/text/language"
|
||||
"golang.org/x/text/message/pipeline"
|
||||
)
|
||||
|
||||
|
@ -21,10 +22,12 @@ import (
|
|||
// - message rewriting
|
||||
|
||||
var (
|
||||
lang *string
|
||||
srcLang *string
|
||||
lang *string
|
||||
)
|
||||
|
||||
func init() {
|
||||
srcLang = cmdExtract.Flag.String("srclang", "en-US", "the source-code language")
|
||||
lang = cmdExtract.Flag.String("lang", "en-US", "comma-separated list of languages to process")
|
||||
}
|
||||
|
||||
|
@ -34,15 +37,30 @@ var cmdExtract = &Command{
|
|||
Short: "extracts strings to be translated from code",
|
||||
}
|
||||
|
||||
func runExtract(cmd *Command, config *pipeline.Config, args []string) error {
|
||||
config.Packages = args
|
||||
state, err := pipeline.Extract(config)
|
||||
func runExtract(cmd *Command, args []string) error {
|
||||
tag, err := language.Parse(*srcLang)
|
||||
if err != nil {
|
||||
return wrap(err, "extract failed")
|
||||
return wrap(err, "")
|
||||
}
|
||||
out := state.Extracted
|
||||
config := &pipeline.Config{
|
||||
SourceLanguage: tag,
|
||||
Packages: args,
|
||||
}
|
||||
out, err := pipeline.Extract(config)
|
||||
|
||||
langs := append(getLangs(), config.SourceLanguage)
|
||||
data, err := json.MarshalIndent(out, "", " ")
|
||||
if err != nil {
|
||||
return wrap(err, "")
|
||||
}
|
||||
os.MkdirAll(*dir, 0755)
|
||||
// TODO: this file can probably go if we replace the extract + generate
|
||||
// cycle with a init once and update cycle.
|
||||
file := filepath.Join(*dir, extractFile)
|
||||
if err := ioutil.WriteFile(file, data, 0644); err != nil {
|
||||
return wrap(err, "could not create file")
|
||||
}
|
||||
|
||||
langs := append(getLangs(), tag)
|
||||
langs = internal.UniqueTags(langs)
|
||||
for _, tag := range langs {
|
||||
// TODO: inject translations from existing files to avoid retranslation.
|
||||
|
|
83
vendor/golang.org/x/text/cmd/gotext/generate.go
generated
vendored
83
vendor/golang.org/x/text/cmd/gotext/generate.go
generated
vendored
|
@ -5,7 +5,16 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/text/message/pipeline"
|
||||
"golang.org/x/tools/go/loader"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -22,14 +31,74 @@ var cmdGenerate = &Command{
|
|||
Short: "generates code to insert translated messages",
|
||||
}
|
||||
|
||||
func runGenerate(cmd *Command, config *pipeline.Config, args []string) error {
|
||||
config.Packages = args
|
||||
s, err := pipeline.Extract(config)
|
||||
var transRe = regexp.MustCompile(`messages\.(.*)\.json`)
|
||||
|
||||
func runGenerate(cmd *Command, args []string) error {
|
||||
|
||||
prog, err := loadPackages(&loader.Config{}, args)
|
||||
if err != nil {
|
||||
return wrap(err, "extraction failed")
|
||||
return wrap(err, "could not load package")
|
||||
}
|
||||
if err := s.Import(); err != nil {
|
||||
return wrap(err, "import failed")
|
||||
|
||||
pkgs := prog.InitialPackages()
|
||||
if len(pkgs) != 1 {
|
||||
return fmt.Errorf("more than one package selected: %v", pkgs)
|
||||
}
|
||||
return wrap(s.Generate(), "generation failed")
|
||||
pkg := pkgs[0].Pkg.Name()
|
||||
|
||||
// TODO: add in external input. Right now we assume that all files are
|
||||
// manually created and stored in the textdata directory.
|
||||
|
||||
// Build up index of translations and original messages.
|
||||
extracted := pipeline.Locale{}
|
||||
translations := []*pipeline.Locale{}
|
||||
|
||||
err = filepath.Walk(*dir, func(path string, f os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return wrap(err, "loading data")
|
||||
}
|
||||
if f.IsDir() {
|
||||
return nil
|
||||
}
|
||||
if f.Name() == extractFile {
|
||||
b, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return wrap(err, "read file failed")
|
||||
}
|
||||
if err := json.Unmarshal(b, &extracted); err != nil {
|
||||
return wrap(err, "unmarshal source failed")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if f.Name() == outFile {
|
||||
return nil
|
||||
}
|
||||
if !strings.HasSuffix(path, gotextSuffix) {
|
||||
return nil
|
||||
}
|
||||
b, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return wrap(err, "read file failed")
|
||||
}
|
||||
var locale pipeline.Locale
|
||||
if err := json.Unmarshal(b, &locale); err != nil {
|
||||
return wrap(err, "parsing translation file failed")
|
||||
}
|
||||
translations = append(translations, &locale)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
w := os.Stdout
|
||||
if *out != "" {
|
||||
w, err = os.Create(*out)
|
||||
if err != nil {
|
||||
return wrap(err, "create file failed")
|
||||
}
|
||||
}
|
||||
|
||||
_, err = pipeline.Generate(w, pkg, &extracted, translations...)
|
||||
return err
|
||||
}
|
||||
|
|
27
vendor/golang.org/x/text/cmd/gotext/main.go
generated
vendored
27
vendor/golang.org/x/text/cmd/gotext/main.go
generated
vendored
|
@ -25,8 +25,6 @@ import (
|
|||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"golang.org/x/text/message/pipeline"
|
||||
|
||||
"golang.org/x/text/language"
|
||||
"golang.org/x/tools/go/buildutil"
|
||||
)
|
||||
|
@ -35,22 +33,7 @@ func init() {
|
|||
flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", buildutil.TagsFlagDoc)
|
||||
}
|
||||
|
||||
var (
|
||||
srcLang = flag.String("srclang", "en-US", "the source-code language")
|
||||
dir = flag.String("dir", "locales", "default subdirectory to store translation files")
|
||||
)
|
||||
|
||||
func config() (*pipeline.Config, error) {
|
||||
tag, err := language.Parse(*srcLang)
|
||||
if err != nil {
|
||||
return nil, wrap(err, "invalid srclang")
|
||||
}
|
||||
return &pipeline.Config{
|
||||
SourceLanguage: tag,
|
||||
TranslationsPattern: `messages\.(.*)\.json`,
|
||||
GenFile: *out,
|
||||
}, nil
|
||||
}
|
||||
var dir = flag.String("dir", "locales", "default subdirectory to store translation files")
|
||||
|
||||
// NOTE: the Command struct is copied from the go tool in core.
|
||||
|
||||
|
@ -59,7 +42,7 @@ func config() (*pipeline.Config, error) {
|
|||
type Command struct {
|
||||
// Run runs the command.
|
||||
// The args are the arguments after the command name.
|
||||
Run func(cmd *Command, c *pipeline.Config, args []string) error
|
||||
Run func(cmd *Command, args []string) error
|
||||
|
||||
// UsageLine is the one-line usage message.
|
||||
// The first word in the line is taken to be the command name.
|
||||
|
@ -141,11 +124,7 @@ func main() {
|
|||
cmd.Flag.Usage = func() { cmd.Usage() }
|
||||
cmd.Flag.Parse(args[1:])
|
||||
args = cmd.Flag.Args()
|
||||
config, err := config()
|
||||
if err != nil {
|
||||
fatalf("gotext: %+v", err)
|
||||
}
|
||||
if err := cmd.Run(cmd, config, args); err != nil {
|
||||
if err := cmd.Run(cmd, args); err != nil {
|
||||
fatalf("gotext: %+v", err)
|
||||
}
|
||||
exit()
|
||||
|
|
2
vendor/golang.org/x/text/cmd/gotext/rewrite.go
generated
vendored
2
vendor/golang.org/x/text/cmd/gotext/rewrite.go
generated
vendored
|
@ -38,7 +38,7 @@ using Printf to allow translators to reorder arguments.
|
|||
`,
|
||||
}
|
||||
|
||||
func runRewrite(cmd *Command, _ *pipeline.Config, args []string) error {
|
||||
func runRewrite(cmd *Command, args []string) error {
|
||||
w := os.Stdout
|
||||
if *overwrite {
|
||||
w = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue