aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/golang.org/x/text/cmd/gotext/examples/extract_http
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/text/cmd/gotext/examples/extract_http')
-rwxr-xr-xvendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json39
-rwxr-xr-xvendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en-US/out.gotext.json39
-rwxr-xr-xvendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json39
-rwxr-xr-xvendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json39
-rw-r--r--vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go17
-rw-r--r--vendor/golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go25
6 files changed, 0 insertions, 198 deletions
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json
deleted file mode 100755
index bd71590..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "language": "de",
- "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"
- }
- ]
-} \ No newline at end of file
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en-US/out.gotext.json b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en-US/out.gotext.json
deleted file mode 100755
index d0c4684..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en-US/out.gotext.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "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"
- }
- ]
-} \ No newline at end of file
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json
deleted file mode 100755
index d0c4684..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/extracted.gotext.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "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"
- }
- ]
-} \ No newline at end of file
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json
deleted file mode 100755
index cad0ff0..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "language": "zh",
- "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"
- }
- ]
-} \ No newline at end of file
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go
deleted file mode 100644
index c1ac449..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-//go:generate gotext extract --lang=de,zh
-
-import (
- "net/http"
-
- "golang.org/x/text/cmd/gotext/examples/extract_http/pkg"
-)
-
-func main() {
- http.Handle("/generize", http.HandlerFunc(pkg.Generize))
-}
diff --git a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go b/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go
deleted file mode 100644
index 7b44634..0000000
--- a/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/pkg/pkg.go
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package pkg
-
-import (
- "net/http"
-
- "golang.org/x/text/language"
- "golang.org/x/text/message"
-)
-
-var matcher = language.NewMatcher(message.DefaultCatalog.Languages())
-
-func Generize(w http.ResponseWriter, r *http.Request) {
- lang, _ := r.Cookie("lang")
- accept := r.Header.Get("Accept-Language")
- tag := message.MatchLanguage(lang.String(), accept)
- p := message.NewPrinter(tag)
-
- p.Fprintf(w, "Hello %s!\n", r.Header.Get("From"))
-
- p.Fprintf(w, "Do you like your browser (%s)?\n", r.Header.Get("User-Agent"))
-}