laralocale 0.1.0

The current locale for Laravel Rust, with the API of laravel::lang: locale, set_locale, locales, negotiate and preferred_locale.
Documentation
//! The current locale for Laravel Rust, with the API of `laravel::lang`.
//!
//! Laravel Rust 0.1 has no localization. Its prototype (draft PR #309) adds `laravel::lang` with
//! `locale`, `set_locale`, `locales` and `negotiate`, and `request.preferred_locale()`. This crate
//! has the same names and behaviour today, so moving to the framework's own is changing the `use`.
//!
//! ```ignore
//! use laralocale::PreferredLocale;
//!
//! laralocale::set_locale(request.preferred_locale());   // for the rest of the request
//! laralocale::locale();                                 // "es"
//! laralocale::locales();                                // ["en", "ca", "es"]
//! laralocale::negotiate(&["es-mx".to_owned()]);         // "es"
//!
//! laralocale::with_locale("ca", async { send_the_newsletter().await }).await;
//! ```
//!
//! The locale lives in a task-local, so every request has its own and requests never see each
//! other's. Packages that translate, such as Laratext, Laralang and Larablog, read it with
//! [`locale()`](fn@locale) and need nothing else from this crate.
//!
//! It targets Laravel Rust 0.1 (beta), whose API it follows until 1.0.

pub mod config;
pub mod detect;
pub mod locale;
pub mod preferred;
pub mod provider;
pub mod scope;

pub use config::{DetectSettings, DetectSource, LocaleConfig};
pub use detect::DetectLocale;
pub use locale::{candidates, fallback_locale, locale, locales, negotiate, set_locale, with_locale};
pub use preferred::PreferredLocale;
pub use provider::LaralocaleServiceProvider;
pub use scope::LocaleScope;