dachshund/strategy

Types

pub type Strategy {
  Cookie(String)
  LocalStorage(String)
  Url(UrlPattern)
  PreferredLanguage
  BaseLocale(locale.Locale)
  DocumentLang
}

Constructors

pub type StrategyResult {
  StrategyResult(locale: locale.Locale, source: String)
}

Constructors

pub type UrlPattern {
  UrlPattern(
    locales: List(locale.Locale),
    base_locale: locale.Locale,
    prefix: String,
  )
}

Constructors

Values

pub const auto_detect_strategy: List(Strategy)
pub fn base_locale(base: locale.Locale) -> Strategy
pub fn cookie(name: String) -> 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)
Search Document