LocalFmt: Provide simple localizable format strings
Overview
local-fmt is a Rust library that provides a mechanism for defining and using localizable format strings.
It is designed to facilitate the creation of applications that support multiple languages
by allowing developers to define messages in a structured and maintainable way.
Crate cfg feature
- macros: include
gen_const_messa,gen_messageanddef_local_fmtmacros if you usedef_local_fmt, chose from below - macros-toml: parseable toml at
def_local_fmt - macros-json: parseable json at
def_local_fmt - macros-yaml: parseable yaml
def_local_fmt
Features
- Localizable Messages: Define messages in multiple languages using TOML or JSON files.
- Dynamic Language Switching: Change the language at runtime using a dynamic supplier.
- Compile-time Checks: Ensure message format correctness at compile time.
- Integration with Serde: Optional support for serializing and deserializing messages.
Usage
Below is an example of how to use local-fmt in a Rust project. This example demonstrates creating a localizable format string and using it to format a message.
/// This example demonstrates how to use the `local-fmt` library to create
/// and use localizable format strings in a Rust application.
use RwLock;
use Enumable;
use ;
static LANG: = new;
def_local_fmt!;
For more detailed information on def_local_fmt, see the documentation.
Documentation
For more detailed information, please refer to the documentation.
License
Licensed under