{"id":16883973,"url":"https://github.com/HoangNguyen0403/sheet_loader_localization","last_synced_at":"2025-11-21T13:30:16.245Z","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":"2024-05-16T11:42:35.000Z","size":232,"stargazers_count":8,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T09:03:10.039Z","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":"2024-12-13T08:55:31.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":1,"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":239493676,"owners_count":19647995,"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-10-13T16:16:00.138Z","updated_at":"2025-11-21T13:30:16.159Z","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 CSV file and generates the localization keys from an online Google Sheet to working\nwith [easy_localization](https://pub.dev/packages/easy_localization)\nand [easy_localization_loader](https://pub.dev/packages/easy_localization_loader)\n\nThis tool inspired\nby [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: \u003clast_version\u003e\n  easy_localization_loader: \u003clast_version\u003e\n\ndev_dependencies:\n  build_runner: \u003clast_version\u003e\n  sheet_loader_localization: \u003clast_version\u003e\n```\n\n### 🔌 Usage\n\n#### 1. Create a CSV Google Sheet\n\nCreate a sheet with your translations (following the bellow\nformat, [an example sheet is available here](https://docs.google.com/spreadsheets/d/1v2Y3e0Uvn0JTwHvsduNT70u7Fy9TG43DIcZYJxPu1ZA/edit?usp=sharing)) :\n\n![csv example file](https://github.com/Hoang-Nguyenn/sheet_loader_localization/raw/main/csv_example.png)\n\nMake sure that your sheet is shared :\n\n![share](https://github.com/Hoang-Nguyenn/sheet_loader_localization/raw/main/share.png)\n\nExtract from the link the `DOCID`\nvalue : `https://docs.google.com/spreadsheets/d/\u003cDOCID\u003e/edit?usp=sharing`) :\n\n#### 2. Declare a localization delegate\n\nDeclare the following `_LocaleKeys` class with the `SheetLocalization` annotation pointing to your\nsheet in a `lib/utils/multi-languages/locale_keys.dart` file :\n\n```dart\nimport 'dart:ui';\n\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  // the `1` is the generated version.\n  //You must increment it each time you want to regenerate a new version of the labels.\n  outDir: 'resources/langs',\n  //default directory save downloaded CSV file\n  outName: 'langs.csv',\n  //default CSV file name\n  preservedKeywords: [],)\nclass _LocaleKeys {}\n```\n\n#### 3. Generate your localizations\n\nRun the following command to generate a `lib/utils/multi-languages/locale_keys.dart` file :\n\n```\nflutter pub run build_runner build\n\nor \n\nflutter pub run build_runner build --delete-conflicting-outputs\n```\n\nSample\nof [locale_keys.g.dart](https://github.com/Hoang-Nguyenn/sheet_loader_localization/blob/main/example/lib/utils/multi-languages/locale_keys.g.dart)\n\n#### 4. Configure your app\n\nLast, config step by step following this tutorial\nfrom [README.md of easy_localization ](https://github.com/aissat/easy_localization/blob/develop/README.md)\n\n### ⚡ Regeneration\n\nBecause of the caching system of the build_runner, it can't detect if there is a change on the\ndistant sheet and it can't know if a new generation is needed.\n\nThe `version` parameter of the `@SheetLocalization` annotation solves this issue.\n\nEach time you want to trigger a new generation, simply increment that version number and call the\nbuild runner again.\n\n### Why❓️\n\nI find the [easy_localization](https://pub.dev/packages/easy_localization) has\nalready [Code generation](https://github.com/aissat/easy_localization/blob/develop/README.md#-code-generation)\n, but it doesn't support working with Google Sheet and generate keys from CSV file and some library don't support flutter 2.0 null-safety. So, I update this simple generator tool.\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"}