leptos_i18n_codegen/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(warnings)]
3#![allow(clippy::too_many_arguments)]
4//! # About Leptos i18n codegen
5//!
6//! This crate expose the codegen functions for `leptos_i18n`
7//!
8//! This crate must be used with `leptos_i18n` and should'nt be used outside of it.
9
10use leptos_i18n_parser::parse_locales::{ParsedLocales, error::Result};
11use proc_macro2::TokenStream;
12
13pub mod load_locales;
14pub mod utils;
15
16pub fn gen_code(
17    parsed_locales: &ParsedLocales,
18    crate_path: Option<&syn::Path>,
19    emit_diagnostics: bool,
20    top_level_attributes: Option<&TokenStream>,
21) -> Result<TokenStream> {
22    load_locales::load_locales(
23        parsed_locales,
24        crate_path,
25        emit_diagnostics,
26        top_level_attributes,
27    )
28}