Thanks to visit codestin.com
Credit goes to lib.rs

3 releases

0.1.2 Mar 29, 2026
0.1.1 Mar 29, 2026
0.1.0 Mar 28, 2026

#1643 in Text processing

MIT license

5MB
151 lines

Contains (Mach-o exe, 1MB) facilguide-ac83eb8ae8b93119, (rust library, 775KB) libfacilguide-e4cf7487a710c2f7.rlib, (Mach-o exe, 160KB) facilguide-ac83eb8ae8b93119.5qd99izg99oxpf6rgwjfphmxy.175o6yz.rcgu.o, (Mach-o exe, 145KB) facilguide-e4cf7487a710c2f7.4f8zqmyi8djinc91vt5dfuooz.0dybrqu.rcgu.o, (Mach-o exe, 145KB) 4f8zqmyi8djinc91vt5dfuooz.o, (Mach-o exe, 160KB) 5qd99izg99oxpf6rgwjfphmxy.o and 236 more.

facilguide

Crates.io docs.rs

Internationalization helpers for multilingual content, built for the Facil.guide project -- a tech education platform that publishes step-by-step guides for seniors in five languages: English, Spanish, French, Portuguese, and Italian.

This crate provides locale detection, string lookup tables, and URL routing utilities so that Rust services can serve the right translation without pulling in a full i18n framework.

Installation

[dependencies]
facilguide = "0.1.2"

Usage

Supported Locales

The Locale enum represents the five supported languages. Parse from a two-letter code or extract from a URL path prefix:

use facilguide::{Locale, parse_locale};

let locale = parse_locale("es").unwrap();
assert_eq!(locale, Locale::Es);
assert_eq!(locale.native_name(), "Espanol");

URL Routing

Given a path like /fr/guides/smartphone-basics, extract the locale and the remaining path in one call:

use facilguide::split_locale_path;

let (locale, rest) = split_locale_path("/pt/guides/email-setup");
assert_eq!(locale.code(), "pt");
assert_eq!(rest, "/guides/email-setup");

Translation Lookup

Register key-value pairs per locale and retrieve them at render time. Missing keys fall back to the English value:

use facilguide::{TranslationTable, Locale};

let mut table = TranslationTable::new();
table.insert("greeting", Locale::En, "Welcome");
table.insert("greeting", Locale::Es, "Bienvenido");
table.insert("greeting", Locale::Fr, "Bienvenue");

assert_eq!(table.get("greeting", Locale::Fr), "Bienvenue");
assert_eq!(table.get("greeting", Locale::It), "Welcome"); // fallback

Guide Metadata

Represent a single guide entry with its language and difficulty level:

use facilguide::{Guide, Locale, Difficulty};

let guide = Guide {
    slug: "wifi-connect".into(),
    title: "Como conectar al WiFi".into(),
    locale: Locale::Es,
    difficulty: Difficulty::Beginner,
};

What Facil.guide Covers

Facil.guide publishes plain-language technology guides aimed at older adults. Topics range from smartphone basics and email setup to video calls, app stores, online banking safety, and social media. Every guide is written at a beginner-friendly reading level and translated into all five supported languages. The difficulty scale (Beginner, Intermediate, Advanced) helps readers find content matched to their comfort level.

License

MIT

No runtime deps