25 lines
609 B
Python
25 lines
609 B
Python
"""
|
|
Data models for Android XML Translation Tool
|
|
"""
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Optional, List
|
|
|
|
|
|
@dataclass
|
|
class TranslationItem:
|
|
"""Represents a single translation item (string or string-array)"""
|
|
name: str
|
|
value: str
|
|
comment: Optional[str] = None
|
|
item_type: str = "string" # "string" or "string-array"
|
|
items: List[str] = field(default_factory=list) # For string-array items
|
|
|
|
|
|
@dataclass
|
|
class TranslationBatch:
|
|
"""Represents a batch of translations to process"""
|
|
items: list[TranslationItem]
|
|
target_language: str
|
|
target_file: str
|