#!/usr/bin/env python3 import os import re base = os.path.join(os.path.dirname(__file__), "..", "App for Indeed") def set_key(content: str, key: str, value: str) -> str: esc_key = key.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") esc_val = value.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") pattern = re.compile(r'"' + re.escape(esc_key) + r'"\s*=\s*"(?:\\.|[^"\\])*"\s*;') repl = f'"{esc_key}" = "{esc_val}";' if pattern.search(content): return pattern.sub(repl, content, count=1) return content.rstrip() + f'\n"{esc_key}" = "{esc_val}";\n' LOCALE_PATCHES = { "ar": { "App for Indeed": "تطبيق Indeed", "About %@": "حول %@", "Hide %@": "إخفاء %@", "Quit %@": "إنهاء %@", "Preferences…": "التفضيلات…", "Assistant is searching": "المساعد يبحث", "Indeed": "إنديد", "Google": "جوجل", "There was nothing to restore for this Apple ID.": "لا يوجد شيء لاستعادته لمعرّف Apple هذا.", "Check out %@ on the Mac App Store.": "اطّلع على %@ في متجر Mac للتطبيقات.", "Check out %@ on the Mac App Store:\n%@": "اطّلع على %@ في متجر Mac للتطبيقات:\n%@", "match": "تطابق", "matches": "تطابقات", "Website": "موقع الويب", "Impact": "الأثر", "Contact": "التواصل", "Modern": "عصري", "System": "النظام", "Description": "الوصف", "CV": "السيرة الذاتية", }, "de": { "App for Indeed": "App für Indeed", "About %@": "Über %@", "Hide %@": "%@ ausblenden", "Quit %@": "%@ beenden", "Preferences…": "Einstellungen…", "Assistant is searching": "Assistent sucht", "Premium": "Premium-Bereich", "Pro": "Pro-Version", "Loading premium plans from the App Store…": "Lade Premium-Pläne aus dem Mac App Store…", "That subscription isn’t available from the App Store right now.": "Dieses Abonnement ist derzeit nicht im Mac App Store verfügbar.", "This subscription isn't available in your App Store region.": "Dieses Abonnement ist in Ihrer Mac-App-Store-Region nicht verfügbar.", "Check out %@ on the Mac App Store.": "Entdecken Sie %@ im Mac App Store.", "Check out %@ on the Mac App Store:\n%@": "Entdecken Sie %@ im Mac App Store:\n%@", "e.g., Google": "z. B. Google", }, "el": { "App for Indeed": "Εφαρμογή για Indeed", "About %@": "Σχετικά με %@", "Hide %@": "Απόκρυψη %@", "Quit %@": "Έξοδος από %@", "Preferences…": "Προτιμήσεις…", "Assistant is searching": "Ο βοηθός αναζητά", }, "es": { "App for Indeed": "App para Indeed", "About %@": "Acerca de %@", "Hide %@": "Ocultar %@", "Quit %@": "Salir de %@", "Preferences…": "Preferencias…", "Assistant is searching": "El asistente está buscando", "Premium": "Premium", "Pro": "Profesional", "There was nothing to restore for this Apple ID.": "No había nada que restaurar para este ID de Apple.", "Circuit": "Circuito", "Quorum": "Quórum", "Regent": "Regente", "Description": "Descripción", "Principal": "Principal", "Modern": "Moderno", "System": "Sistema", }, "es-MX": { "App for Indeed": "App para Indeed", "About %@": "Acerca de %@", "Hide %@": "Ocultar %@", "Quit %@": "Salir de %@", "Preferences…": "Preferencias…", "Assistant is searching": "El asistente está buscando", "Premium": "Premium", "Pro": "Profesional", "There was nothing to restore for this Apple ID.": "No había nada que restaurar para este ID de Apple.", "Quorum": "Quórum", "Regent": "Regente", "Modern": "Moderno", }, "fi": { "App for Indeed": "Sovellus Indeedille", "About %@": "Tietoja: %@", "Hide %@": "Piilota %@", "Quit %@": "Lopeta %@", "Preferences…": "Asetukset…", "Assistant is searching": "Avustaja hakee", "match": "osuma", "matches": "osumaa", "Website": "Verkkosivusto", "Modern": "Moderni", "/ week": "/ viikko", "Quorum": "Kvoorumi", "Regent": "Regentti", }, "fr": { "App for Indeed": "App pour Indeed", "About %@": "À propos de %@", "Hide %@": "Masquer %@", "Quit %@": "Quitter %@", "Preferences…": "Réglages…", "Assistant is searching": "L’assistant recherche", "Premium": "Abonnement premium", "Pro": "Version Pro", "Upgrade to Pro": "Passer à la version Pro", "You're on Pro": "Vous utilisez la version Pro", "Try Pro": "Essayer la version Pro", "Checking your Pro subscription…": "Vérification de votre abonnement Pro…", "Circuit": "Circuit", "Conduit": "Conduit", "Modern": "Moderne", "System": "Système", }, "fr-CA": { "App for Indeed": "App pour Indeed", "About %@": "À propos de %@", "Hide %@": "Masquer %@", "Quit %@": "Quitter %@", "Preferences…": "Préférences…", "Assistant is searching": "L’assistant recherche", "Premium": "Abonnement premium", "Pro": "Version Pro", "Upgrade to Pro": "Passer à la version Pro", "You're on Pro": "Vous utilisez la version Pro", "Try Pro": "Essayer la version Pro", "Modern": "Moderne", }, "he": { "App for Indeed": "אפליקציה עבור Indeed", "About %@": "אודות %@", "Hide %@": "הסתר %@", "Quit %@": "צא מ-%@", "Preferences…": "העדפות…", "Assistant is searching": "העוזר מחפש", "Indeed": "אינדיד", "Google": "גוגל", "There was nothing to restore for this Apple ID.": "לא היה מה לשחזר עבור מזהה Apple זה.", "Website": "אתר אינטרנט", "Modern": "מודרני", }, "it": { "App for Indeed": "App per Indeed", "About %@": "Informazioni su %@", "Hide %@": "Nascondi %@", "Quit %@": "Esci da %@", "Preferences…": "Preferenze…", "Assistant is searching": "L'assistente sta cercando", "Premium": "Premium", "There was nothing to restore for this Apple ID.": "Non c'era nulla da ripristinare per questo ID Apple.", "Atlas": "Atlante", "Regent": "Reggente", "Modern": "Moderno", "Website": "Sito web", "Impact": "Impatto", "Contact": "Contatti", "match": "corrispondenza", "matches": "corrispondenze", "/ week": "/ settimana", }, "ko": { "App for Indeed": "Indeed용 앱", "About %@": "%@ 정보", "Hide %@": "%@ 숨기기", "Quit %@": "%@ 종료", "Preferences…": "환경설정…", "Assistant is searching": "어시스턴트가 검색 중", "Google": "구글", "e.g., Google": "예: 구글", "There was nothing to restore for this Apple ID.": "이 Apple 계정에 복원할 구독이 없습니다.", }, "nb": { "App for Indeed": "App for Indeed", "About %@": "Om %@", "Hide %@": "Skjul %@", "Quit %@": "Avslutt %@", "Preferences…": "Innstillinger…", "Assistant is searching": "Assistenten søker", "Premium": "Premium", "Website": "Nettsted", "Modern": "Moderne", "match": "treff", "matches": "treff", "/ week": "/ uke", "Quorum": "Korum", }, "nl": { "App for Indeed": "App voor Indeed", "About %@": "Over %@", "Hide %@": "Verberg %@", "Quit %@": "Sluit %@ af", "Preferences…": "Voorkeuren…", "Assistant is searching": "Assistent zoekt", "match": "overeenkomst", "matches": "overeenkomsten", "Website": "Webpagina", "Impact": "Prestaties", "Contact": "Contactgegevens", "e.g., Google": "bijv. Google", }, "pl": { "App for Indeed": "Aplikacja dla Indeed", "About %@": "Informacje o %@", "Hide %@": "Ukryj %@", "Quit %@": "Zakończ %@", "Preferences…": "Ustawienia…", "Assistant is searching": "Asystent wyszukuje", "Premium": "Premium", "There was nothing to restore for this Apple ID.": "Nie było nic do przywrócenia dla tego konta Apple.", "Quorum": "Kworum", "Website": "Witryna", "Modern": "Nowoczesny", "match": "dopasowanie", "matches": "dopasowania", "/ week": "/ tydzień", }, "pt-BR": { "App for Indeed": "App para Indeed", "About %@": "Sobre %@", "Hide %@": "Ocultar %@", "Quit %@": "Encerrar %@", "Preferences…": "Preferências…", "Assistant is searching": "O assistente está pesquisando", "Premium": "Premium", "There was nothing to restore for this Apple ID.": "Não havia nada para restaurar para este ID Apple.", "Quorum": "Quórum", "Regent": "Regente", "Website": "Site", "Modern": "Moderno", "match": "correspondência", "matches": "correspondências", "/ week": "/ semana", }, "ru": { "App for Indeed": "Приложение для Indeed", "About %@": "О программе «%@»", "Hide %@": "Скрыть %@", "Quit %@": "Завершить %@", "Preferences…": "Настройки…", "Assistant is searching": "Помощник ищет", "Indeed": "Индид", "Pro": "Про", "There was nothing to restore for this Apple ID.": "Нечего восстанавливать для этой учётной записи Apple.", "Website": "Веб-сайт", "Modern": "Современный", "match": "совпадение", "matches": "совпадения", "/ week": "/ неделя", }, "sv": { "App for Indeed": "App för Indeed", "About %@": "Om %@", "Hide %@": "Dölj %@", "Quit %@": "Avsluta %@", "Preferences…": "Inställningar…", "Assistant is searching": "Assistenten söker", "Premium": "Premium-abonnemang", "Pro": "Pro-version", "Upgrade to Pro": "Uppgradera till Pro-versionen", "You're on Pro": "Du har Pro-versionen", "Try Pro": "Prova Pro-versionen", "Website": "Webbplats", "Modern": "Modern", "match": "träff", "matches": "träffar", "/ week": "/ vecka", "Quorum": "Korum", }, "uk": { "App for Indeed": "Додаток для Indeed", "About %@": "Про %@", "Hide %@": "Сховати %@", "Quit %@": "Завершити %@", "Preferences…": "Налаштування…", "Assistant is searching": "Помічник шукає", "Indeed": "Індід", "Website": "Вебсайт", "Modern": "Сучасний", }, "vi": { "App for Indeed": "Ứng dụng cho Indeed", "About %@": "Giới thiệu về %@", "Hide %@": "Ẩn %@", "Quit %@": "Thoát %@", "Preferences…": "Tùy chọn…", "Assistant is searching": "Trợ lý đang tìm kiếm", "There was nothing to restore for this Apple ID.": "Không có gì để khôi phục cho ID Apple này.", "Website": "Trang web", "Modern": "Hiện đại", "match": "kết quả phù hợp", "matches": "kết quả phù hợp", "/ week": "/ tuần", }, "zh-Hans": { "App for Indeed": "Indeed 应用", "About %@": "关于%@", "Hide %@": "隐藏%@", "Quit %@": "退出%@", "Preferences…": "偏好设置…", "Assistant is searching": "助手正在搜索", "Indeed": "英迪", "Google": "谷歌", "e.g., Google": "例如:谷歌", "There was nothing to restore for this Apple ID.": "此 Apple 账户没有可恢复的内容。", "Check out %@ on the Mac App Store.": "在 Mac App Store 中查看%@。", "Check out %@ on the Mac App Store:\n%@": "在 Mac App Store 中查看%@:\n%@", }, "zh-Hant": { "App for Indeed": "Indeed 應用程式", "About %@": "關於%@", "Hide %@": "隱藏%@", "Quit %@": "結束%@", "Preferences…": "偏好設定…", "Assistant is searching": "助理正在搜尋", "Indeed": "英迪", "Google": "谷歌", "e.g., Google": "例如:谷歌", "There was nothing to restore for this Apple ID.": "此 Apple 帳號沒有可回復的內容。", "Website": "網站", "Modern": "現代", "match": "相符", "matches": "相符", "/ week": "/ 週", }, } def main(): for loc, patches in LOCALE_PATCHES.items(): name = patches["App for Indeed"] info_path = os.path.join(base, f"{loc}.lproj", "InfoPlist.strings") with open(info_path, "w", encoding="utf-8") as f: f.write(f"/* Localized bundle display name ({loc}) */\n") f.write(f'"CFBundleDisplayName" = "{name}";\n') f.write(f'"CFBundleName" = "{name}";\n') path = os.path.join(base, f"{loc}.lproj", "Localizable.strings") with open(path, encoding="utf-8") as f: content = f.read() for key, val in patches.items(): if key == "App for Indeed": continue content = set_key(content, key, val) with open(path, "w", encoding="utf-8") as f: f.write(content) print(f"Patched {loc}: {len(patches)} keys") en_info = os.path.join(base, "en.lproj", "InfoPlist.strings") with open(en_info, "w", encoding="utf-8") as f: f.write("/* Localized bundle display name (English) */\n") f.write('"CFBundleDisplayName" = "App for Indeed";\n') f.write('"CFBundleName" = "App for Indeed";\n') if __name__ == "__main__": main()