dachshund/strategy
Types
pub type Strategy {
Cookie(String)
LocalStorage(String)
Url(UrlPattern)
PreferredLanguage
BaseLocale(locale.Locale)
DocumentLang
}
Constructors
-
Cookie(String) -
LocalStorage(String) -
Url(UrlPattern) -
PreferredLanguage -
BaseLocale(locale.Locale) -
DocumentLang
pub type StrategyResult {
StrategyResult(locale: locale.Locale, source: String)
}
Constructors
-
StrategyResult(locale: locale.Locale, source: String)
pub type UrlPattern {
UrlPattern(
locales: List(locale.Locale),
base_locale: locale.Locale,
prefix: String,
)
}
Constructors
-
UrlPattern( locales: List(locale.Locale), base_locale: locale.Locale, prefix: String, )
Values
pub const auto_detect_strategy: List(Strategy)
pub fn base_locale(base: locale.Locale) -> Strategy
pub const default_strategy: List(Strategy)
pub fn document_lang() -> Strategy
pub fn evaluate(
strategies: List(Strategy),
fallback: locale.Locale,
) -> StrategyResult
pub fn local_storage(key: String) -> Strategy
pub fn preferred_language() -> Strategy
pub fn url(
locales: List(locale.Locale),
base_locale: locale.Locale,
) -> Strategy
pub fn url_pattern(
locales locales: List(locale.Locale),
base_locale base_locale: locale.Locale,
prefix prefix: String,
) -> UrlPattern
pub fn url_patterns_for(
locales: List(locale.Locale),
) -> UrlPattern
pub fn url_with_prefix(
locales: List(locale.Locale),
base_locale: locale.Locale,
prefix: String,
) -> Strategy
pub const user_preference_strategy: List(Strategy)