MCPcopy Index your code
hub / github.com/Baptistemontan/leptos_i18n

github.com/Baptistemontan/leptos_i18n @v0.6.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.2 ↗ · + Follow
1,254 symbols 2,748 edges 209 files 84 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

crates.io

Docs.rs | Book

Leptos i18n

This crate is made to simplify internationalization in a Leptos application, that loads locales at compile time and provides compile time checks for translation keys, interpolation keys and the selected locale.

The main focus is ease of use with leptos, a typical component using this crate will look like this:

use crate::i18n::*;
use leptos::prelude::*;

#[component]
fn Counter() -> impl IntoView {
  let i18n = use_i18n();

  let (counter, set_counter) = signal(0);
  let inc = move |_| set_counter.update(|count| *count += 1);


  view! {
    <button on:click=inc>
      {t!(i18n, click_to_inc)}
    </button>



      {t!(i18n, click_count, count = move || counter.get())}



  }
}

Getting started

You can add the crate to your project with

cargo add leptos_i18n

Or by adding this line to your Cargo.toml under [dependencies]:

leptos_i18n = "0.6"

Version compatibility with leptos

Leptos Leptos i18n
< v0.4.x not supported
v0.4.x v0.1.x
v0.5.x v0.2.x
v0.6.x v0.3.x / v0.4.x
v0.7.x v0.5.x
v0.8.x v0.6.x

How to use

You can look into the Book for documentation, or look for examples on the github repo.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 555
Method 491
Class 107
Enum 58
Interface 43

Languages

Rust92%
TypeScript8%

Modules by API surface

leptos_i18n_parser/src/parse_locales/parsed_value.rs69 symbols
leptos_i18n_parser/src/parse_locales/ranges.rs55 symbols
leptos_i18n_parser/src/parse_locales/locale.rs49 symbols
leptos_i18n_router/src/routing.rs40 symbols
leptos_i18n/src/context.rs39 symbols
leptos_i18n_build/src/lib.rs37 symbols
leptos_i18n_parser/src/parse_locales/options.rs35 symbols
leptos_i18n_macro/src/lib.rs31 symbols
leptos_i18n_codegen/src/load_locales/interpolate.rs29 symbols
leptos_i18n_parser/src/formatters/mod.rs26 symbols
leptos_i18n/src/macro_helpers/mod.rs26 symbols
examples/utils/src/index.ts26 symbols

For agents

$ claude mcp add leptos_i18n \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page