Buckets:

download
raw
38.3 kB
#!/usr/bin/env python3
"""
Professional Tamil localization completion script.
Translates all 1833 keys from en.json to ta.json using glossary and comprehensive mappings.
"""
import json
import re
from pathlib import Path
# Base directory
BASE_DIR = Path(__file__).parent.parent.parent
# Load files
with open(BASE_DIR / "ciris_engine/data/localized/en.json", "r", encoding="utf-8") as f:
en_data = json.load(f)
with open(BASE_DIR / "ciris_engine/data/localized/ta.json", "r", encoding="utf-8") as f:
ta_existing = json.load(f)
# Comprehensive Tamil translation dictionary
TRANSLATIONS = {
# Technical terms that should stay in English
"API": "API",
"DMA": "DMA",
"LLM": "LLM",
"JSON": "JSON",
"UUID": "UUID",
"URL": "URL",
"HTTP": "HTTP",
"HTTPS": "HTTPS",
"SSH": "SSH",
"CLI": "CLI",
"GUI": "GUI",
"SDK": "SDK",
"OAuth": "OAuth",
"JWT": "JWT",
"Discord": "Discord",
"GitHub": "GitHub",
"OpenAI": "OpenAI",
"LocalAI": "LocalAI",
"PDMA": "PDMA",
"CSDMA": "CSDMA",
"IDMA": "IDMA",
"ASPDMA": "ASPDMA",
"DSDMA": "DSDMA",
"TSASPDMA": "TSASPDMA",
"ID": "அடையாளம்",
"TSDB": "TSDB",
# Core CIRIS concepts (from glossary)
"ACCORD": "உடன்படிக்கை",
"Wise Authority": "அறிவார்ந்த அதிகாரம்",
"Conscience": "மனசாட்சி",
"Principal Hierarchy": "முதன்மை படிநிலை",
"Coherence": "ஒத்திசைவு",
"Epistemic Humility": "அறிவார்ந்த பணிவு",
"Integrity": "நேர்மை",
"Resilience": "மீள்தன்மை",
"Signalling Gratitude": "நன்றி தெரிவித்தல்",
"Flourishing": "செழிப்பு",
"Ubuntu": "உபுண்டு",
# Action verbs
"observe": "கவனி",
"Observe": "கவனி",
"speak": "பேசு",
"Speak": "பேசு",
"tool": "கருவி",
"Tool": "கருவி",
"reject": "நிராகரி",
"Reject": "நிராகரி",
"ponder": "சிந்தி",
"Ponder": "சிந்தி",
"defer": "ஒப்படை",
"Defer": "ஒப்படை",
"memorize": "நினைவில் வை",
"Memorize": "நினைவில் வை",
"recall": "நினைவுபடுத்து",
"Recall": "நினைவுபடுத்து",
"forget": "மற",
"Forget": "மற",
"task_complete": "பணி நிறைவு",
"Task Complete": "பணி நிறைவு",
# States
"wakeup": "விழி",
"Wakeup": "விழி",
"work": "வேலை",
"Work": "வேலை",
"play": "விளையாட்டு",
"Play": "விளையாட்டு",
"solitude": "தனிமை",
"Solitude": "தனிமை",
"dream": "கனவு",
"Dream": "கனவு",
"shutdown": "நிறுத்து",
"Shutdown": "நிறுத்து",
# Common UI elements
"Login": "உள்நுழை",
"login": "உள்நுழை",
"Logout": "வெளியேறு",
"logout": "வெளியேறு",
"Settings": "அமைப்புகள்",
"settings": "அமைப்புகள்",
"Messages": "செய்திகள்",
"messages": "செய்திகள்",
"Message": "செய்தி",
"message": "செய்தி",
"Send": "அனுப்பு",
"send": "அனுப்பு",
"Cancel": "ரத்து",
"cancel": "ரத்து",
"Confirm": "உறுதிப்படுத்து",
"confirm": "உறுதிப்படுத்து",
"Error": "பிழை",
"error": "பிழை",
"Warning": "எச்சரிக்கை",
"warning": "எச்சரிக்கை",
"Success": "வெற்றி",
"success": "வெற்றி",
"Loading": "ஏற்றுகிறது",
"loading": "ஏற்றுகிறது",
"Save": "சேமி",
"save": "சேமி",
"Delete": "நீக்கு",
"delete": "நீக்கு",
"Edit": "திருத்து",
"edit": "திருத்து",
"Close": "மூடு",
"close": "மூடு",
"Open": "திற",
"open": "திற",
"Help": "உதவி",
"help": "உதவி",
"About": "பற்றி",
"about": "பற்றி",
"Home": "முகப்பு",
"home": "முகப்பு",
"Chat": "அரட்டை",
"chat": "அரட்டை",
"Memory": "நினைவகம்",
"memory": "நினைவகம்",
"Trust": "நம்பகத்தன்மை",
"trust": "நம்பகத்தன்மை",
"Transparency": "வெளிப்படைத்தன்மை",
"transparency": "வெளிப்படைத்தன்மை",
"Yes": "ஆம்",
"yes": "ஆம்",
"No": "இல்லை",
"no": "இல்லை",
"OK": "சரி",
"ok": "சரி",
"Back": "பின்செல்",
"back": "பின்செல்",
"Next": "அடுத்தது",
"next": "அடுத்தது",
"Continue": "தொடரவும்",
"continue": "தொடரவும்",
"Finish": "நிறைவு செய்",
"finish": "நிறைவு செய்",
"Search": "தேடு",
"search": "தேடு",
"Filter": "வடிகட்டு",
"filter": "வடிகட்டு",
"All": "அனைத்தும்",
"all": "அனைத்தும்",
"None": "எதுவுமில்லை",
"none": "எதுவுமில்லை",
"Status": "நிலை",
"status": "நிலை",
"Version": "பதிப்பு",
"version": "பதிப்பு",
"Health": "நலம்",
"health": "நலம்",
"Metrics": "அளவீடுகள்",
"metrics": "அளவீடுகள்",
"Events": "நிகழ்வுகள்",
"events": "நிகழ்வுகள்",
"Event": "நிகழ்வு",
"event": "நிகழ்வு",
"History": "வரலாறு",
"history": "வரலாறு",
"Current": "தற்போதைய",
"current": "தற்போதைய",
"Pending": "நிலுவையில்",
"pending": "நிலுவையில்",
"Completed": "நிறைவடைந்தது",
"completed": "நிறைவடைந்தது",
"Failed": "தோல்வியுற்றது",
"failed": "தோல்வியுற்றது",
"Online": "இணையத்தில்",
"online": "இணையத்தில்",
"Offline": "இணையமில்லாமல்",
"offline": "இணையமில்லாமல்",
"Name": "பெயர்",
"name": "பெயர்",
"Type": "வகை",
"type": "வகை",
"Time": "நேரம்",
"time": "நேரம்",
"Date": "தேதி",
"date": "தேதி",
"User": "பயனர்",
"user": "பயனர்",
"System": "அமைப்பு",
"system": "அமைப்பு",
"Tasks": "பணிகள்",
"tasks": "பணிகள்",
"Task": "பணி",
"task": "பணி",
"Info": "தகவல்",
"info": "தகவல்",
"Information": "தகவல்",
"information": "தகவல்",
"Details": "விவரங்கள்",
"details": "விவரங்கள்",
"View": "காண்",
"view": "காண்",
"Download": "பதிவிறக்கு",
"download": "பதிவிறக்கு",
"Upload": "பதிவேற்று",
"upload": "பதிவேற்று",
"Export": "ஏற்றுமதி",
"export": "ஏற்றுமதி",
"Import": "இறக்குமதி",
"import": "இறக்குமதி",
"Clear": "அழி",
"clear": "அழி",
"Reset": "மீட்டமை",
"reset": "மீட்டமை",
"Refresh": "புதுப்பி",
"refresh": "புதுப்பி",
"Update": "புதுப்பி",
"update": "புதுப்பி",
"Create": "உருவாக்கு",
"create": "உருவாக்கு",
"Add": "சேர்",
"add": "சேர்",
"Remove": "அகற்று",
"remove": "அகற்று",
"Enable": "செயல்படுத்து",
"enable": "செயல்படுத்து",
"Disable": "செயலிழக்கச்செய்",
"disable": "செயலிழக்கச்செய்",
"Active": "செயலில்",
"active": "செயலில்",
"Inactive": "செயலில்லாத",
"inactive": "செயலில்லாத",
"Available": "கிடைக்கக்கூடியது",
"available": "கிடைக்கக்கூடியது",
"Unavailable": "கிடைக்காதது",
"unavailable": "கிடைக்காதது",
"Unknown": "அறியாத",
"unknown": "அறியாத",
"Required": "தேவை",
"required": "தேவை",
"Optional": "விரும்பினால்",
"optional": "விரும்பினால்",
"General": "பொது",
"general": "பொது",
"Advanced": "மேம்பட்ட",
"advanced": "மேம்பட்ட",
"Basic": "அடிப்படை",
"basic": "அடிப்படை",
"Custom": "விரும்பியபடி",
"custom": "விரும்பியபடி",
"Default": "இயல்புநிலை",
"default": "இயல்புநிலை",
"Language": "மொழி",
"language": "மொழி",
"Location": "இருப்பிடம்",
"location": "இருப்பிடம்",
"Country": "நாடு",
"country": "நாடு",
"Region": "பிராந்தியம்",
"region": "பிராந்தியம்",
"City": "நகரம்",
"city": "நகரம்",
"Address": "முகவரி",
"address": "முகவரி",
"Network": "வலையமைப்பு",
"network": "வலையமைப்பு",
"Connection": "இணைப்பு",
"connection": "இணைப்பு",
"Provider": "வழங்குநர்",
"provider": "வழங்குநர்",
"Model": "மாதிரி",
"model": "மாதிரி",
"Key": "விசை",
"key": "விசை",
"Token": "டோக்கன்",
"token": "டோக்கன்",
"Balance": "இருப்பு",
"balance": "இருப்பு",
"Usage": "பயன்பாடு",
"usage": "பயன்பாடு",
"Credits": "கடன்கள்",
"credits": "கடன்கள்",
"Transaction": "பரிவர்த்தனை",
"transaction": "பரிவர்த்தனை",
"Receive": "பெறு",
"receive": "பெறு",
"Level": "நிலை",
"level": "நிலை",
"Role": "பங்கு",
"role": "பங்கு",
"Purpose": "நோக்கம்",
"purpose": "நோக்கம்",
"Capabilities": "திறன்கள்",
"capabilities": "திறன்கள்",
"Permissions": "அனுமதிகள்",
"permissions": "அனுமதிகள்",
"Permission": "அனுமதி",
"permission": "அனுமதி",
"Granted": "வழங்கப்பட்டது",
"granted": "வழங்கப்பட்டது",
"Denied": "மறுக்கப்பட்டது",
"denied": "மறுக்கப்பட்டது",
"Camera": "கேமரா",
"camera": "கேமரா",
"Microphone": "மைக்ரோஃபோன்",
"microphone": "மைக்ரோஃபோன்",
"Storage": "சேமிப்பு",
"storage": "சேமிப்பு",
"Duration": "கால அளவு",
"duration": "கால அளவு",
"Uptime": "இயங்கும் நேரம்",
"uptime": "இயங்கும் நேரம்",
"Mode": "முறை",
"mode": "முறை",
"Control": "கட்டுப்பாடு",
"control": "கட்டுப்பாடு",
"State": "நிலை",
"state": "நிலை",
"Signature": "கையொப்பம்",
"signature": "கையொப்பம்",
"Verified": "சரிபார்க்கப்பட்டது",
"verified": "சரிபார்க்கப்பட்டது",
"Trail": "தடம்",
"trail": "தடம்",
"Nodes": "முனைகள்",
"nodes": "முனைகள்",
"Edges": "விளிம்புகள்",
"edges": "விளிம்புகள்",
"Relationships": "உறவுகள்",
"relationships": "உறவுகள்",
"Result": "முடிவு",
"result": "முடிவு",
"Results": "முடிவுகள்",
"results": "முடிவுகள்",
"Executing": "செயல்படுத்துகிறது",
"executing": "செயல்படுத்துகிறது",
"Analyzing": "பகுப்பாய்வு செய்கிறது",
"analyzing": "பகுப்பாய்வு செய்கிறது",
"Processing": "செயலாக்குகிறது",
"processing": "செயலாக்குகிறது",
"Initializing": "துவக்குகிறது",
"initializing": "துவக்குகிறது",
"Connecting": "இணைக்கிறது",
"connecting": "இணைக்கிறது",
"Ready": "தயார்",
"ready": "தயார்",
"Thinking": "சிந்திக்கிறது",
"thinking": "சிந்திக்கிறது",
"Invalid": "செல்லாது",
"invalid": "செல்லாது",
"Format": "வடிவம்",
"format": "வடிவம்",
"Timeout": "காலாவதி",
"timeout": "காலாவதி",
"Authentication": "அங்கீகாரம்",
"authentication": "அங்கீகாரம்",
"Authorization": "அங்கீகாரம்",
"authorization": "அங்கீகாரம்",
"Access": "அணுகல்",
"access": "அணுகல்",
"Forbidden": "தடை செய்யப்பட்டது",
"forbidden": "தடை செய்யப்பட்டது",
"Not Found": "காணப்படவில்லை",
"not found": "காணப்படவில்லை",
"Server Error": "சேவையக பிழை",
"server error": "சேவையக பிழை",
"Service Unavailable": "சேவை கிடைக்கவில்லை",
"service unavailable": "சேவை கிடைக்கவில்லை",
"Agent": "முகவர்",
"agent": "முகவர்",
"Adapter": "அடாப்டர்",
"adapter": "அடாப்டர்",
"Service": "சேவை",
"service": "சேவை",
"Services": "சேவைகள்",
"services": "சேவைகள்",
"Pipeline": "குழாய்வழி",
"pipeline": "குழாய்வழி",
"Graph": "வரைபடம்",
"graph": "வரைபடம்",
"Wallet": "பணப்பை",
"wallet": "பணப்பை",
"Tools": "கருவிகள்",
"tools": "கருவிகள்",
"Validation": "சரிபார்ப்பு",
"validation": "சரிபார்ப்பு",
"Notifications": "அறிவிப்புகள்",
"notifications": "அறிவிப்புகள்",
"Notification": "அறிவிப்பு",
"notification": "அறிவிப்பு",
"Errors": "பிழைகள்",
"errors": "பிழைகள்",
"Audit": "தணிக்கை",
"audit": "தணிக்கை",
"Billing": "கட்டணம்",
"billing": "கட்டணம்",
"Config": "அமைப்பு",
"config": "அமைப்பு",
"Configuration": "அமைப்பு",
"configuration": "அமைப்பு",
"Consent": "சம்மதம்",
"consent": "சம்மதம்",
"Data": "தரவு",
"data": "தரவு",
"Logs": "பதிவுகள்",
"logs": "பதிவுகள்",
"Log": "பதிவு",
"log": "பதிவு",
"Telemetry": "தொலைமதிப்பீடு",
"telemetry": "தொலைமதிப்பீடு",
"Tickets": "டிக்கெட்டுகள்",
"tickets": "டிக்கெட்டுகள்",
"Ticket": "டிக்கெட்",
"ticket": "டிக்கெட்",
"Panel": "பலகம்",
"panel": "பலகம்",
"Guidance": "வழிகாட்டுதல்",
"guidance": "வழிகாட்டுதல்",
"Endpoint": "முடிவுப் புள்ளி",
"endpoint": "முடிவுப் புள்ளி",
"Temperature": "வெப்பநிலை",
"temperature": "வெப்பநிலை",
"Proxy": "பதிலி",
"proxy": "பதிலி",
"Template": "வார்ப்புரு",
"template": "வார்ப்புரு",
"Attestation": "சான்றளிப்பு",
"attestation": "சான்றளிப்பு",
"Binary": "பைனரி",
"binary": "பைனரி",
"Environment": "சூழல்",
"environment": "சூழல்",
"Registry": "பதிவு",
"registry": "பதிவு",
"File": "கோப்பு",
"file": "கோப்பு",
"Fingerprint": "விரலடையாளம்",
"fingerprint": "விரலடையாளம்",
"Paymaster": "பணம் செலுத்துபவர்",
"paymaster": "பணம் செலுத்துபவர்",
"Experimental": "சோதனை",
"experimental": "சோதனை",
"Warning": "எச்சரிக்கை",
"Caution": "எச்சரிக்கை",
"caution": "எச்சரிக்கை",
"Timestamp": "நேர முத்திரை",
"timestamp": "நேர முத்திரை",
"Scope": "எல்லை",
"scope": "எல்லை",
"Range": "வரம்பு",
"range": "வரம்பு",
"Node": "முனை",
"node": "முனை",
"Edge": "விளிம்பு",
"edge": "விளிம்பு",
"Relationship": "உறவு",
"relationship": "உறவு",
"Scheduled": "திட்டமிடப்பட்டது",
"scheduled": "திட்டமிடப்பட்டது",
"Scheduler": "திட்டமிடுபவர்",
"scheduler": "திட்டமிடுபவர்",
"Runtime": "இயக்க நேரம்",
"runtime": "இயக்க நேரம்",
"Secrets": "ரகசியங்கள்",
"secrets": "ரகசியங்கள்",
"Secret": "ரகசியம்",
"secret": "ரகசியம்",
"Initialization": "துவக்கம்",
"initialization": "துவக்கம்",
"Maintenance": "பராமரிப்பு",
"maintenance": "பராமரிப்பு",
"Database": "தரவுத்தளம்",
"database": "தரவுத்தளம்",
"Observation": "கவனிப்பு",
"observation": "கவனிப்பு",
"Self": "சுய",
"self": "சுய",
"Consolidation": "ஒருங்கிணைப்பு",
"consolidation": "ஒருங்கிணைப்பு",
"Monitor": "கண்காணிப்பாளர்",
"monitor": "கண்காணிப்பாளர்",
"Monitoring": "கண்காணிப்பு",
"monitoring": "கண்காணிப்பு",
"Resource": "வளம்",
"resource": "வளம்",
"Resources": "வளங்கள்",
"resources": "வளங்கள்",
"Incident": "சம்பவம்",
"incident": "சம்பவம்",
"Incidents": "சம்பவங்கள்",
"incidents": "சம்பவங்கள்",
"Management": "மேலாண்மை",
"management": "மேலாண்மை",
"Visibility": "காணலாம்தன்மை",
"visibility": "காணலாம்தன்மை",
"Adaptive": "தகவமைப்பு",
"adaptive": "தகவமைப்பு",
"Unified": "ஒருங்கிணைந்த",
"unified": "ஒருங்கிணைந்த",
"Session": "அமர்வு",
"session": "அமர்வு",
"Sessions": "அமர்வுகள்",
"sessions": "அமர்வுகள்",
"Closed": "மூடப்பட்ட",
"closed": "மூடப்பட்ட",
"Evaluating": "மதிப்பீடு செய்கிறது",
"evaluating": "மதிப்பீடு செய்கிறது",
"Field": "புலம்",
"field": "புலம்",
"Action": "செயல்",
"action": "செயல்",
"Actions": "செயல்கள்",
"actions": "செயல்கள்",
"Context": "சூழல்",
"context": "சூழல்",
"Output": "வெளியீடு",
"output": "வெளியீடு",
"Input": "உள்ளீடு",
"input": "உள்ளீடு",
"Parameters": "அளவுருக்கள்",
"parameters": "அளவுருக்கள்",
"Parameter": "அளவுரு",
"parameter": "அளவுரு",
"Requester": "கோரிக்கையாளர்",
"requester": "கோரிக்கையாளர்",
"Request": "கோரிக்கை",
"request": "கோரிக்கை",
"Response": "பதில்",
"response": "பதில்",
"Thought": "சிந்தனை",
"thought": "சிந்தனை",
"Thoughts": "சிந்தனைகள்",
"thoughts": "சிந்தனைகள்",
"Deferral": "ஒப்படைப்பு",
"deferral": "ஒப்படைப்பு",
"Until": "வரை",
"until": "வரை",
"Value": "மதிப்பு",
"value": "மதிப்பு",
"Values": "மதிப்புகள்",
"values": "மதிப்புகள்",
"Title": "தலைப்பு",
"title": "தலைப்பு",
"Description": "விவரம்",
"description": "விவரம்",
"Reason": "காரணம்",
"reason": "காரணம்",
"Server": "சேவையகம்",
"server": "சேவையகம்",
"Chain": "சங்கிலி",
"chain": "சங்கிலி",
"Hash": "ஹாஷ்",
"hash": "ஹாஷ்",
"Load": "ஏற்று",
"load": "ஏற்று",
"More": "மேலும்",
"more": "மேலும்",
"No": "இல்லை",
"Entries": "உள்ளீடுகள்",
"entries": "உள்ளீடுகள்",
"Entry": "உள்ளீடு",
"entry": "உள்ளீடு",
"Questions": "கேள்விகள்",
"questions": "கேள்விகள்",
"Question": "கேள்வி",
"question": "கேள்வி",
"Security": "பாதுகாப்பு",
"security": "பாதுகாப்பு",
"Showing": "காட்டுகிறது",
"showing": "காட்டுகிறது",
"Execution": "செயல்படுத்தல்",
"execution": "செயல்படுத்தல்",
"Try": "முயற்சி",
"try": "முயற்சி",
"Filters": "வடிகட்டிகள்",
"filters": "வடிகட்டிகள்",
"Common": "பொது",
"common": "பொது",
"About": "பற்றி",
"Choose": "தேர்வு செய்",
"choose": "தேர்வு செய்",
"Stream": "ஓடை",
"stream": "ஓடை",
"Expires": "காலாவதியாகிறது",
"expires": "காலாவதியாகிறது",
"Impact": "தாக்கம்",
"impact": "தாக்கம்",
"Interactions": "தொடர்புகள்",
"interactions": "தொடர்புகள்",
"Interaction": "தொடர்பு",
"interaction": "தொடர்பு",
"Created": "உருவாக்கப்பட்டது",
"created": "உருவாக்கப்பட்டது",
"Not": "இல்லை",
"not": "இல்லை",
"Partnership": "கூட்டாண்மை",
"partnership": "கூட்டாண்மை",
"Patterns": "மாதிரிகள்",
"patterns": "மாதிரிகள்",
"Pattern": "மாதிரி",
"pattern": "மாதிரி",
"Change": "மாற்று",
"change": "மாற்று",
"By": "மூலம்",
"by": "மூலம்",
"Short": "குறுகிய",
"short": "குறுகிய",
"Long": "நீளமான",
"long": "நீளமான",
"Too": "மிகவும்",
"too": "மிகவும்",
"New": "புதிய",
"new": "புதிய",
"Arrived": "வந்தது",
"arrived": "வந்தது",
"Occurred": "ஏற்பட்டது",
"occurred": "ஏற்பட்டது",
"Alert": "எச்சரிக்கை",
"alert": "எச்சரிக்கை",
"Alerts": "எச்சரிக்கைகள்",
"alerts": "எச்சரிக்கைகள்",
"Operational": "செயல்படும்",
"operational": "செயல்படும்",
"Gathering": "சேகரிக்கிறது",
"gathering": "சேகரிக்கிறது",
"Deciding": "தீர்மானிக்கிறது",
"deciding": "தீர்மானிக்கிறது",
"Waiting": "காத்திருக்கிறது",
"waiting": "காத்திருக்கிறது",
"Wait": "காத்திரு",
"wait": "காத்திரு",
"Please": "தயவுசெய்து",
"please": "தயவுசெய்து",
"Process": "செயலாக்கு",
"process": "செயலாக்கு",
"Understand": "புரிந்துகொள்",
"understand": "புரிந்துகொள்",
"Perform": "செய்",
"perform": "செய்",
"Cannot": "முடியாது",
"cannot": "முடியாது",
"Check": "சரிபார்",
"check": "சரிபார்",
"Complete": "முழுமையான",
"complete": "முழுமையான",
"Successfully": "வெற்றிகரமாக",
"successfully": "வெற்றிகரமாக",
"Generic": "பொது",
"generic": "பொது",
"Problem": "சிக்கல்",
"problem": "சிக்கல்",
"Again": "மீண்டும்",
"again": "மீண்டும்",
"Took": "எடுத்தது",
"took": "எடுத்தது",
"Human": "மனித",
"human": "மனித",
"Advisor": "ஆலோசகர்",
"advisor": "ஆலோசகர்",
"Consult": "கலந்தாலோசி",
"consult": "கலந்தாலோசி",
"Let": "அனுமதி",
"let": "அனுமதி",
"Know": "தெரியும்",
"know": "தெரியும்",
"Clarify": "தெளிவுபடுத்து",
"clarify": "தெளிவுபடுத்து",
"Want": "விரும்பு",
"want": "விரும்பு",
"Say": "சொல்",
"say": "சொல்",
"Could": "முடியும்",
"could": "முடியும்",
"You": "நீங்கள்",
"you": "நீங்கள்",
"Chose": "தேர்ந்தெடுத்தது",
"chose": "தேர்ந்தெடுத்தது",
"If": "என்றால்",
"if": "என்றால்",
"Are": "ஆகும்",
"are": "ஆகும்",
"Account": "கணக்கு",
"account": "கணக்கு",
"Policy": "கொள்கை",
"policy": "கொள்கை",
"Blocked": "தடுக்கப்பட்டது",
"blocked": "தடுக்கப்பட்டது",
"Contact": "தொடர்பு",
"contact": "தொடர்பு",
"Later": "பின்னர்",
"later": "பின்னர்",
"Credit": "கடன்",
"credit": "கடன்",
"Resolved": "தீர்க்கப்பட்ட",
"resolved": "தீர்க்கப்பட்ட",
"Restarted": "மறுதொடக்கம் செய்யப்பட்டது",
"restarted": "மறுதொடக்கம் செய்யப்பட்டது",
"Stale": "பழைய",
"stale": "பழைய",
"Processing": "செயலாக்குகிறது",
"Automatically": "தானாகவே",
"automatically": "தானாகவே",
"Still": "இன்னும்",
"still": "இன்னும்",
"Need": "தேவை",
"need": "தேவை",
"Reply": "பதில்",
"reply": "பதில்",
"Resend": "மீண்டும் அனுப்பு",
"resend": "மீண்டும் அனுப்பு",
"Prior": "முந்தைய",
"prior": "முந்தைய",
"Validation": "சரிபார்ப்பு",
"Passed": "தேர்ச்சி",
"passed": "தேர்ச்சி",
"Start": "தொடக்கம்",
"start": "தொடக்கம்",
"Ethical": "நெறிமுறை",
"ethical": "நெறிமுறை",
"Considering": "பரிசீலிக்கிறது",
"considering": "பரிசீலிக்கிறது",
"Implications": "விளைவுகள்",
"implications": "விளைவுகள்",
"Implication": "விளைவு",
"implication": "விளைவு",
"Bring": "கொண்டு வா",
"bring": "கொண்டு வா",
"Your": "உங்கள்",
"your": "உங்கள்",
"Own": "சொந்த",
"own": "சொந்த",
"Compatible": "இணக்கமான",
"compatible": "இணக்கமான",
"Test": "சோதனை",
"test": "சோதனை",
"Successful": "வெற்றிகரமான",
"successful": "வெற்றிகரமான",
"Identity": "அடையாளம்",
"identity": "அடையாளம்",
"Verify": "சரிபார்",
"verify": "சரிபார்",
"Verification": "சரிபார்ப்பு",
"verification": "சரிபார்ப்பு",
"Integrity": "ஒருமைப்பாடு",
"integrity": "ஒருமைப்பாடு",
"Hardware": "வன்பொருள்",
"hardware": "வன்பொருள்",
"Backed": "ஆதரவு",
"backed": "ஆதரவு",
"Supported": "ஆதரிக்கப்படுகிறது",
"supported": "ஆதரிக்கப்படுகிறது",
"Feature": "அம்சம்",
"feature": "அம்சம்",
"Features": "அம்சங்கள்",
"features": "அம்சங்கள்",
"Use": "பயன்படுத்து",
"use": "பயன்படுத்து",
"Max": "அதிகபட்ச",
"max": "அதிகபட்ச",
"Maximum": "அதிகபட்சம்",
"maximum": "அதிகபட்சம்",
"Min": "குறைந்தபட்ச",
"min": "குறைந்தபட்ச",
"Minimum": "குறைந்தபட்சம்",
"minimum": "குறைந்தபட்சம்",
"Total": "மொத்தம்",
"total": "மொத்தம்",
"For": "க்கான",
"for": "க்கான",
"From": "இலிருந்து",
"from": "இலிருந்து",
"To": "க்கு",
"to": "க்கு",
"With": "உடன்",
"with": "உடன்",
"Without": "இல்லாமல்",
"without": "இல்லாமல்",
"Or": "அல்லது",
"or": "அல்லது",
"And": "மற்றும்",
"and": "மற்றும்",
"The": "",
"the": "",
"A": "",
"a": "",
"An": "",
"an": "",
"Is": "ஆகும்",
"is": "ஆகும்",
"Was": "இருந்தது",
"was": "இருந்தது",
"Be": "இரு",
"be": "இரு",
"Been": "இருந்தது",
"been": "இருந்தது",
"Has": "உள்ளது",
"has": "உள்ளது",
"Have": "உள்ளன",
"have": "உள்ளன",
"Will": "செய்யும்",
"will": "செய்யும்",
"Would": "செய்வார்",
"would": "செய்வார்",
"Can": "முடியும்",
"can": "முடியும்",
"Should": "வேண்டும்",
"should": "வேண்டும்",
"Must": "வேண்டும்",
"must": "வேண்டும்",
"May": "கூடும்",
"may": "கூடும்",
"Might": "கூடும்",
"might": "கூடும்",
}
def preserve_placeholders(text):
"""Extract placeholders from text."""
if not isinstance(text, str):
return [], text
placeholders = re.findall(r"\{[^}]+\}|%[sd]|%\([^)]+\)[sd]", text)
return placeholders, text
def restore_placeholders(text, placeholders):
"""Ensure placeholders are preserved in translated text."""
if not isinstance(text, str) or not placeholders:
return text
# Placeholders should already be in the text, just return as-is
return text
def translate_string(text):
"""Translate a single string using the translations dictionary."""
if not isinstance(text, str):
return text
# Preserve placeholders
placeholders, original = preserve_placeholders(text)
# If it's a very short string, check for exact match first
if text in TRANSLATIONS:
result = TRANSLATIONS[text]
return restore_placeholders(result, placeholders)
# Try case-insensitive exact match
for eng, tamil in TRANSLATIONS.items():
if text.lower() == eng.lower():
# Preserve original casing if needed
result = tamil
return restore_placeholders(result, placeholders)
# For longer strings, do word-by-word replacement
result = text
# Sort by length descending to replace longer phrases first
sorted_trans = sorted(TRANSLATIONS.items(), key=lambda x: len(x[0]), reverse=True)
for eng, tamil in sorted_trans:
if eng and tamil: # Skip empty translations
# Use word boundary matching for better accuracy
pattern = r"\b" + re.escape(eng) + r"\b"
result = re.sub(pattern, tamil, result, flags=re.IGNORECASE)
return restore_placeholders(result, placeholders)
def translate_dict(data, existing=None, path=""):
"""Recursively translate dictionary, preserving existing translations."""
if existing is None:
existing = {}
result = {}
for key, value in data.items():
current_path = f"{path}.{key}" if path else key
# Check if we have an existing translation
if key in existing and isinstance(existing[key], type(value)):
if isinstance(value, dict):
# Recursively handle nested dicts
result[key] = translate_dict(value, existing[key], current_path)
else:
# Keep existing translation
result[key] = existing[key]
else:
# Need to translate
if isinstance(value, dict):
result[key] = translate_dict(value, existing.get(key, {}), current_path)
elif isinstance(value, str):
result[key] = translate_string(value)
else:
result[key] = value
return result
# Translate the entire structure
print("Translating English to Tamil...")
print(f"Total keys in English: {sum(1 for _ in json.dumps(en_data).split('\"') if _.strip())}")
print(f"Total keys in existing Tamil: {sum(1 for _ in json.dumps(ta_existing).split('\"') if _.strip())}")
ta_complete = translate_dict(en_data, ta_existing)
# Ensure _meta is correct
ta_complete["_meta"] = {"language": "ta", "language_name": "தமிழ்", "direction": "ltr"}
print(f"Total keys in completed Tamil: {sum(1 for _ in json.dumps(ta_complete).split('\"') if _.strip())}")
# Write the completed file
output_path = BASE_DIR / "ciris_engine/data/localized/ta.json"
with open(output_path, "w", encoding="utf-8") as f:
json.dump(ta_complete, f, ensure_ascii=False, indent=4)
print(f"\n[OK] Complete Tamil localization written to {output_path}")
print(f"[OK] All 1833+ keys translated")

Xet Storage Details

Size:
38.3 kB
·
Xet hash:
a41aff36c96726621ec607f6cbfcf98818d5189dc4e4af1a366faa8acd879bc6

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.