{"id":15008626,"url":"https://github.com/hoangnguyen0403/sheet_loader_localization","last_synced_at":"2026-02-12T08:09:51.932Z","repository":{"id":37930506,"uuid":"404948772","full_name":"HoangNguyen0403/sheet_loader_localization","owner":"HoangNguyen0403","description":"Library helper for localization from csv sheet","archived":false,"fork":false,"pushed_at":"2025-02-27T08:07:37.000Z","size":235,"stargazers_count":8,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T16:07:19.183Z","etag":null,"topics":["dart","flutter","i18n","localization","mobile"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HoangNguyen0403.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":"2021-09-10T03:49:43.000Z","updated_at":"2025-02-27T07:57:18.000Z","dependencies_parsed_at":"2024-05-16T12:44:33.752Z","dependency_job_id":"49d7039d-663f-417d-b352-50f23f043129","html_url":"https://github.com/HoangNguyen0403/sheet_loader_localization","commit_stats":{"total_commits":23,"total_committers":8,"mean_commits":2.875,"dds":0.6956521739130435,"last_synced_commit":"35a4ac2669fc76ed7ef7b7ce4501c3ebb418cbe4"},"previous_names":["hoang-nguyenn/sheet_loader_localization"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoangNguyen0403%2Fsheet_loader_localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoangNguyen0403%2Fsheet_loader_localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoangNguyen0403%2Fsheet_loader_localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoangNguyen0403%2Fsheet_loader_localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoangNguyen0403","download_url":"https://codeload.github.com/HoangNguyen0403/sheet_loader_localization/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065287,"owners_count":21041871,"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":["dart","flutter","i18n","localization","mobile"],"created_at":"2024-09-24T19:19:45.634Z","updated_at":"2026-02-12T08:09:51.916Z","avatar_url":"https://github.com/HoangNguyen0403.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sheet_loader_localization\n\n## Sheet Localization Generator\n\nDownload a CSV file and generate localization keys from an online Google Sheet to work\nwith [easy_localization](https://pub.dev/packages/easy_localization)\nand [easy_localization_loader](https://pub.dev/packages/easy_localization_loader).\n\nThis tool is inspired by [flutter_sheet_localization_generator](https://pub.dev/packages/flutter_sheet_localization_generator)\nand the original author [RinLV](https://github.com/rinlv).\n\n### 🔩 Installation\n\nAdd to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  easy_localization: \u003clatest_version\u003e\n  easy_localization_loader: \u003clatest_version\u003e\n\ndev_dependencies:\n  build_runner: \u003clatest_version\u003e\n  sheet_loader_localization: \u003clatest_version\u003e\n```\n\n---\n\n### 🔌 Usage\n\n#### 1. Create a CSV Google Sheet\n\nCreate a sheet with your translations (follow the format below;\n[example sheet here](https://docs.google.com/spreadsheets/d/1v2Y3e0Uvn0JTwHvsduNT70u7Fy9TG43DIcZYJxPu1ZA/edit?usp=sharing)):\n\n![CSV example](https://github.com/Hoang-Nguyenn/sheet_loader_localization/raw/main/csv_example.png)\n\n#### 2. Share the Sheet\n\nThere are two options:\n\n- **If your Google Sheet is _public_**, keep the setup as-is.\n- **If your Google Sheet is _private_**, follow these steps:\n  1. **Enable Google Drive API and Generate an API Key**  \n     Follow this guide: [How to Use Google Drive API and Get an API Key](https://elfsight.com/blog/how-to-use-google-drive-api-and-get-an-api-key/)\n\n  2. **Set the `apiKey` parameter** in the `@SheetLocalization` annotation.\n\n---\n\n#### 3. Declare the Localization Delegate\n\nCreate a Dart file (`lib/utils/multi-languages/locale_keys.dart`) with the following content:\n\n```dart\nimport 'dart:ui';\nimport 'package:sheet_loader_localization/sheet_loader_localization.dart';\n\npart 'locale_keys.g.dart';\n\n@SheetLocalization(\n  docId: 'DOCID',\n  version: 1,\n  outDir: 'resources/langs',\n  outName: 'langs.csv',\n  preservedKeywords: [],\n  // OPTIONAL: Only required if your sheet is private\n  apiKey: 'YOUR_GOOGLE_API_KEY',\n)\nclass _LocaleKeys {}\n```\n\n---\n\n#### 4. Generate the Localizations\n\nRun the command below to generate the localization file:\n\n```bash\nflutter pub run build_runner build\n# or\nflutter pub run build_runner build --delete-conflicting-outputs\n```\n\n---\n\n#### 5. Configure Your App\n\nFollow the setup guide from the [easy_localization README](https://github.com/aissat/easy_localization/blob/develop/README.md).\n\n---\n\n### 🚀 Google Sheets Automation (Recommended)\n\nTo eliminate the manual toil of translating keys, we provide an **Automation Script** that runs directly inside your Google Sheet. This bridges the gap between creating a key and having it ready for the Dart generator.\n\n#### **Why use the automation script?**\n\n- **Instant Multi-Language Support**: Translate an entire sheet into 10+ languages (Vietnamese, French, Japanese, etc.) with one click.\n- **Incremental Updates**: Only translate new keys (\"Fill Missing\"), preserving your existing manual adjustments.\n- **Error Highlighting**: Automatically flags rows that fail to translate in red background for easy debugging.\n- **Zero Configuration**: Automatically detects language codes from your headers (e.g., `vi_VN` → `vi`).\n\n#### **Setup Automation**\n\n1. In your Google Sheet, go to **Extensions** \u003e **Apps Script**.\n2. Copy the code from [localization_script.gs](https://github.com/Hoang-Nguyenn/sheet_loader_localization/blob/main/apps_script/localization_script.gs) and paste it into the editor.\n3. Save the project, Click Run button and refresh your Spreadsheet browser tab.\n4. A new menu **\"🌐 Localization Hub\"** will appear in your toolbar.\n\n![Localization Hub Config](https://github.com/Hoang-Nguyenn/sheet_loader_localization/raw/main/localization_hub_config.png)\n\n---\n\n### 🛡️ Security \u0026 Privacy (For Engineers)\n\nWe prioritize data sovereignty and local execution:\n\n- **Local Execution**: This script runs entirely within **your** Google Workspace environment (Apps Script). No data is ever sent to third-party servers.\n- **No Data Collection**: We do not collect or track your sheet IDs, translation content, or user identity.\n- **Direct API Usage**: The script uses Google's built-in `LanguageApp`, communicating directly between your sheet and the translation service.\n- **Transparent Code**: 100% open-source. We encourage you to audit the code before adding it to your workflow.\n\n---\n\n### ⏱️ Productivity Comparison\n\n| Task                               | Manual Workflow               | With This Tool \u0026 Script             |\n| :--------------------------------- | :---------------------------- | :---------------------------------- |\n| **Adding a new key (5 languages)** | ~10 mins (Manual Copy/Paste)  | **\u003c 10 seconds**                    |\n| **Fixing translation errors**      | Manual search \u0026 fix           | **\"Translate Selected\" (2 clicks)** |\n| **Handling placeholders**          | High risk of breaking `{var}` | **Preserved via script logic**      |\n| **Security Audit**                 | Unknown 3rd party apps        | **100% Transparent Script**         |\n\n---\n\n### 🛠 Troubleshooting\n\n**Ghosting Menus**: If you see duplicate menus (like \"Translation Tools\" and \"Localization Hub\") after updating the script, simply refresh your browser tab. Google Sheets caches UI elements; a reload clears the old definitions.\n\n### ⚡ Regeneration\n\nTo force regeneration of the CSV and localization files (due to caching), simply increment the `version` field in `@SheetLocalization` and rerun the build command.\n\n---\n\n### ❓ Why This Tool?\n\n`easy_localization` supports code generation, but not directly from Google Sheets. This tool simplifies localization workflows by using Google Sheets (ideal for collaboration with non-devs) and supports Flutter null safety.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoangnguyen0403%2Fsheet_loader_localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoangnguyen0403%2Fsheet_loader_localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoangnguyen0403%2Fsheet_loader_localization/lists"}