Expand description
Fluent-backed reason catalog for gatekeep denial reasons.
use gatekeep::{DenialReason, DenyShape, Locale, ReasonCatalog, ReasonCode};
use gatekeep_fluent::FluentCatalog;
let catalog = FluentCatalog::new()
.with_resource("en-US", "case-read-denied = You cannot read this case.")?;
let reason = DenialReason {
code: ReasonCode::new("case-read-denied")?,
params: Default::default(),
shape: DenyShape::Forbidden,
};
assert_eq!(
catalog.render(&reason, &Locale::new("en-US")?),
"You cannot read this case."
);Structs§
- Fluent
Catalog - Fluent catalog keyed by gatekeep reason codes.
Enums§
- Fluent
Catalog Error - Errors returned while building a
FluentCatalog.