{"id":21230102,"url":"https://github.com/fgforrest/babylon","last_synced_at":"2025-07-28T19:39:41.237Z","repository":{"id":54914750,"uuid":"328917383","full_name":"FgForrest/Babylon","owner":"FgForrest","description":"Babylon is a tool to gather messages, and their translations from property files. It performs a round-trip consisting of two phases: export phase and import phase. In the export phase the messages are written to a Google Sheets spreadsheet. A translator will then fill in the missing translations. In the import phase, the spreadsheet (with the missing translations filled out by a translator) is examined, and the newly translated messages are used to update the respective translation property files. Also, the state of the translation, snapshot, is written out to a disk in the form of JSON file. Babylon can be run as a Maven plugin or as a standalone console application.","archived":false,"fork":false,"pushed_at":"2025-07-07T10:42:58.000Z","size":680,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-07T10:57:02.915Z","etag":null,"topics":["google-spreadsheet-api","java","localization-tool","maven-plugin","translation-tool"],"latest_commit_sha":null,"homepage":"","language":"Java","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/FgForrest.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,"zenodo":null}},"created_at":"2021-01-12T08:17:33.000Z","updated_at":"2025-07-07T10:43:01.000Z","dependencies_parsed_at":"2025-04-26T23:18:04.938Z","dependency_job_id":"98a3d11b-49ca-40b4-9362-24a1b4de973b","html_url":"https://github.com/FgForrest/Babylon","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/FgForrest/Babylon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FgForrest%2FBabylon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FgForrest%2FBabylon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FgForrest%2FBabylon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FgForrest%2FBabylon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FgForrest","download_url":"https://codeload.github.com/FgForrest/Babylon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FgForrest%2FBabylon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267576451,"owners_count":24110315,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["google-spreadsheet-api","java","localization-tool","maven-plugin","translation-tool"],"created_at":"2024-11-20T23:35:18.709Z","updated_at":"2025-07-28T19:39:41.228Z","avatar_url":"https://github.com/FgForrest.png","language":"Java","readme":"# Babylon\n\n## Tool to automate translation files.\n\n### Description and usage\n\nBabylon is a tool to gather messages, and their translations from translation files. It performs a round-trip consisting of \ntwo phases: *export* phase and *import* phase. \n\nIn the export phase the messages are written to a [Google Sheets](https://www.google.com/sheets/about/) spreadsheet. \nA translator will then fill in the missing translations. \n\nIn the import phase, the spreadsheet (with the missing translations filled out by a translator) is examined, and the \nnewly translated messages are used to update the respective translation files. Also, the state of the translation,\n*snapshot*,  is written out to a disk in the form of JSON file.\n\nBabylon can be run as a Maven plugin or as a standalone console application. \n\nTo run Babylon:\n\n- It must be run in the root directory of the project to perform translation on.\n- A `credentials.json` file with Google Cloud user credentials must exist in the current directory \n  (root directory of the project to translate).\n- Sheets API must be enabled for your Google account.\n- A Json configuration file must exist (see the \"Configuration\" section).\n- A Google Sheets spreadsheet must exist (empty for the export phase).\n\nCurrently only supported file types are **.properties** and **.ts**\n\n### Google Cloud user credentials\n\nYou need a Google Cloud project with Sheets API enabled. Also, you need to download the `credentials.json` client \nsecrets file from the Cloud Console. Alternatively, you can use the Java Quickstart to perform all these actions using a wizard.\n\n#### Using quickstart wizard to obtain the credentials file\n\nUsing [Google Sheets Java Quickstart](https://developers.google.com/sheets/api/quickstart/java), you can create\na new Google Cloud project with Sheets API enabled and download the `credentials.json` client secrets file in a few steps\nwith the help of a wizard. \n\nGo to the link a press the *Enable the Google Sheets API* button.\n\n- Name the new Google Cloud project (e.g. Babylon)\n- Click *Next*\n- Select *Desktop app* from the dropdown menu (it's the default choice)\n- Click *Create*\n- Click *Download client configuration* to obtain the `credentials.json` file\n- Store the file as `credentials.json` in the directory where you will run Babylon from\n  - Do not commit the `credentials.json` as part of the project you use Babylon to translate!\n  - The `credentials.json` file should be kept privately.\n\n#### Obtaining existing credentials file from Google Cloud Console\n\n- Go to Google Cloud Console\n- Select the project that you will use to grant Babylon access to the Sheets API\n  - Be advised that the client secrets file enables access to the Cloud APIs.\n  - It is a good idea to create a new Google Cloud project that does not contain any sensitive data apart from translations.\n- Select *APIs \u0026 Services* from the Console menu\n- Select *Credentials* from the *APIs \u0026 Services* menu\n- Download the file in section *OAuth 2.0 client IDs*\n- Store the file as `credentials.json` in the directory where you will run Babylon from \n  - Do not commit the `credentials.json` as part of the project you use Babylon to translate!\n  - The `credentials.json` file should be kept privately.  \n- [see also the SO answer here](https://stackoverflow.com/questions/58460476/where-to-find-credentials-json-for-google-api-client)   \n\nYou need \"credentials.json\" for accessing google spreadsheet.\nThis file must exists in same folder from where you running Babylon application. This file can be generated for your google account here:\n[ENABLE THE GOOGLE SHEETS API](https://developers.google.com/sheets/api/quickstart/java) When you are logged in\non google account which you want to use, just click to \"ENABLE THE GOOGLE SHEETS API\" button and follow instructions.\n\n#### Giving Babylon access to the Sheets API \n\nWhen you run Babylon for the first time, a *Please open the following address in your browser* message will appear in the terminal\nfollowed by a link. Open the link and login using the Google account used to create `credentials.json` and on the next page click the\n\"Allow\" button. This is a one-time action only and will not need to be repeated next time, unless you delete created \"tokens\" folder.\n\n\n### Configuration\nConfiguration is a JSON file with following structure: \n\n```json\n{\n  \"path\" : [ \n  \"src/test/resources/META-INF/lib_eshop_edee/country.properties\",\n  \"src/test/resources/META-INF/09_mail_form/messages.properties\",\n  \"src/test/resources/META-INF/goPayGate/*.properties\" ],\n  \"dataFileName\" : \"translation-db.json\",\n  \"mutations\" : [ \"en\", \"de\" ],\n  \"lockedCellEditors\": [\"kosar@fg.cz\", \"kamenik@fg.cz\"]\n}\n```\n\nYou can use the * wildcard to specify multiple files/directories on the path.\n\nForward slashes in paths(`/`) are preferred to double backslashes (`\\ \\`) as it works on both Windows and Unix platforms.\n\n### Running Babylon as a Maven plugin\n\nAdd babylon to the `plugins` section of your POM.xml file.\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eone.edee\u003c/groupId\u003e\n    \u003cartifactId\u003ebabylon-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/plugin\u003e\n```\n\nThe two translation phases are run by invoking the respective Maven goals:\n- `mvn babylon:export` for export translations from properties file to google spreadsheet\n- `mvn babylon:import` for import translations from google spreadsheet back to properties files\n\nParameters are:\n\n- `config.file` - path to translator-config.json file.\n- `google.sheet.id` - ID of the Google spreadsheet to write translations when exporting\n  or to load translation from when importing (e.g. 1xhnBAOpy8-9KWhl8NP0ZIy6mhlgXKnKcLJwKcIeyjPc)\n\ne.g.\n\n``` \nmvn babylon:import -Dconfig.file=test-config.json -Dgoogle.sheet.id=1xhnBAOpy8-9KWhl8NP0ZIy6mhlgXKnKcLJwKcIeyjPc\n```\n\n### Running Babylon as a console application\n\nApplication needs the following arguments: 1.action 2.config.json 3.google sheet id (4. optional combineSheets)\n\n1. expected action (export, import)\n* `export` - takes all properties files specified in configuration file and export their properties into specified the Google spreadsheet. Each property \n  bundle (primary properties file and its mutation) is exported into sheet labeled with primary properties file name + # + unique number of file.\n* `import` - takes all translated values from the Google spreadsheet specified in configuration file and import them back into target properties files. \n  Format of the mutation properties files is taken from primary mutation properties file. All properties which isn't present in primary \n  properties file (are present only in concrete mutation properties file) is placed at the end of the target mutation file.\n2. path to translator-config.json file. This file serves as database for translation process.\n3. ID of the Google spreadsheet (e.g. 1xhnBAOpy8-9KWhl8NP0ZIy6mhlgXKnKcLJwKcIeyjPc) \n4. **Optional** boolean value whether export should be placed into only one sheet (only usable for debugging translations)\n\nCommand line examples:\n\n``` shell\njava -jar babylon-1.0-SNAPSHOT.jar export test-config.json 1xhnBAOpy8-9KWhl8NP0ZIy6mhlgXKnKcLJwKcIeyjPc \njava -jar babylon-1.0-SNAPSHOT.jar import test-config.json 1xhnBAOpy8-9KWhl8NP0ZIy6mhlgXKnKcLJwKcIeyjPc\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgforrest%2Fbabylon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgforrest%2Fbabylon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgforrest%2Fbabylon/lists"}