mirror of
https://github.com/kataras/iris.git
synced 2025-02-02 15:30:36 +01:00
commit
cf42f37169
|
@ -6,19 +6,19 @@ func negotiationMatch(in []string, priorities []string) string {
|
||||||
// e.g.
|
// e.g.
|
||||||
// match json:
|
// match json:
|
||||||
// in: text/html, application/json
|
// in: text/html, application/json
|
||||||
// prioritities: application/json
|
// priorities: application/json
|
||||||
// not match:
|
// not match:
|
||||||
// in: text/html, application/json
|
// in: text/html, application/json
|
||||||
// prioritities: text/xml
|
// priorities: text/xml
|
||||||
// match html:
|
// match html:
|
||||||
// in: text/html, application/json
|
// in: text/html, application/json
|
||||||
// prioritities: */*
|
// priorities: */*
|
||||||
// not match:
|
// not match:
|
||||||
// in: application/json
|
// in: application/json
|
||||||
// prioritities: text/xml
|
// priorities: text/xml
|
||||||
// match json:
|
// match json:
|
||||||
// in: text/html, application/*
|
// in: text/html, application/*
|
||||||
// prioritities: application/json
|
// priorities: application/json
|
||||||
|
|
||||||
if len(priorities) == 0 {
|
if len(priorities) == 0 {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -2,7 +2,7 @@ package context
|
||||||
|
|
||||||
import "golang.org/x/text/language"
|
import "golang.org/x/text/language"
|
||||||
|
|
||||||
// I18nReadOnly is the interface which ontains the read-only i18n features.
|
// I18nReadOnly is the interface which contains the read-only i18n features.
|
||||||
// Read the "i18n" package fo details.
|
// Read the "i18n" package fo details.
|
||||||
type I18nReadOnly interface {
|
type I18nReadOnly interface {
|
||||||
Tags() []language.Tag
|
Tags() []language.Tag
|
||||||
|
@ -17,7 +17,7 @@ type Locale interface {
|
||||||
// Index returns the current locale index from the languages list.
|
// Index returns the current locale index from the languages list.
|
||||||
Index() int
|
Index() int
|
||||||
// Tag returns the full language Tag attached to this Locale,
|
// Tag returns the full language Tag attached to this Locale,
|
||||||
// it should be uniue across different Locales.
|
// it should be unique across different Locales.
|
||||||
Tag() *language.Tag
|
Tag() *language.Tag
|
||||||
// Language should return the exact languagecode of this `Locale`
|
// Language should return the exact languagecode of this `Locale`
|
||||||
//that the user provided on `New` function.
|
//that the user provided on `New` function.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user