{"id":18331133,"url":"https://github.com/soapwong703/i18n-gs","last_synced_at":"2026-04-28T08:03:20.226Z","repository":{"id":62075089,"uuid":"506303697","full_name":"soapwong703/i18n-gs","owner":"soapwong703","description":"Google Sheets upload and download i18n json file.","archived":false,"fork":false,"pushed_at":"2024-03-18T10:55:39.000Z","size":311,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-24T06:11:59.819Z","etag":null,"topics":["command-line-tool","download","google-sheet","google-spreadsheet","i18n","nodejs","upload"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/soapwong703.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-06-22T15:26:28.000Z","updated_at":"2022-10-24T10:35:18.000Z","dependencies_parsed_at":"2024-11-05T19:54:32.430Z","dependency_job_id":null,"html_url":"https://github.com/soapwong703/i18n-gs","commit_stats":{"total_commits":52,"total_committers":3,"mean_commits":"17.333333333333332","dds":0.3653846153846154,"last_synced_commit":"aa5af1f28a290007b9c04ff307721904f38acbdd"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/soapwong703/i18n-gs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soapwong703%2Fi18n-gs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soapwong703%2Fi18n-gs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soapwong703%2Fi18n-gs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soapwong703%2Fi18n-gs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soapwong703","download_url":"https://codeload.github.com/soapwong703/i18n-gs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soapwong703%2Fi18n-gs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32371673,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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":["command-line-tool","download","google-sheet","google-spreadsheet","i18n","nodejs","upload"],"created_at":"2024-11-05T19:28:22.081Z","updated_at":"2026-04-28T08:03:20.080Z","avatar_url":"https://github.com/soapwong703.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i18n-gs\n\nThis tool is to support Google Sheets upload and download i18n json file.\n\n# Installation\n\nAs a dependency in a package\n\n```console\nnpm install i18n-gs --save-dev\n# or\nyarn add i18n-gs --dev\n```\n\nGlobally with `npm`\n\n```console\nnpm install i18n-gs -g\n```\n\n# Usage\n\nOn-demand:\n\nYou can use `npx` to run it without installation\n\n```console\nnpx i18n-gs\n```\n\nInstalled as a dependency:\n\n```console\nnpx i18n-gs\n# or\nyarn i18n-gs\n```\n\nInstalled globally:\n\n```console\ni18n-gs\n```\n\n# Commands\n\n## Init\n\nInitialize the project with config file\n\n```console\ni18n-gs init\n```\n\n## Upload\n\nUpload the files to google sheet (only support flat key style)\n\n```console\ni18n-gs upload [namespaces...]\n\nOptions:\n  -l, --locales \u003clocales...\u003e  locales to be included\n```\n\n- Example:\n\n```console\ni18n-gs upload\ni18n-gs upload common\ni18n-gs upload common --locales en\n```\n\n## Download\n\nDownload the files from google sheet\n\n```console\ni18n-gs download [namespaces...]\n\nOptions:\n  -l, --locales \u003clocales...\u003e  locales to be included\n```\n\n- Example:\n\n```console\ni18n-gs download\ni18n-gs download common\ni18n-gs download common --locales en\n```\n\n# Authentication\n\n### Service Account:\n\nSetup a service account and share sheet's editor permission to the service account\n\n1. Go to [Google Cloud Console](https://console.cloud.google.com/)\n2. Select or create a project\n3. Search for \"Google Sheets API\" and enable it\n4. Search for \"Service Accounts\"\n5. Click \"+ Create Service Account\" and follow the steps to create service account\n6. Save the generated JSON credential file to local (or your project root folder)\n7. Update the configuration file\n8. Go to the Google Spreadsheet you plan to use\n9. Share Editor permission to the service account in your Google Spreadsheet\n\n\n# Spreadsheet Format\n\nThe first row must contain the following header keys\n1. Column A must be named 'key'\n2. The following columns must be named by language code\n\nYou can check the template [here](https://docs.google.com/spreadsheets/d/14R6cbF5pQ6db0Y0ZZNPoH8MeE_fjM81EXjYGqkwS4W0/edit?usp=sharing)\n\n# Configuration\n\nCreate a file `i18n-gs.config.js` in the project root\n\n### Example\n\n```javascript\nmodule.exports = {\n  spreadsheet: {\n    sheetId: \"\u003cyour sheet id\u003e\",\n    credential: {\n      type: \"serviceAccount\",\n      path: \"\u003cyour credential file path\u003e\",\n    },\n  },\n  i18n: {\n    path: \"\u003cyour locale directory path\u003e\",\n    keyStyle: \"nested\",\n    locales: {\n      includes: [\"en\"],\n      excludes: [],\n    },\n    namespaces: {\n      includes: [\"common\"],\n      excludes: [],\n    },\n  },\n  logging: {\n    level: \"info\",\n  },\n};\n```\n\n## `i18n-gs.config.js` fields\n\n## spreadsheet.sheetId\n\nSpecifies the id of your google sheet\n\n- Type: `string`\n- Example:\n\n```javascript\nmodule.exports = {\n  spreadsheet: {\n    sheetId: \"\u003cyour sheet id\u003e\",\n  },\n};\n```\n\n## spreadsheet.credential.type\n\nSpecifies the method to connect google sheet (Only support service account for now)\n\n- Type: `'serviceAccount'`\n- Example:\n\n```javascript\nmodule.exports = {\n  spreadsheet: {\n    credential: {\n      type: \"serviceAccount\",\n    },\n  },\n};\n```\n\n## spreadsheet.credential.path\n\nSpecifies the path to your credential file (Applicable to service account)\n\n- Type: `string`\n- Example:\n\n```javascript\nmodule.exports = {\n  spreadsheet: {\n    credential: {\n      path: \"\u003cyour credential file path\u003e\",\n    },\n  },\n};\n```\n\n## i18n.path\n\nSpecifies the path to store your locales files\n\n- Type: `string`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    path: \"\u003cyour locale directory path\u003e\",\n  },\n};\n```\n\n## i18n.keyStyle\n\nStyle of the i18n key on local file\n\n- Type: `'nested' | 'flat'`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    keyStyle: \"nested\",\n  },\n};\n```\n\nThe key style is as follows:\n\n```javascript\n{\n  // nested:\n  blog: {\n    section: {\n      title: \"My first blog\";\n    }\n  },\n  // flat:\n  blog.section.title: \"My first blog\"\n}\n```\n\n## i18n.locales.includes\n\nSpecifies the locales to include when upload / download\n\n**Note:** If the provided array is empty, nothing will be included when performing action\n\n- Type: `string[]`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    locales: {\n      includes: [\"en\", \"ja\"],\n    },\n  },\n};\n```\n\n## i18n.locales.excludes\n\nSpecifies the locales to exclude when upload / download\n\n- Type: `string[]`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    locales: {\n      excludes: [\"de\", \"fr\"],\n    },\n  },\n};\n```\n\n## i18n.namespaces.includes\n\nSpecifies the namespaces to include when upload / download\n\n**Note:** If the provided array is empty, nothing will be included when performing action\n\n- Type: `string[]`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    namespaces: {\n      includes: [\"common\", \"glossary\"],\n    },\n  },\n};\n```\n\n## i18n.namespaces.excludes\n\nSpecifies the namespaces to exclude when upload / download\n\n- Type: `string[]`\n- Example:\n\n```javascript\nmodule.exports = {\n  i18n: {\n    namespaces: {\n      excludes: [\"local\", \"debug\"],\n    },\n  },\n};\n```\n\n## logging.level\n\nSpecifies the log level\n\n- Type: `'silent' | 'error' | 'warn' | 'info' | 'debug'`\n- Example:\n\n```javascript\nmodule.exports = {\n  logging: {\n    level: \"info\",\n  },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoapwong703%2Fi18n-gs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoapwong703%2Fi18n-gs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoapwong703%2Fi18n-gs/lists"}