Skip to main content

Crate legalis_i18n

Crate legalis_i18n 

Source
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§

AIQualityScore
AI quality score for a specific metric.
AccessibilitySubtitleGenerator
Accessibility subtitle generator for legal proceedings.
Address
Address components for legal documents.
AddressFormatter
Address formatter for legal documents per jurisdiction.
AdjustedText
Adjusted text with reading level information.
AnalysisResult
Analysis result from legal reasoning engine.
ArchaicTerm
Archaic legal term with historical context.
ArchaicTermDictionary
Archaic term dictionary for historical legal language.
AudioDescriptionGenerator
Audio description generator for legal documents. Generates descriptive text for charts, diagrams, and complex structures.
AudioNarrationSupport
Audio narration support with SSML integration.
BCP47LanguageTag
IETF BCP 47 language tag.
BatchTranslator
Batch translation operations with parallel processing support.
BidirectionalText
RTL (Right-to-Left) text handler for Arabic and Hebrew legal documents.
BrailleFormatter
Braille formatter for visual accessibility. Supports Grade 1 (uncontracted) and Grade 2 (contracted) Braille.
CLDRData
CLDR (Common Locale Data Repository) integration.
CLDREntry
CLDR data entry.
CalendarConverter
Calendar converter for converting dates between calendar systems.
CalendarDate
Date representation in a calendar system.
CitationCompletenessChecker
Citation completeness checker.
CitationComponents
Legal citation components.
CitationFormatter
Citation formatter for legal documents.
CitationNormalizer
Citation normalizer for converting between citation styles.
CitationParser
Citation parser for extracting components from citation strings.
CitationSuggester
Citation format suggester.
CitationValidationRule
Validation rule for a citation component.
CitationValidator
Citation validator for checking citations against style rules.
ClassifiedClause
Classified clause with confidence score.
ClauseClassifier
Contract clause classifier.
ClauseExtractor
Key clause extractor for legal documents.
ColonialLegacy
Colonial legacy mapping.
ColonialLegacyMapper
Colonial legacy mapper.
CompletenessReport
Report on citation completeness.
ComplianceNormalizer
Compliance language normalizer.
ComplianceReport
WCAG compliance report.
ComplianceTerm
Compliance term with normalized variants.
ConceptMapper
Cross-lingual concept mapper.
ContextDisambiguator
Context-aware disambiguator for legal terms.
Contribution
Community contribution.
ContributionWorkflow
Community contribution workflow manager.
CourtParticipant
Court proceeding participant with language preference.
CourtProceedingTranslator
Court proceeding live translation system.
CrossLingualCaseSearch
Cross-lingual case search engine.
CrossReferenceFormatter
Cross-reference formatter for internal document references.
CrossRegionalTermEquivalenceRegistry
Registry of cross-regional term equivalences.
CulturalContext
Cultural context annotation.
CulturalContextRegistry
Cultural context registry.
CulturalParams
Cultural parameters affecting legal interpretation.
CurrencyFormatter
Currency formatter for monetary values.
DateTimeFormatter
Date/time formatter for legal deadlines.
DeadlineCalculator
Legal deadline calculator with time zone and business day support.
DeadlineExtractor
Deadline extractor for legal documents with calendar integration.
Dialect
Dialect variation.
DialectHandler
Dialect handler.
DialectTerminology
Dialect-aware terminology for regional language variations.
DialectTerminologyRegistry
Registry of dialect terminologies.
DisambiguationContext
Disambiguation context for legal translation.
DocumentAnalysis
Complete analysis of a legal document.
DocumentNumbering
Legal document numbering formatter.
DocumentSimilarityCalculator
Document similarity calculator for legal documents.
DocumentTemplate
Legal document template with placeholders and localization.
DocumentTemplateRegistry
Registry of legal document templates.
EUMemberStateRegistry
Registry of EU member state variations.
EUMemberStateVariation
EU member state variation information.
EURegulationAligner
EU regulation language aligner.
EURegulationTerm
EU regulation term with aligned translations.
EquivalentTerm
Equivalent term in another jurisdiction.
Etymology
Etymology information for a legal term.
EtymologyTracker
Etymology tracker for legal terms.
ExtendedLanguage
Extended language information for emerging markets.
ExtendedLanguageRegistry
Extended language registry with 50+ languages.
ExtractedClause
Extracted clause from a legal document.
ExtractedDeadline
Extracted deadline from a legal document.
ExtractedObligation
Extracted obligation from a legal document.
FiscalYearConfig
Fiscal year configuration per jurisdiction.
FootnoteFormatter
Footnote or endnote formatter.
GlossaryEnforcer
Glossary enforcer for terminology consistency.
GlossaryViolation
Glossary violation.
HistoricalCalendarConverter
Historical calendar converter.
HistoricalContext
Historical context annotation.
HistoricalContextAnnotator
Historical context annotator.
ISO639_3
ISO 639-3 language code (3-letter code).
ISO639_3_Registry
Registry for ISO 639-3 language codes.
IdentifiedParty
Identified party in a legal document.
IndexEntry
Index entry.
IndexGenerator
Index generator.
IndigenousLawRegistry
Indigenous law registry.
IndigenousLawSystem
Indigenous legal tradition.
InterpretedSegment
Interpreted segment with source and target text.
Jurisdiction
Jurisdiction definition.
JurisdictionDetector
Jurisdiction detector for legal documents.
JurisdictionRegistry
Jurisdiction registry.
KeyTermExtractor
Key term extractor using TF-IDF.
KnowledgeGraphEdge
Knowledge graph edge representing a relationship.
KnowledgeGraphNode
Knowledge graph node representing a legal entity.
LLMTranslator
LLM-based legal translator (infrastructure for external LLM integration).
LazyDictionary
Lazy-loading dictionary wrapper for efficient memory usage with large dictionaries. Loads dictionary data on-demand using Arc<Mutex> for thread-safe initialization.
LegalCase
Legal case metadata for cross-lingual search.
LegalConcept
Legal concept for cross-lingual mapping.
LegalConceptMapping
Mapping between legal concepts across different legal systems.
LegalConceptRegistry
Registry of legal concept mappings between different legal systems.
LegalDictionary
Translation dictionary for legal terms.
LegalDocumentAnalyzer
Comprehensive legal document analyzer.
LegalEntity
Recognized legal entity.
LegalEntityRecognizer
Legal entity recognizer for identifying entities in legal text.
LegalExtension
Unicode CLDR legal extension.
LegalPromptTemplate
Legal translation prompt template.
LegalReasoningEngine
Language-agnostic legal reasoning engine.
LegalRiskScorer
Legal risk scorer for documents.
LegalSpeechTranscriber
Speech-to-text legal transcription engine.
LegalTopic
Legal topic for topic modeling.
LegalTopicModeler
Legal topic modeler for extracting topics from legal documents.
LocalCustom
Local custom.
LocalCustomRegistry
Local custom registry.
LocalLawDatabase
Local law terminology database.
LocalLawTerm
Local law terminology entry.
Locale
Language/locale identifier.
LowResourceConfig
Low-resource language configuration.
LowResourceSupport
Low-resource language support manager.
MTTranslation
Neural machine translation result.
MTWithMemory
Translation with memory integration.
MachineTranslationFallback
Machine translation fallback manager. Uses translation memory first, then falls back to external services.
MessageFormatter
ICU-style message formatter.
MockTranslationService
Mock translation service for testing and fallback.
MultilingualEmbedder
Multilingual semantic embedder for legal text.
MultilingualHearing
Multilingual hearing support with channel management.
MultilingualKnowledgeGraph
Multilingual knowledge graph for legal concepts.
NameFormatter
Name formatter for legal documents following cultural conventions.
NeuralMachineTranslator
Neural machine translator for legal documents.
NumberFormatter
Number formatter for locale-specific number formatting.
ObligationExtractor
Obligation extractor for legal documents.
PartyIdentifier
Party identifier for legal documents.
PersonName
Personal name components for legal documents.
PlainLanguageConverter
Plain language converter for legal terminology. Converts complex legal jargon to accessible plain language.
PlainLanguageGenerator
Plain language generator with AI-assisted simplification.
PluralRules
Plural rules for a specific locale.
PostEditFeedback
Post-editing feedback.
PostEditingWorkflow
Post-editing workflow for translation review.
QualityEstimationReport
Quality estimation report for AI translation.
QualityEstimator
Quality estimator for AI-powered translations.
ReadabilityReport
Readability assessment report.
ReadingLevelAdjuster
Reading level adjuster for adaptive content.
ReadingLevelAssessor
Reading level assessor for legal documents. Calculates readability metrics like Flesch-Kincaid grade level.
RegionalConceptMapper
Registry of regional legal concept mappings.
RegionalConceptMapping
Regional legal concept mapper for cross-jurisdictional equivalence.
RegionalVariation
Regional variation information for a locale.
RegionalVariationRegistry
Registry of regional variations for locales.
RegulatoryEquivalence
Regulatory equivalence mapping between two jurisdictions.
RegulatoryEquivalenceMapper
Regulatory equivalence mapper.
ReligiousLawRegistry
Religious law registry.
ReligiousLawSystem
Religious law system.
RiskFactor
Risk factor identified in a document.
ScreenReaderFormatter
Screen reader friendly formatter for accessibility. Generates ARIA labels, semantic markup, and screen reader optimized text.
ScreenReaderOptimizer
Screen reader optimizer with enhanced WCAG compliance.
SearchResult
Search result with similarity score.
SemanticEmbedding
Multilingual semantic embedding for legal text.
SignLanguageReference
Sign language reference for video/image linking.
SignLanguageReferencer
Sign language referencer for legal terminology.
SimilarityScore
Document similarity score.
SimultaneousInterpreter
Simultaneous interpretation engine with streaming support.
StandardAdoption
Standard adoption record for a jurisdiction.
StandardAdoptionTracker
International standard adoption tracker.
StylePreservingTranslator
Style-preserving translator.
StyleProfile
Style profile for legal text.
SubRegionalVariation
Sub-regional variation (state/province level) information.
SubRegionalVariationRegistry
Registry of sub-regional variations (states, provinces, etc.).
SubtitleCue
Subtitle timing and styling.
TableOfContents
Table of contents generator.
TemplateSection
Template section that can be conditionally included.
TemplateVariable
Template variable with type validation.
TermEquivalence
Cross-regional term equivalence for legal terminology.
TermIndex
Term index for fast prefix-based lookups in dictionaries. Enables efficient autocomplete, fuzzy search, and partial matching.
TerminologyAwareTranslator
Terminology-aware translator that preserves legal terms.
TerminologyExtractor
Legal term extractor for extracting terminology from statutes.
TextCollator
Text collator for locale-aware sorting and comparison.
TfIdfScore
Term frequency-inverse document frequency (TF-IDF) score.
TimeZone
Time zone representation for legal deadlines.
TimeZoneRegistry
Registry of common time zones used in legal practice.
TocEntry
Table of contents entry.
TranscriptionSegment
Transcription segment with timing information.
TranslationManager
Multi-locale translation manager with LRU caching support.
TranslationMemory
Translation memory for caching and reusing translations.
TranslationMemoryEntry
Translation memory entry.
TreatyStandardizer
Treaty language standardizer.
TreatyTerm
Standardized treaty term.
ValidationReport
Comprehensive validation report.
W3CComplianceChecker
W3C internationalization compliance checker.
W3CComplianceReport
W3C compliance report.
WorkingDaysConfig
Working days configuration for a jurisdiction.

Enums§

AdoptionStatus
International standard adoption status.
AudioQuality
Audio quality level for speech recognition.
BrailleGrade
Braille grade (complexity level).
CLDRFieldType
CLDR (Common Locale Data Repository) field type.
CalendarSystem
Calendar system type.
CitationError
Citation validation errors.
CitationStyle
Citation style for legal documents.
CitationType
Citation type for validation.
ClauseClass
Contract clause classification types.
ClauseType
Types of legal clauses found in documents.
ColonialPower
Colonial legacy type.
ContextCategory
Cultural context category.
ContributionStatus
Contribution status.
CourtParticipantRole
Court proceeding participant role.
CustomType
Local custom type.
DayOfWeek
Day of week.
DialectType
Dialect variation type.
DisambiguationType
Context disambiguation type.
DocumentTemplateType
Type of legal document template.
EURegulationType
EU regulation type for language alignment.
EmbeddingModel
Semantic embedding model for multilingual legal text.
EmphasisLevel
Emphasis level for SSML.
EquivalenceLevel
Level of equivalence between terms.
FootnoteStyle
HistoricalCalendar
Historical calendar system.
HistoricalPeriod
Historical period for legal language.
I18nError
Errors during internationalization operations.
InterpretationMode
Interpretation mode for real-time translation.
LLMProvider
LLM provider type for AI-powered translation.
LanguageFamily
Language family for etymology.
LanguageScope
Scope of language in ISO 639-3.
LanguageType
Type of language in ISO 639-3.
LegalDomain
Legal domain specializations.
LegalEntityType
Legal entity types for recognition.
LegalExtensionType
Unicode CLDR legal extension type.
LegalSpeechDomain
Legal domain specialization for speech recognition.
LegalSystem
Legal system classification.
LowResourceStrategy
Low-resource language support strategy.
NameOrder
Name order convention for different cultures.
NormalizationLevel
Compliance language normalization level.
NumberingStyle
Legal document numbering styles.
ObligationType
Type of legal obligation.
PartyRole
Party role in a legal document.
PluralCategory
Plural category for pluralization rules.
PostEditAction
Post-editing action.
QualityMetric
Quality estimation metric for AI translations.
RegulatoryDomain
Regulatory domain for equivalence mapping.
RegulatoryEquivalenceLevel
Regulatory equivalence level between jurisdictions.
ReligiousLawType
Religious law system type.
RiskLevel
Risk level for legal documents.
SSMLTag
SSML (Speech Synthesis Markup Language) tag type.
SignLanguageType
Sign language type.
SimplificationStrategy
Simplification strategy for plain language generation.
StandardType
International standard type.
StyleAttribute
Writing style attribute for translation.
SubtitlePosition
Subtitle position on screen.
TargetReadingLevel
Reading level to adjust to.
TermPreservationMode
Term preservation mode.
TextDirection
Text direction for layout and display.
TranslationEngine
Translation engine type.
TreatyType
Treaty type for language standardization.
VariableType
Type of template variable for validation.
ViolationType
Glossary violation type.
WCAGLevel
WCAG conformance level.

Traits§

TranslationService
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§

I18nResult
Result type for i18n operations.
QualityScore
Translation quality score (0.0 to 1.0).