Expand description
Legalis-I18n: Internationalization support for Legalis-RS.
This crate provides multi-language and multi-jurisdiction support:
- Translation of legal terms and statutes
- Locale-specific legal formatting (dates, currencies, names)
- Jurisdiction mapping and legal system classification
- Cultural parameter injection for law porting
- ICU message format support
- Plural rules handling
- Date/time, currency, and number formatting
Structs§
- AIQuality
Score - AI quality score for a specific metric.
- Accessibility
Subtitle Generator - Accessibility subtitle generator for legal proceedings.
- Address
- Address components for legal documents.
- Address
Formatter - Address formatter for legal documents per jurisdiction.
- Adjusted
Text - Adjusted text with reading level information.
- Analysis
Result - Analysis result from legal reasoning engine.
- Archaic
Term - Archaic legal term with historical context.
- Archaic
Term Dictionary - Archaic term dictionary for historical legal language.
- Audio
Description Generator - Audio description generator for legal documents. Generates descriptive text for charts, diagrams, and complex structures.
- Audio
Narration Support - Audio narration support with SSML integration.
- BCP47
Language Tag - IETF BCP 47 language tag.
- Batch
Translator - Batch translation operations with parallel processing support.
- Bidirectional
Text - RTL (Right-to-Left) text handler for Arabic and Hebrew legal documents.
- Braille
Formatter - Braille formatter for visual accessibility. Supports Grade 1 (uncontracted) and Grade 2 (contracted) Braille.
- CLDR
Data - CLDR (Common Locale Data Repository) integration.
- CLDR
Entry - CLDR data entry.
- Calendar
Converter - Calendar converter for converting dates between calendar systems.
- Calendar
Date - Date representation in a calendar system.
- Citation
Completeness Checker - Citation completeness checker.
- Citation
Components - Legal citation components.
- Citation
Formatter - Citation formatter for legal documents.
- Citation
Normalizer - Citation normalizer for converting between citation styles.
- Citation
Parser - Citation parser for extracting components from citation strings.
- Citation
Suggester - Citation format suggester.
- Citation
Validation Rule - Validation rule for a citation component.
- Citation
Validator - Citation validator for checking citations against style rules.
- Classified
Clause - Classified clause with confidence score.
- Clause
Classifier - Contract clause classifier.
- Clause
Extractor - Key clause extractor for legal documents.
- Colonial
Legacy - Colonial legacy mapping.
- Colonial
Legacy Mapper - Colonial legacy mapper.
- Completeness
Report - Report on citation completeness.
- Compliance
Normalizer - Compliance language normalizer.
- Compliance
Report - WCAG compliance report.
- Compliance
Term - Compliance term with normalized variants.
- Concept
Mapper - Cross-lingual concept mapper.
- Context
Disambiguator - Context-aware disambiguator for legal terms.
- Contribution
- Community contribution.
- Contribution
Workflow - Community contribution workflow manager.
- Court
Participant - Court proceeding participant with language preference.
- Court
Proceeding Translator - Court proceeding live translation system.
- Cross
Lingual Case Search - Cross-lingual case search engine.
- Cross
Reference Formatter - Cross-reference formatter for internal document references.
- Cross
Regional Term Equivalence Registry - Registry of cross-regional term equivalences.
- Cultural
Context - Cultural context annotation.
- Cultural
Context Registry - Cultural context registry.
- Cultural
Params - Cultural parameters affecting legal interpretation.
- Currency
Formatter - Currency formatter for monetary values.
- Date
Time Formatter - Date/time formatter for legal deadlines.
- Deadline
Calculator - Legal deadline calculator with time zone and business day support.
- Deadline
Extractor - Deadline extractor for legal documents with calendar integration.
- Dialect
- Dialect variation.
- Dialect
Handler - Dialect handler.
- Dialect
Terminology - Dialect-aware terminology for regional language variations.
- Dialect
Terminology Registry - Registry of dialect terminologies.
- Disambiguation
Context - Disambiguation context for legal translation.
- Document
Analysis - Complete analysis of a legal document.
- Document
Numbering - Legal document numbering formatter.
- Document
Similarity Calculator - Document similarity calculator for legal documents.
- Document
Template - Legal document template with placeholders and localization.
- Document
Template Registry - Registry of legal document templates.
- EUMember
State Registry - Registry of EU member state variations.
- EUMember
State Variation - EU member state variation information.
- EURegulation
Aligner - EU regulation language aligner.
- EURegulation
Term - EU regulation term with aligned translations.
- Equivalent
Term - Equivalent term in another jurisdiction.
- Etymology
- Etymology information for a legal term.
- Etymology
Tracker - Etymology tracker for legal terms.
- Extended
Language - Extended language information for emerging markets.
- Extended
Language Registry - Extended language registry with 50+ languages.
- Extracted
Clause - Extracted clause from a legal document.
- Extracted
Deadline - Extracted deadline from a legal document.
- Extracted
Obligation - Extracted obligation from a legal document.
- Fiscal
Year Config - Fiscal year configuration per jurisdiction.
- Footnote
Formatter - Footnote or endnote formatter.
- Glossary
Enforcer - Glossary enforcer for terminology consistency.
- Glossary
Violation - Glossary violation.
- Historical
Calendar Converter - Historical calendar converter.
- Historical
Context - Historical context annotation.
- Historical
Context Annotator - Historical context annotator.
- ISO639_
3 - ISO 639-3 language code (3-letter code).
- ISO639_
3_ Registry - Registry for ISO 639-3 language codes.
- Identified
Party - Identified party in a legal document.
- Index
Entry - Index entry.
- Index
Generator - Index generator.
- Indigenous
LawRegistry - Indigenous law registry.
- Indigenous
LawSystem - Indigenous legal tradition.
- Interpreted
Segment - Interpreted segment with source and target text.
- Jurisdiction
- Jurisdiction definition.
- Jurisdiction
Detector - Jurisdiction detector for legal documents.
- Jurisdiction
Registry - Jurisdiction registry.
- KeyTerm
Extractor - Key term extractor using TF-IDF.
- Knowledge
Graph Edge - Knowledge graph edge representing a relationship.
- Knowledge
Graph Node - Knowledge graph node representing a legal entity.
- LLMTranslator
- LLM-based legal translator (infrastructure for external LLM integration).
- Lazy
Dictionary - Lazy-loading dictionary wrapper for efficient memory usage with large dictionaries.
Loads dictionary data on-demand using
Arc<Mutex>for thread-safe initialization. - Legal
Case - Legal case metadata for cross-lingual search.
- Legal
Concept - Legal concept for cross-lingual mapping.
- Legal
Concept Mapping - Mapping between legal concepts across different legal systems.
- Legal
Concept Registry - Registry of legal concept mappings between different legal systems.
- Legal
Dictionary - Translation dictionary for legal terms.
- Legal
Document Analyzer - Comprehensive legal document analyzer.
- Legal
Entity - Recognized legal entity.
- Legal
Entity Recognizer - Legal entity recognizer for identifying entities in legal text.
- Legal
Extension - Unicode CLDR legal extension.
- Legal
Prompt Template - Legal translation prompt template.
- Legal
Reasoning Engine - Language-agnostic legal reasoning engine.
- Legal
Risk Scorer - Legal risk scorer for documents.
- Legal
Speech Transcriber - Speech-to-text legal transcription engine.
- Legal
Topic - Legal topic for topic modeling.
- Legal
Topic Modeler - Legal topic modeler for extracting topics from legal documents.
- Local
Custom - Local custom.
- Local
Custom Registry - Local custom registry.
- Local
LawDatabase - Local law terminology database.
- Local
LawTerm - Local law terminology entry.
- Locale
- Language/locale identifier.
- LowResource
Config - Low-resource language configuration.
- LowResource
Support - Low-resource language support manager.
- MTTranslation
- Neural machine translation result.
- MTWith
Memory - Translation with memory integration.
- Machine
Translation Fallback - Machine translation fallback manager. Uses translation memory first, then falls back to external services.
- Message
Formatter - ICU-style message formatter.
- Mock
Translation Service - Mock translation service for testing and fallback.
- Multilingual
Embedder - Multilingual semantic embedder for legal text.
- Multilingual
Hearing - Multilingual hearing support with channel management.
- Multilingual
Knowledge Graph - Multilingual knowledge graph for legal concepts.
- Name
Formatter - Name formatter for legal documents following cultural conventions.
- Neural
Machine Translator - Neural machine translator for legal documents.
- Number
Formatter - Number formatter for locale-specific number formatting.
- Obligation
Extractor - Obligation extractor for legal documents.
- Party
Identifier - Party identifier for legal documents.
- Person
Name - Personal name components for legal documents.
- Plain
Language Converter - Plain language converter for legal terminology. Converts complex legal jargon to accessible plain language.
- Plain
Language Generator - Plain language generator with AI-assisted simplification.
- Plural
Rules - Plural rules for a specific locale.
- Post
Edit Feedback - Post-editing feedback.
- Post
Editing Workflow - Post-editing workflow for translation review.
- Quality
Estimation Report - Quality estimation report for AI translation.
- Quality
Estimator - Quality estimator for AI-powered translations.
- Readability
Report - Readability assessment report.
- Reading
Level Adjuster - Reading level adjuster for adaptive content.
- Reading
Level Assessor - Reading level assessor for legal documents. Calculates readability metrics like Flesch-Kincaid grade level.
- Regional
Concept Mapper - Registry of regional legal concept mappings.
- Regional
Concept Mapping - Regional legal concept mapper for cross-jurisdictional equivalence.
- Regional
Variation - Regional variation information for a locale.
- Regional
Variation Registry - Registry of regional variations for locales.
- Regulatory
Equivalence - Regulatory equivalence mapping between two jurisdictions.
- Regulatory
Equivalence Mapper - Regulatory equivalence mapper.
- Religious
LawRegistry - Religious law registry.
- Religious
LawSystem - Religious law system.
- Risk
Factor - Risk factor identified in a document.
- Screen
Reader Formatter - Screen reader friendly formatter for accessibility. Generates ARIA labels, semantic markup, and screen reader optimized text.
- Screen
Reader Optimizer - Screen reader optimizer with enhanced WCAG compliance.
- Search
Result - Search result with similarity score.
- Semantic
Embedding - Multilingual semantic embedding for legal text.
- Sign
Language Reference - Sign language reference for video/image linking.
- Sign
Language Referencer - Sign language referencer for legal terminology.
- Similarity
Score - Document similarity score.
- Simultaneous
Interpreter - Simultaneous interpretation engine with streaming support.
- Standard
Adoption - Standard adoption record for a jurisdiction.
- Standard
Adoption Tracker - International standard adoption tracker.
- Style
Preserving Translator - Style-preserving translator.
- Style
Profile - Style profile for legal text.
- SubRegional
Variation - Sub-regional variation (state/province level) information.
- SubRegional
Variation Registry - Registry of sub-regional variations (states, provinces, etc.).
- Subtitle
Cue - Subtitle timing and styling.
- Table
OfContents - Table of contents generator.
- Template
Section - Template section that can be conditionally included.
- Template
Variable - Template variable with type validation.
- Term
Equivalence - Cross-regional term equivalence for legal terminology.
- Term
Index - Term index for fast prefix-based lookups in dictionaries. Enables efficient autocomplete, fuzzy search, and partial matching.
- Terminology
Aware Translator - Terminology-aware translator that preserves legal terms.
- Terminology
Extractor - Legal term extractor for extracting terminology from statutes.
- Text
Collator - Text collator for locale-aware sorting and comparison.
- TfIdf
Score - Term frequency-inverse document frequency (TF-IDF) score.
- Time
Zone - Time zone representation for legal deadlines.
- Time
Zone Registry - Registry of common time zones used in legal practice.
- TocEntry
- Table of contents entry.
- Transcription
Segment - Transcription segment with timing information.
- Translation
Manager - Multi-locale translation manager with LRU caching support.
- Translation
Memory - Translation memory for caching and reusing translations.
- Translation
Memory Entry - Translation memory entry.
- Treaty
Standardizer - Treaty language standardizer.
- Treaty
Term - Standardized treaty term.
- Validation
Report - Comprehensive validation report.
- W3CCompliance
Checker - W3C internationalization compliance checker.
- W3CCompliance
Report - W3C compliance report.
- Working
Days Config - Working days configuration for a jurisdiction.
Enums§
- Adoption
Status - International standard adoption status.
- Audio
Quality - Audio quality level for speech recognition.
- Braille
Grade - Braille grade (complexity level).
- CLDR
Field Type - CLDR (Common Locale Data Repository) field type.
- Calendar
System - Calendar system type.
- Citation
Error - Citation validation errors.
- Citation
Style - Citation style for legal documents.
- Citation
Type - Citation type for validation.
- Clause
Class - Contract clause classification types.
- Clause
Type - Types of legal clauses found in documents.
- Colonial
Power - Colonial legacy type.
- Context
Category - Cultural context category.
- Contribution
Status - Contribution status.
- Court
Participant Role - Court proceeding participant role.
- Custom
Type - Local custom type.
- DayOf
Week - Day of week.
- Dialect
Type - Dialect variation type.
- Disambiguation
Type - Context disambiguation type.
- Document
Template Type - Type of legal document template.
- EURegulation
Type - EU regulation type for language alignment.
- Embedding
Model - Semantic embedding model for multilingual legal text.
- Emphasis
Level - Emphasis level for SSML.
- Equivalence
Level - Level of equivalence between terms.
- Footnote
Style - Historical
Calendar - Historical calendar system.
- Historical
Period - Historical period for legal language.
- I18n
Error - Errors during internationalization operations.
- Interpretation
Mode - Interpretation mode for real-time translation.
- LLMProvider
- LLM provider type for AI-powered translation.
- Language
Family - Language family for etymology.
- Language
Scope - Scope of language in ISO 639-3.
- Language
Type - Type of language in ISO 639-3.
- Legal
Domain - Legal domain specializations.
- Legal
Entity Type - Legal entity types for recognition.
- Legal
Extension Type - Unicode CLDR legal extension type.
- Legal
Speech Domain - Legal domain specialization for speech recognition.
- Legal
System - Legal system classification.
- LowResource
Strategy - Low-resource language support strategy.
- Name
Order - Name order convention for different cultures.
- Normalization
Level - Compliance language normalization level.
- Numbering
Style - Legal document numbering styles.
- Obligation
Type - Type of legal obligation.
- Party
Role - Party role in a legal document.
- Plural
Category - Plural category for pluralization rules.
- Post
Edit Action - Post-editing action.
- Quality
Metric - Quality estimation metric for AI translations.
- Regulatory
Domain - Regulatory domain for equivalence mapping.
- Regulatory
Equivalence Level - Regulatory equivalence level between jurisdictions.
- Religious
LawType - Religious law system type.
- Risk
Level - Risk level for legal documents.
- SSMLTag
- SSML (Speech Synthesis Markup Language) tag type.
- Sign
Language Type - Sign language type.
- Simplification
Strategy - Simplification strategy for plain language generation.
- Standard
Type - International standard type.
- Style
Attribute - Writing style attribute for translation.
- Subtitle
Position - Subtitle position on screen.
- Target
Reading Level - Reading level to adjust to.
- Term
Preservation Mode - Term preservation mode.
- Text
Direction - Text direction for layout and display.
- Translation
Engine - Translation engine type.
- Treaty
Type - Treaty type for language standardization.
- Variable
Type - Type of template variable for validation.
- Violation
Type - Glossary violation type.
- WCAG
Level - WCAG conformance level.
Traits§
- Translation
Service - External translation service interface. Implement this trait to integrate with services like Google Translate, DeepL, etc.
Functions§
- batch_
translate - Batch translates multiple keys using a translation manager.
- common_
legal_ locales - Gets a list of common legal jurisdiction locales.
- create_
standard_ translation_ manager - Creates a multi-locale translation manager with all standard dictionaries.
- detect_
locale_ from_ text - Detects the most likely locale from a text sample. Uses simple heuristics based on character sets.
- format_
error_ message - Creates a locale-aware error message.
- format_
legal_ amount - Formats a monetary amount in a legal context.
- format_
legal_ date - Formats a legal date with appropriate context and locale.
- is_
valid_ country_ code - Validates a country code (ISO 3166-1 alpha-2). Returns true if the code is a valid 2-letter uppercase country code.
- is_
valid_ language_ code - Validates a language code (ISO 639-1). Returns true if the code is a valid 2-letter language code.
- is_
valid_ locale_ tag - Validates a locale tag. Returns true if the locale tag has valid structure.
- is_
valid_ script_ code - Validates a script code (ISO 15924). Returns true if the code is a valid 4-letter script code with title case.
- normalize_
locale_ string - Normalizes a locale string to a standard format. Examples: “en_US” -> “en-US”, “ja” -> “ja”, “ZH-HANS-CN” -> “zh-Hans-CN”
- suggest_
best_ locale - Suggests the best matching locale from a list of available locales. Uses fallback chain logic to find the best match.
Type Aliases§
- I18n
Result - Result type for i18n operations.
- Quality
Score - Translation quality score (0.0 to 1.0).