16 lines
527 B
Swift
16 lines
527 B
Swift
import Hummingbird
|
|||
|
|
|
||
|
|
/// A request context that carries the language negotiated for the request.
|
||
|
|
///
|
||
|
|
/// ``LocalizationMiddleware`` resolves the visitor's preferred language from the `Accept-Language`
|
||
|
|
/// header and stores it here, so downstream controllers and middleware can serve the matching
|
||
|
|
/// localization without re-reading the header.
|
||
|
|
public protocol LocalizedRequestContext: RequestContext {
|
||
|
|
|
||
|
|
// MARK: Properties
|
||
|
|
|
||
|
|
/// The language identifier negotiated for the request.
|
||
|
|
var language: String { get set }
|
||
|
|
|
||
|
|
}
|