<commit_before>
use crowbook_intl::{Localizer, Extractor};

use std::path::Path;
use std::env;


fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    println!("cargo:rerun-if-changed=lang/fr.po");
    // Extract and localize src/lib
    let mut extractor = Extractor::new();
    extractor.add_messages_from_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/src/lib")).unwrap();
    // Uncomment to update crowbook.pot
     extractor.write_pot_file(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/lib/crowbook.pot")).unwrap();
    
    let mut localizer = Localizer::new(&extractor);
    localizer.add_lang("fr", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/lib/fr.po"))).unwrap();
    let dest_path = Path::new(&env::var("OUT_DIR").unwrap())
        .join("localize_macros.rs");
    localizer.write_macro_file(dest_path).unwrap();

    // Extract and localize src/bin
    let mut extractor = Extractor::new();
    extractor.add_messages_from_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bin")).unwrap();
    // Uncomment to update crowbook.pot
    extractor.write_pot_file(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/bin/crowbook.pot")).unwrap();
    
    let mut localizer = Localizer::new(&extractor);
    localizer.add_lang("fr", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/bin/fr.po"))).unwrap();
    let dest_path = Path::new(&env::var("OUT_DIR").unwrap())
        .join("localize_macros_bin.rs");
    localizer.write_macro_file(dest_path).unwrap();
}
<commit_msg>Fix build.rs for crates.io<commit_after>
use crowbook_intl::{Localizer, Extractor};

use std::path::Path;
use std::env;


fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    println!("cargo:rerun-if-changed=lang/fr.po");
    // Extract and localize src/lib
    let mut extractor = Extractor::new();
    extractor.add_messages_from_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/src/lib")).unwrap();
    // Uncomment to update crowbook.pot
    //extractor.write_pot_file(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/lib/crowbook.pot")).unwrap();
    
    let mut localizer = Localizer::new(&extractor);
    localizer.add_lang("fr", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/lib/fr.po"))).unwrap();
    let dest_path = Path::new(&env::var("OUT_DIR").unwrap())
        .join("localize_macros.rs");
    localizer.write_macro_file(dest_path).unwrap();

    // Extract and localize src/bin
    let mut extractor = Extractor::new();
    extractor.add_messages_from_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bin")).unwrap();
    // Uncomment to update crowbook.pot
    //extractor.write_pot_file(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/bin/crowbook.pot")).unwrap();
    
    let mut localizer = Localizer::new(&extractor);
    localizer.add_lang("fr", include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/lang/bin/fr.po"))).unwrap();
    let dest_path = Path::new(&env::var("OUT_DIR").unwrap())
        .join("localize_macros_bin.rs");
    localizer.write_macro_file(dest_path).unwrap();
}

{'fraction_non_alphanumeric': 0.1887925283522348, 'fraction_numerical': 0.0, 'mean_word_length': 4.846003898635478, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1802209', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1068, 'n_words': 139}