{"id":31551353,"url":"https://github.com/betomorrow/sync-wording-dart","last_synced_at":"2025-10-04T18:42:00.716Z","repository":{"id":252056197,"uuid":"835679695","full_name":"BeTomorrow/sync-wording-dart","owner":"BeTomorrow","description":"Tool to sync app wording from Google Sheet for Futter projects","archived":false,"fork":false,"pushed_at":"2025-07-30T12:07:13.000Z","size":218,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-30T12:53:38.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/BeTomorrow.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,"zenodo":null}},"created_at":"2024-07-30T10:16:19.000Z","updated_at":"2025-07-30T10:58:58.000Z","dependencies_parsed_at":"2024-08-07T13:17:27.709Z","dependency_job_id":"54fc6286-0b5c-4c15-9cae-0d80e650fa46","html_url":"https://github.com/BeTomorrow/sync-wording-dart","commit_stats":null,"previous_names":["betomorrow/sync-wording-dart"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BeTomorrow/sync-wording-dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fsync-wording-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fsync-wording-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fsync-wording-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fsync-wording-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeTomorrow","download_url":"https://codeload.github.com/BeTomorrow/sync-wording-dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fsync-wording-dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358488,"owners_count":25973946,"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-10-04T02:00:05.491Z","response_time":63,"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":[],"created_at":"2025-10-04T18:41:54.754Z","updated_at":"2025-10-04T18:42:00.690Z","avatar_url":"https://github.com/BeTomorrow.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sync Wording\n\nThis tool allows you to manage your app's wording with a simple Google Sheets file. Just create a sheet with columns for keys and wording. This tool will generate wording files. Your product owner will be able to edit the application's wording themselves.\n\n## Quick Start\n\nYou can find a sample sheet [here](https://docs.google.com/spreadsheets/d/18Zf_XSU80j_I_VOp9Z4ShdOeUydR6Odyty-ExGBZaz4/edit?usp=sharing), but it's just a simple sheet with one column for keys and columns for languages like this:\n\n| Keys           | English   | French |\n| -------------- | --------- | ------ |\n| user.firstname | Firstname | Prénom |\n| user.lastname  | Lastname  | Nom    |\n\n## Installation\n\n- Install sync-wording as a dev dependency: `flutter pub add dev:sync_wording`\n- Create a wording config file named `wording_config.yaml` at the project root location.\n\n```yaml\nsheetId: \"your.sheet.id\"\noutput_dir: \"lib/localizations\"\nlanguages:\n  en:\n    column: 2\n  fr:\n    column: 3\n    # column : 1='A', 2='B', ...\n```\n\n## Running\n\nThis tools accepts 2 modes : download wording from GoogleSheet, or upload local wordings to GoogleSheet.\n\nTo download wordings from a GoogleSheet, you can run this command:\n\n```bash\ndart pub run sync_wording\n```\n\nTo upload the local wordings to the GoogleSheet, run this command:\n\n```bash\ndart pub run sync_wording --upload\n```\n\nYou will be asked to grant access to Google Sheets:\n\n```bash\n\u003e Task :app:downloadWording\nPlease open the following address in your browser:\n  https://accounts.google.com/o/oauth2/v2/auth?access_type=offline\u0026scope=...\n```\n\n- Open the URL in your browser\n- Grant access\n\n[Authorization Sample]\n\nDownloading the wordings will update the wording files: `${output_dir}/intl_en.arb` and `${output_dir}/intl_fr.arb` (in this example)\n\nUploading the wordings will update the GoogleSheet according to these wording files.\n\n## Placeholders\n\nYou can specify placeholders in your translations, with their type and format:\n\n```\nHello {name} =\u003e Creates a default placeholder\nHello {name|String} =\u003e Creates a 'String' placeholder\nIt is {now|DateTime|hh:mm:ss} =\u003e Creates a 'DateTime' placeholder that will be formatted like '14:09:15'\n```\n\n(separator is `|`)\n\nThis also works with plurals, for example:\n\n```\n{days, plural, zero{today} one{tomorrow} other{in {days|int} days}}\n```\n\n## Configuration options\n\n### Sheet names\n\nIf your Google Sheets document contains many sheets, all sheets will be considered as valid input sheets.\nIf you only want to use a subset of these sheets, you can specify the sheet names needed as input:\n\n```yaml\nsheetNames: [\"Commons\", \"MyApp\"]\n```\n\n### Key column\n\nBy default, the column containing the translation keys is the first column (column 'A'), but you can specify another key column if your Google Sheets document has a different format.\n\n```yaml\nkey_column: 2 # default : 1\n```\n\n### Starting row for values\n\nBy default, the first row is considered as a header, and valid keys and translations start at the second row.\nIf your Google Sheets document is not in this format, you can specify the row from which translations will be taken into account:\n\n```yaml\nsheet_start_index: 3 # default : 2\n```\n\n### Wording validation\n\nIn your Google Sheets, you can add a column to indicate that it's a valid translation:\n\n| Keys                 | English   | French | Validation |\n| -------------------- | --------- | ------ | ---------- |\n| user.firstname_title | Firstname | Prénom | OK         |\n| user.lastname_title  | Lastname  | Nom    | NOT OK     |\n\nThen add this to your configuration file:\n\n```yaml\nvalidation:\n  column: 5\n  expected: \"OK\"\n```\n\nIf no `validation` is specified, everything is considered as valid.\n\n### Fallback translations\n\nWhen a translation is missing in one language, you can configure the tool to automatically use the translation from a default language as fallback. This is useful to ensure all languages have complete translations.\n\n```yaml\nfallback:\n  enabled: true\n  default_language: \"en\"\n  # When a translation is missing in a language, use the translation from default_language\n```\n\nIf `fallback` is not specified, no fallback behavior is applied and missing translations will be reported as warnings.\n\n## Localization classes generation\n\nExecuting this program will generate the `.arb` localization files.\nBut it can go further:\nIf your Flutter project is configured to use localizations, with a proper `l10n.yaml` file, this program can automatically generate the localization Dart classes by running the `flutter gen-l10n` command itself, or even `fvm flutter gen-l10n` if you chose fvm as the Flutter version manager for your project.\nYou can simply add this to your `wording_config.yaml` file:\n\n```yaml\ngen_l10n:\n  auto_call: true\n  with_fvm: true\n```\n\n## Use your own Google Application\n\nBy default, the tool uses a pre-configured Google Application. If you want to use your own Google Application:\n\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/)\n2. Create a new project or select an existing one\n3. Enable the Google Sheets API for your project\n4. Go to \"Credentials\" and create a new OAuth 2.0 Client ID\n5. Configure the OAuth consent screen if not already done\n6. Download the client credentials or copy the client ID and client secret\n\nThen add these credentials to your `wording_config.yaml`:\n\n```yaml\ncredentials:\n  client_id: \"your-client-id\"\n  client_secret: \"your-client-secret\"\n  credentials_file: \".google_access_token.json\" # Optional: defaults to .google_access_token.json\n```\n\nThe `credentials_file` is where the OAuth tokens will be stored. Make sure to add this file to your `.gitignore` to keep your tokens secure.\n\n## Options\n\nThis tool supports 2 options:\n\n- **`--config`** : Configuration file path (Optional: defaults to `./wording_config.yaml`)\n- **`--help`** : Display help info\n- **`--upload`** : Run the upload wording process\n\n## Configuration examples\n\nMinimal configuration of a `wording_config.yaml` file:\n\n```yaml\nsheetId: \"your.sheet.id\"\noutput_dir: \"lib/localizations\"\nlanguages:\n  en:\n    column: 2\n  fr:\n    column: 3\n```\n\nComplete configuration of a `wording_config.yaml` file:\n\n```yaml\nsheetId: \"your.sheet.id\"\noutput_dir: \"lib/localizations\"\nsheetNames: [\"Commons\", \"MyApp\"] # (Optional)\nsheet_start_index: 2 # (Optional) defaults to 2\n\n# column values : 1='A', 2='B', ...\nkey_column: 1 # (Optional) defaults to 1\nlanguages:\n  en:\n    column: 2\n  fr:\n    column: 3\nvalidation: # (Optional)\n  column: 4\n  expected: \"OK\"\n\nfallback: # (Optional)\n  enabled: true\n  default_language: \"en\"\n\ncredentials: # (Optional)\n  client_id: \"your-client-id\"\n  client_secret: \"your-client-secret\"\n  credentials_file: \".google_access_token.json\" # (Optional: defaults to .google_access_token.json)\n\ngen_l10n: # (Optional)\n  auto_call: true\n  with_fvm: true # (Optional)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetomorrow%2Fsync-wording-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetomorrow%2Fsync-wording-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetomorrow%2Fsync-wording-dart/lists"}