LocalizationInterceptor class

The Localization Interceptor.

Attaches Accept-Language and X-Timezone headers to every outgoing HTTP request. Values are sourced from the Translator and DateManager singletons at request-time, so they always reflect the current state.

Headers

  • Accept-Language — The current locale language code (e.g. en, tr).
  • X-Timezone — The current IANA timezone identifier (e.g. Europe/Istanbul).

Registration

This interceptor is automatically registered by LocalizationServiceProvider when the localization system is enabled. You do not need to add it manually.

Inheritance

Constructors

LocalizationInterceptor()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(MagicError error) → dynamic
Called when an error occurs.
override
onRequest(MagicRequest request) → dynamic
Called before each request is sent.
override
onResponse(MagicResponse response) → dynamic
Called after a successful response is received.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited