laratext 0.1.0

Laratext for Laravel Rust: translation keys with their source text, and auto-translation with OpenAI, Claude, Google Translate or Translatorio.
Documentation
//! Laratext for Laravel Rust: translation keys with their source text, and auto-translation with
//! OpenAI, Claude, Google Translate or Translatorio.
//!
//! In Laravel, `__()` takes either the key, and the file becomes unreadable, or the text, and the
//! translation breaks when you change a character. Laratext takes both:
//!
//! ```
//! use laratext::{replace, text};
//!
//! text("key_name", "default_value");
//!
//! // A key alone makes its text: "Hello Mate".
//! assert_eq!(text!("hello_mate"), "Hello Mate");
//!
//! assert_eq!(
//!     text!("items.count", "One item|You have :count items", replace! { count => 5 }),
//!     "You have 5 items"
//! );
//! ```
//!
//! `laratext:scan` reads the calls in your project and translates what is missing, and
//! `{{ text('key', 'Default') }}` does the same in a MiniJinja template.
//!
//! It is the port of the PHP package [`edulazaro/laratext`](https://github.com/edulazaro/laratext)
//! to Laravel Rust 0.1 (beta), and its API follows the framework's changes until 1.0. The current
//! locale comes from [`laralocale`], which has to be registered as well.

pub mod catalog;
pub mod config;
pub mod console;
pub mod helpers;
pub mod js;
pub mod json;
pub mod limits;
pub mod locks;
pub mod plural;
pub mod provider;
pub mod replace;
pub mod scripts;
pub mod selector;
pub mod sources;
pub mod support;
pub mod text;
pub mod translator;
pub mod translators;
#[cfg(feature = "minijinja")]
pub mod views;

pub use catalog::{Catalog, Lines};
pub use config::{
    ClaudeConfig, GoogleConfig, ModelOverride, OpenAiConfig, ScanSettings, ScriptScanSettings, TextsConfig,
    TranslatorioConfig,
};
pub use helpers::text;
pub use limits::{Json, ModelLimits};
pub use locks::TranslationLocks;
pub use provider::LaratextServiceProvider;
pub use replace::{Replace, ReplaceValue, make_replacements};
pub use scripts::{Extracted, ScriptTexts, Unreadable};
pub use selector::choose;
pub use text::{Frontend, Prefixes, Text};
pub use translator::{
    RealSleeper, Sleeper, Texts, TranslateError, Translated, Translations, Translator, log_to_console, with_messages,
};
pub use translators::{ClaudeTranslator, GoogleTranslator, OpenAiTranslator, TranslatorioTranslator, Translators};