{"id":24537400,"url":"https://github.com/eonist/babel","last_synced_at":"2026-04-09T12:01:07.784Z","repository":{"id":273155197,"uuid":"918641227","full_name":"eonist/Babel","owner":"eonist","description":"Automatic AI Language localisation","archived":false,"fork":false,"pushed_at":"2025-01-19T03:23:41.000Z","size":59,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T03:25:17.140Z","etag":null,"topics":["aiwrapper","automatic","automation","github-actions","infrastructure","ios","ios-app","l18n","language","macos","openai","saas","slack-webhook","swift","swift-package-manager","translation","xcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eonist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-18T13:28:28.000Z","updated_at":"2025-01-19T03:23:44.000Z","dependencies_parsed_at":"2025-01-19T03:25:23.826Z","dependency_job_id":"81cf5dcf-adcf-4eb7-9ddc-c75d0dd19adf","html_url":"https://github.com/eonist/Babel","commit_stats":null,"previous_names":["eonist/babel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBabel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBabel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBabel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eonist%2FBabel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eonist","download_url":"https://codeload.github.com/eonist/Babel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243811072,"owners_count":20351649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiwrapper","automatic","automation","github-actions","infrastructure","ios","ios-app","l18n","language","macos","openai","saas","slack-webhook","swift","swift-package-manager","translation","xcode"],"created_at":"2025-01-22T14:12:31.386Z","updated_at":"2025-12-31T00:21:10.120Z","avatar_url":"https://github.com/eonist.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) \n[![Platforms](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS-blue.svg)]() \n[![Swift 5.9](https://img.shields.io/badge/Swift-5.9-orange.svg?style=flat)]() \n[![Operational](https://github.com/eonist/Babel/actions/workflows/main.yml/badge.svg)](https://github.com/eonist/Babel/actions/workflows/main.yml)\n\n# Babel\n\n\u003e Automatic AI language localization\n\n\u003cimg width=\"256\" alt=\"img\" src=\"https://i.imgur.com/jIFdqFm.jpeg?raw=true\"\u003e\n\n## Table of Contents\n\n- [Description](#description)\n- [Features](#features)\n- [Problem](#problem)\n- [Solution](#solution)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Obtain OpenAI API Key](#obtain-openai-api-key)\n- [Obtain Slack Webhook](#obtain-slack-webhook)\n- [Add Secrets to Repository Settings](#add-secrets-to-repository-settings)\n- [Alternative Solutions](#alternative-solutions)\n- [Support](#support)\n- [License](#license)\n\n### Description:\n\nBabel automates the translation of your app's strings into multiple languages using OpenAI's GPT models and GitHub Actions. By updating your `Localizable.strings` file and pushing changes to your repository, Babel triggers a workflow that translates the strings, performs unit tests, and notifies you via Slack upon completion. This seamless integration allows your app to automatically include the latest localizations via Swift Package Manager (SPM), streamlining the deployment process.\n\n**1. Trigger the github action flow:**  \n\u003cimg width=\"324\" alt=\"img\" src=\"https://i.imgur.com/vhjjFMK.gif?raw=true\"\u003e\n\n**2. Get notified on Slack:**  \n\u003cimg width=\"472\" alt=\"img\" src=\"https://i.imgur.com/muWodFY.gif?raw=true\"\u003e\n\n**3. Translations go live in your app:**  \n\u003cimg width=\"364\" alt=\"img\" src=\"https://i.imgur.com/RtZ5hsi.gif\"\u003e \u003c!-- was: https://i.imgur.com/cEB5DJU.gif?raw=true --\u003e\n\n\n\n### Features:\n\n- 🔑 **Bring Your Own OpenAI Key**: Use your personal OpenAI API key for secure and controlled access.\n- 🚀 **Automatic Translations on Push**: Trigger translations effortlessly every time you push updates.\n- 💰 **Cost-Efficient Token-Based Pricing**: Pay only for what you use; the first $5 is covered by OpenAI.\n- 🌍 **Supports All Languages**: Translate into any number of languages, from one to hundreds.\n- ✅ **Built-In Unit Tests**: Ensure reliability with comprehensive automated testing.\n- 🔔 **Slack Notifications on Completion**: Receive instant updates on translation status directly in Slack.\n- 📦 **Automatic Inclusion in Your App**: Translations are seamlessly included in your app projects that import the Babel SPM package fork. Auto-deploy to production at your own discretion.\n\n\n### Problem:\n\n- 📝 **Manual Translation is Tedious**: Translating `Localizable.strings` into multiple languages by hand is time-consuming.\n- 🚨 **Prone to Errors**: Manual processes can lead to inefficiencies and mistakes.\n- 👨‍💻 **Developer Dependency**: Updates require developer involvement, limiting non-developers from managing translations.\n\n### Solution:\n\n- 🤖 **Automated AI Translations**: Utilize OpenAI's GPT models to automatically translate strings at scale.\n- 🧪 **Integrated Testing \u0026 Notifications**: Include unit tests and receive Slack alerts upon completion or failure.\n- 💪 **Empower Non-Developers**: With Babel's forked repository, non-developers can edit and commit changes; Babel automates the rest, supporting automatic deployments if set up.\n\n\n### Prerequisites\n\n- **GitHub Account**: Ensure you have a GitHub account to fork repositories and set up actions.\n- **OpenAI Account**: Sign up for an OpenAI account and obtain an API key.\n- **Slack Workspace**: Have access to a Slack workspace where you can add apps and receive notifications.\n- **Xcode 15 or Later**: Required for Swift 5.9 and iOS 17 / macOS 14 development.\n\n## Getting Started\n\nBabel allows you to automate the localization of your iOS or macOS app using AI. Here's how to get up and running:\n\n \n\n### Installation:\n\n1. **Fork the Repository**\n\n   Fork the [Babel repository](https://github.com/eonist/Babel) to your own GitHub user or organization.\n\n2. **Set Up Secrets**\n\n   Obtain your `OPENAI_API_KEY` and `SLACK_WEBHOOK_URL` (see [Obtain OpenAI API Key](#obtain-openai-api-key) and [Obtain Slack Webhook](#obtain-slack-webhook)) and add them as secrets in your repository settings (see [Add Secrets to Repository Settings](#add-secrets-to-repository-settings)).\n\n3. **Add Babel to Your Project**\n\n   Add the Babel Swift Package to your app project by specifying your forked repository URL: `https://github.com/your-user-name/Babel`.\n\n4. **Configure translation instructions**\n\n   Edit the `.github/workflows/main.yml` file to include your desired translation settings:\n\n   ```yaml\n   languages = [\"es\", \"fr\", \"de\"] # Modify as needed: \"Spanish\" (es), \"French\" (fr), \"German\" (de)\n   gpt_model: \"gpt-4\"  # You can also use models like \"gpt-3.5-turbo\" or \"gpt-4-turbo\" to reduce costs\n   general_instruction: \"Please ensure the translations are accurate and contextually appropriate.\" # Instruction for the translation model to ensure quality. You can also provide a brief description of your app to ensure the tonality is accurate.\n   ```\n\n5. **Push changes to trigger the translation workflow**\n\n   Edit the \"key words\" you want to localize in any text editor: `Sources/Babel/Resources/Localizable.strings` push the changes with terminal or github desktop. You can also edit key words directly on github.com and the translations will be triggered on save. \n\n6. **Set Up Automated Releases (Optional)**\n\n   For automatic inclusion of translations via Swift Package Manager (SPM), set up periodic daily releases to app-store in your apps github action workflow.\n\n### Example:\n\n**In your app:**\n```swift\nimport Babel\n\n#Preview {\n   VStack {\n      Text(\"greeting_key\", bundle: .babelModule)  \n         .environment(\\.locale, Locale(identifier: \"es\")) \n      Text(\"hello_world_key\".localized(bundle: localizationBundle(forLanguage: \"de\") ?? .babelModule))\n      Text(\"farewell_key\".localized(langCode: \"fr\"))  \n   }\n}\n```\n\n**Your main `Localizable.strings` file:**\n\n`Sources/Babel/Resources/en.lproj/Localizable.strings`\n\n**With content:**\n\n```README.md\n\"hello_world_key\" = \"Hello, World!\";\n\"greeting_key\" = \"Welcome to our app!\";\n\"farewell_key\" = \"Thank you for using our app!\";\n```\n\nAdd desired languages to the `.github/workflows/main.yml` file:\n```yml\nlanguages = [\"es\", \"fr\", \"de\"] # Modify as needed \"Spanish\", \"French\", \"German\"\n```\n\nAfter running the workflow, the translations will be generated in:\n\n```\nSources/Babel/Resources/es.lproj/Localizable.strings\nSources/Babel/Resources/fr.lproj/Localizable.strings\nSources/Babel/Resources/de.lproj/Localizable.strings\n```\n\n### Obtain OpenAI API Key\n\nFollow these steps to get your `OPENAI_API_KEY`:\n\n1. Visit [platform.openai.com](https://platform.openai.com) and log in or sign up.\n\n2. Click on your profile icon in the top-right corner and select **\"View API keys\"**.\n\n3. Click the **\"Create new secret key\"** button.\n\n4. **Copy and securely store your API key immediately**, as it won't be shown again.\n\n\u003e [!NOTE]\n\u003e Ensure you've added a payment method in your account settings. It's recommended to use separate keys for different applications to enhance security.\n\n### Obtain Slack Webhook \n\nFollow these steps to get your SLACK_WEBHOOK_URL:\n\n1. **Create a Slack App:**\n   - Visit the Slack API website and click \"Create New App\".\n   - Name your app and choose the workspace to use it in.\n\n2. **Enable Incoming Webhooks:**\n   - In the app dashboard, go to \"Incoming Webhooks\".\n   - Toggle the switch to activate Incoming Webhooks.\n\n3. **Add a Webhook:**\n   - Click \"Add New Webhook to Workspace\".\n   - Select the channel for the webhook to post messages.\n   - Authorize the webhook for your workspace.\n\n4. **Copy the Webhook URL:**\n   - After authorization, a unique Webhook URL will be generated.\n   - It will look like: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`\n\n\u003e [!NOTE]\n\u003e - Keep your Webhook URL secret, as it contains sensitive information.\n\u003e - For GovSlack apps, use the `slack-gov.com` domain instead of `slack.com`.\n\u003e - Customize webhook settings and message formatting as needed.\n\n## Add secrets to repo settings:\n\nTo add the secrets to a GitHub repository, follow these steps:\n\n1. Navigate to your repository on GitHub.\n2. Click on the \"Settings\" tab near the top of the page.\n3. In the left sidebar, under the \"Security\" section, click on \"Secrets and variables,\" then select \"Actions.\"\n4. Click on the \"New repository secret\" button.\n5. Enter a name for your secret in the \"Name\" field.\n6. In the \"Value\" field, enter the secret value you want to store.\n7. Click \"Add secret\" to save your new repository secret. (SLACK_WEBHOOK_URL and OPENAI_API_KEY)\n\n\n\u003e [!IMPORTANT]\n\u003e - Secrets are encrypted and only exposed to selected actions during runtime.\n\u003e - Repository secrets are only accessible to repository collaborators.\n\u003e - Avoid storing sensitive information directly in your repository code or GitHub Actions workflow files.\n\u003e - You can update or remove secrets from the same settings page if needed.\n\n## Alternative solutions: \n\n- [https://crowdin.com](https://crowdin.com) $151 per month (team plan 100k words)\n- [https://phrase.com](https://phrase.com) $135 per month (200k words)\n- [https://lokalise.com/](https://lokalise.com/) $120 per month (5k keys)\n\n\u003e [!NOTE]\n\u003e - Babel is based on token price. (An avarage usecase should cost 0.01$ - 1$ per month)\n\u003e - 5k words to 10 languages: with gpt-4-turbo: $0.267 * 10 = $2.67\n\u003e - 5k words to 10 languages: with gpt-3.5-turbo: $0.015 * 10 = $0.15\n\u003e - Using other models from other providers could decrease cost significantly. (coming soon)\n\u003e - Only translating diff change will reduce running cost to near zero. (coming soon)\n\n## Support\n\nIf you encounter any problems or have questions, feel free to [open an issue](https://github.com/eonist/Babel/issues) on GitHub.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Official GitHub Markdown Badge\n\nA GitHub badge that can be added to your open-source projects 😸\n\n[![Babel-localisation](https://img.shields.io/badge/Babel-localisation-purple)](https://github.com/eonist/babel) \n\n```markdown\n[![Babel-localisation](https://img.shields.io/badge/Babel-localisation-purple)](https://github.com/eonist/babel) \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fbabel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feonist%2Fbabel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feonist%2Fbabel/lists"}