kaauh_ats/translate_batch_01.py
2025-11-03 13:00:12 +03:00

59 lines
3.2 KiB
Python

#!/usr/bin/env python3
"""
Script to add Arabic translations for batch 01
"""
# Arabic translations for batch 01
translations = {
"": "", # Line 7 - empty string, keep as is
"Website": "الموقع الإلكتروني",
"Admin Notes": "ملاحظات المسؤول",
"Save Assignment": "حفظ التكليف",
"Assignment": "التكليف",
"Expires At": "ينتهي في",
"Access Token": "رمز الوصول",
"Subject": "الموضوع",
"Recipients": "المستلمون",
"Internal staff involved in the recruitment process for this job": "الموظفون الداخليون المشاركون في عملية التوظيف لهذه الوظيفة",
"External Participant": "مشارك خارجي",
"External participants involved in the recruitment process for this job": "المشاركون الخارجيون المشاركون في عملية التوظيف لهذه الوظيفة",
"Reason for canceling the job posting": "سبب إلغاء نشر الوظيفة",
"Name of person who cancelled this job": "اسم الشخص الذي ألغى هذه الوظيفة",
"Hired": "تم التوظيف",
"Author": "المؤلف",
"Endpoint URL for sending candidate data (for outbound sync)": "عنوان URL لنقطة النهاية لإرسال بيانات المرشح (للمزامنة الصادرة)",
"HTTP method for outbound sync requests": "طريقة HTTP لطلبات المزامنة الصادرة",
"HTTP method for connection testing": "طريقة HTTP لاختبار الاتصال",
"Custom Headers": "رؤوس مخصصة",
"JSON object with custom HTTP headers for sync requests": "كائن JSON يحتوي على رؤوس HTTP مخصصة لطلبات المزامنة",
"Supports Outbound Sync": "يدعم المزامنة الصادرة",
"Whether this source supports receiving candidate data from ATS": "ما إذا كان هذا المصدر يدعم استقبال بيانات المرشح من نظام تتبع المتقدمين",
"Expired": "منتهي الصلاحية",
"Maximum candidates agency can submit for this job": "الحد الأقصى للمرشحين الذين يمكن للوكالة تقديمهم لهذه الوظيفة"
}
def update_batch_file():
"""Update the batch file with Arabic translations"""
input_file = "translation_batch_01.txt"
output_file = "translation_batch_01_completed.txt"
with open(input_file, 'r', encoding='utf-8') as f:
content = f.read()
# Replace empty msgstr with translations
for english, arabic in translations.items():
if english: # Skip empty string
# Find the pattern and replace
old_pattern = f'msgid: "{english}"\nmsgstr: ""\n\nArabic Translation: \nmsgstr: ""'
new_pattern = f'msgid: "{english}"\nmsgstr: ""\n\nArabic Translation: \nmsgstr: "{arabic}"'
content = content.replace(old_pattern, new_pattern)
with open(output_file, 'w', encoding='utf-8') as f:
f.write(content)
print(f"Updated batch file saved as: {output_file}")
print("Arabic translations added for batch 01")
if __name__ == "__main__":
update_batch_file()