Skip to content

Commit

Permalink
Remove example
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jun 17, 2020
1 parent 09ebd59 commit 8c05ce5
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 108 deletions.
31 changes: 1 addition & 30 deletions README.md
Expand Up @@ -9,36 +9,7 @@ This package is built on top of [text/language](https://pkg.go.dev/golang.org/x/

## Usage

Please take a look of the following [example](example):

```shell
$ cd example
$ go run main.go
```

```
## fallback language(default to English)
$ curl "http://localhost:1234"
Home
## retrieve prefered language from URL query
$ curl "http://localhost:1234?lang=zh"
主页
$ curl "http://localhost:1234?lang=zh-TW"
主頁
$ curl "http://localhost:1234?lang=zh-HK"
主頁
## retrieve prefered language Cookie
$ curl -b "lang=zh-Hant" "http://localhost:1234"
主頁
## retrieve prefered language from header
$ curl -H "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7,zh-TW;q=0.6,pt;q=0.5" "http://localhost:1234/hello?name=foo"
你好,foo
```
Checkout [example](https://github.com/clevergo/examples/tree/master/i18n) for details.

## Integrate with other frameworks

Expand Down
8 changes: 0 additions & 8 deletions example/go.mod

This file was deleted.

7 changes: 0 additions & 7 deletions example/go.sum

This file was deleted.

47 changes: 0 additions & 47 deletions example/main.go

This file was deleted.

4 changes: 0 additions & 4 deletions example/translations/de/text.json

This file was deleted.

4 changes: 0 additions & 4 deletions example/translations/en/text.json

This file was deleted.

4 changes: 0 additions & 4 deletions example/translations/zh-Hans/text.json

This file was deleted.

4 changes: 0 additions & 4 deletions example/translations/zh-Hant/text.json

This file was deleted.

0 comments on commit 8c05ce5

Please sign in to comment.