pub fn generate_static_cache(locales_dir_path: &str)Expand description
Generates the static cache code for fluent-zero.
This function reads Fluent (.ftl) files from the specified directory, parses them,
and generates a Rust file (static_cache.rs) in the OUT_DIR.
§Process
- Scans
locales_dir_pathfor language subdirectories (e.g.,en-US). - Parses every
.ftlfile found. - Identifies Static messages (no variables, standard text) vs Dynamic messages.
- Generates:
CACHE: A Perfect Hash Map (PHF) mapping keys toCacheEntry::Static(&str)orCacheEntry::Dynamic.LOCALES: A Map of Lazy-loadedConcurrentFluentBundles for fallback/dynamic resolution.
§Arguments
locales_dir_path- Relative path to the folder containing locale subdirectories.