pseudolocalize

Crates.iopseudolocalize
lib.rspseudolocalize
version0.3.1
sourcesrc
created_at2019-06-07 14:38:52.66015
updated_at2019-06-13 16:15:59.375934
descriptionPseudolocalization crate for Rust.
homepage
repositoryhttps://github.com/joeljpresent/pseudolocalize
max_upload_size
id139665
size14,451
Joël J. Présent (joeljpresent)

documentation

https://docs.rs/pseudolocalize

README

Pseudolocalize

A pseudolocalization tool for Rust.

Pseudolocalization is a software testing method used for testing internationalization aspects of software (cf. Wikipedia).

For now, this crate lets you transform a string to replace its ASCII letters by similar letter-like characters, usually letters with diacritics.

Example

use pseudolocalize::Pseudolocalizer;
fn main() {
    // Basic example
    let pl = Pseudolocalizer::new();
    let s = pl.transform("The quick brown fox jumps over the lazy dog");
    assert_eq!(s, "[!!! Ŧℏë ʠûíçķ ƃŕøẅñ ƒøẍ ĵûɱƥŝ øṽëŕ țℏë łάẓƴ ďøǧ !!!]");

    // More complex example
    let pl = Pseudolocalizer::new()
                .with_prefix("« ")
                .with_suffix(" »")
                .with_increase_percentage(30)
                .with_extension_string(" Lôřè₥ ïƥƨú₥ôáñ δôℓôř ƨïƭ á₥èƭ");
    let s = pl.transform("The quick brown fox jumps over the lazy dog.");
    assert_eq!(s, "« Ŧℏë ʠûíçķ ƃŕøẅñ ƒøẍ ĵûɱƥŝ øṽëŕ țℏë łάẓƴ ďøǧ. Lôřè₥ ïƥƨú₥ô »");
}
Commit count: 13

cargo fmt