| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- #!/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()
|