{"id":23675416,"url":"https://github.com/paulgrammer/i18n-gt","last_synced_at":"2026-05-11T07:42:30.022Z","repository":{"id":163391436,"uuid":"637727651","full_name":"paulgrammer/i18n-gt","owner":"paulgrammer","description":"i18n JSON translator with google translator API","archived":false,"fork":false,"pushed_at":"2023-05-08T19:38:02.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T07:08:02.521Z","etag":null,"topics":["i18n","i18n-js","i18n-react","i18n-tool","i18next","i18next-backend","json","json-schema","nlp","nmt","translation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulgrammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-05-08T09:32:45.000Z","updated_at":"2023-05-08T19:55:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"574fda24-49b5-4761-b694-95bd788d5427","html_url":"https://github.com/paulgrammer/i18n-gt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paulgrammer/i18n-gt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgrammer%2Fi18n-gt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgrammer%2Fi18n-gt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgrammer%2Fi18n-gt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgrammer%2Fi18n-gt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulgrammer","download_url":"https://codeload.github.com/paulgrammer/i18n-gt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulgrammer%2Fi18n-gt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262212780,"owners_count":23275986,"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":["i18n","i18n-js","i18n-react","i18n-tool","i18next","i18next-backend","json","json-schema","nlp","nmt","translation"],"created_at":"2024-12-29T13:59:48.196Z","updated_at":"2026-05-11T07:42:24.979Z","avatar_url":"https://github.com/paulgrammer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Command-Line Program for Translating i18n json using Google Cloud Translation API\n\nThis is a simple command-line program written in Go that uses the Google Cloud Translation API to translate i18n json with text from one language to another. The program takes in a JSON file containing text to be translated, source language, target language and output JSON file path as required command-line arguments.\n\n### Usage\n\nTo use the program, you'll need to have a Google Cloud service account and API key. You can create one by following the instructions in the [Google Cloud documentation](https://cloud.google.com/translate/docs/setup).\n\nOnce you have your credentials, you can run the program using the following command:\n\n```\nexport GOOGLE_APPLICATION_CREDENTIALS=\"KEY_PATH\"\n```\n\n```\ni18n-gt -input \u003cinputfile\u003e -source \u003csource language\u003e -target \u003ctarget language\u003e -output \u003coutputfile\u003e\n```\n\nwhere `\u003cinputfile\u003e` is the path to the input JSON file, `\u003csource language\u003e` is the code for the source language (e.g. \"en\" for English), `\u003ctarget language\u003e` is the code for the target language, `\u003coutputfile\u003e` is the path to the output JSON file\n### Input JSON Format\n\nThe input JSON file should contain an object, with property and value\n\nHere's an example input JSON file:\n\n```JSON\n{\n  \"title\": \"Welcome!\",\n  \"pages\": {\n    \"title\": \"Pages\",\n    \"profile\": {\n      \"title\": \"Profile page\",\n      \"login\": {\n        \"pasword\": \"password\"\n      }\n    }\n  }\n}\n```\n\n### Output JSON Format\n\nThe output JSON file will contain translated object\n\nHere's an example output JSON file:\n\n```JSON\n{\n  \"pages\": {\n    \"profile\": {\n      \"login\": {\n        \"pasword\": \"hasło\"\n      },\n      \"title\": \"Strona profilowa\"\n    },\n    \"title\": \"Strony\"\n  },\n  \"title\": \"Powitanie!\"\n}\n```\n\n### Dependencies\n\nThe program uses the following Go packages:\n\n- `cloud.google.com/go/translate`: The Google Cloud Translation API Go client library\n- `golang.org/x/text/language`: The Go standard library package for language code parsing\n- `google.golang.org/api/option`: The Google Cloud API option library\n\nYou can install these packages using the `go get` command:\n\n```\ngo get cloud.google.com/go/translate\ngo get golang.org/x/text/language\ngo get google.golang.org/api/option\n```\n\nTo build the program for multiple platforms, run the following command:\n\n```sh\nmake build\n```\n\nThis will compile the program and generate a binary file in the `build/` directory.\n\nTo run the program in development mode, run the following command:\n\n```sh\nmake dev\n```\n\nThis will run the program with the `input.json` and `account.json` files provided and generate the `output.json` file.\n\n## Build Targets\n\nThe `Makefile` provides the following build targets:\n\n- `build-linux-amd64`: Build the program for Linux x64\n- `build-linux-arm`: Build the program for Linux ARM\n- `build-darwin-amd64`: Build the program for macOS x64\n- `build-windows-amd64`: Build the program for Windows x64\n- `build`: Build the program for all platforms\n- `clean`: Clean up generated binary files\n\nHere's an example of how to build the program for a specific platform:\n\n```sh\nmake build-linux-amd64\n```\n\nThis will compile the program for Linux x64 and generate a binary file in the `build/` directory.\n\n## TODO\n\n- [ ] Set up GitHub release workflow to automate binary file creation and release management.\n\n\n### License\n\nThis program is licensed under the MIT license. See the [LICENSE](https://opensource.org/licenses/MIT) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgrammer%2Fi18n-gt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulgrammer%2Fi18n-gt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulgrammer%2Fi18n-gt/lists"}