{"id":21260715,"url":"https://github.com/erf/csv_localizations","last_synced_at":"2026-03-04T07:05:33.730Z","repository":{"id":49374615,"uuid":"262886746","full_name":"erf/csv_localizations","owner":"erf","description":"CSV localization for Flutter","archived":false,"fork":false,"pushed_at":"2025-07-07T21:49:22.000Z","size":275,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-02T18:05:00.452Z","etag":null,"topics":["csv","dart","flutter","flutter-localization","flutter-localizations","localization","translation"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/csv_localizations","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/erf.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":"2020-05-10T22:27:28.000Z","updated_at":"2025-07-07T21:49:26.000Z","dependencies_parsed_at":"2025-07-11T03:43:34.548Z","dependency_job_id":"4e1ac78e-7676-49d0-b421-11c1b1df13f1","html_url":"https://github.com/erf/csv_localizations","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/erf/csv_localizations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fcsv_localizations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fcsv_localizations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fcsv_localizations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fcsv_localizations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erf","download_url":"https://codeload.github.com/erf/csv_localizations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fcsv_localizations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["csv","dart","flutter","flutter-localization","flutter-localizations","localization","translation"],"created_at":"2024-11-21T04:20:18.549Z","updated_at":"2026-03-04T07:05:33.716Z","avatar_url":"https://github.com/erf.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv_localizations\n\nA minimal [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) localization package for Flutter.\n\nStore translations for multiple languages in a single CSV file.\n\nOne language per column - one translation per row.\n\n## Install\n\nAdd `csc_localizations` and `flutter_localizations` to your `pubspec.yaml`.\n\n```yaml\ndependencies:\n  flutter_localizations:\n    sdk: flutter\n  csv_localizations: \u003clast-version\u003e\n```\n\nAdd a single CSV file asset to your `pubspec.yaml`.\n\n```yaml\nflutter:\n  assets:\n    - assets/translations.csv\n```\n\nAdd `CsvLocalizationsDelegate` and supported locales to `MaterialApp`.\n\n```Dart\nMaterialApp(\n  localizationsDelegates: [\n    // delegate from flutter_localization\n    ...GlobalMaterialLocalizations.delegates,\n    // delegate from csv_localizations\n    CsvLocalizationsDelegate(path: 'assets/translations.csv'),\n  ],\n  supportedLocales: [\n    Locale('en'),\n    Locale('nb'),\n  ],\n}\n```\n\n### Note on **iOS**\n\nAdd supported locales to `ios/Runner/Info.plist` as described [here](https://flutter.dev/docs/development/accessibility-and-localization/internationalization#specifying-supportedlocales)\n\nExample:\n\n```\n\u003ckey\u003eCFBundleLocalizations\u003c/key\u003e\n\u003carray\u003e\n\t\u003cstring\u003een\u003c/string\u003e\n\t\u003cstring\u003enb\u003c/string\u003e\n\u003c/array\u003e\n```\n\n## Format\n\nA [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) file is a simple table-as-a-text-file with comma separated values as columns and new lines as rows.\n\nIn our case columns represents translations for a specific language and rows represent translations for a given key.\n\nFirst row are supported language/country codes. First column are keys for localized values.\n\nExample table:\n\n| key | en  | nb   |\n| --- | --- | ---- |\n| Hi  | Hi  | Hei  |\n| Dog | Dog | Hund |\n| Cat | Cat | Cat  |\n\n\u003e Tip (1) wrap multiline strings in quotation marks\n\nExample CSV:\n\n```csv\nkey,en,nb\nHi,Hi,Hei\nDog,Dog,Hund\nCat,Cat,Katt\nmy_img,assets/en.png,assets/nb.png\n```\n\n\u003e Tip (2) keys can point to local assets like images\n\n## API\n\nTranslate text using:\n\n```Dart\nCsvLocalizations.instance.string('Hi')\n```\n\nOr add a `String` extension:\n\n```Dart\nextension LocalizedString on String {\n  String tr(BuildContext context) =\u003e CsvLocalizations.instance.string(this);\n}\n```\n\n\u003e We don't want to pollute the String API by default\n\nNow you could easily translate strings like this:\n\n```Dart\n'Hi'.tr(context)\n```\n\n\u003e Note if a value does not exists for a given key, we return the key itself\n\nWe also support `num`, `int` and `double` via:\n\n```Dart\nCsvLocalizations.instance.numValue('my_num')\n\nCsvLocalizations.instance.intValue('my_int')\n\nCsvLocalizations.instance.doubleValue('my_double')\n```\n\n## Configurations\n\nWe support all the configurations from the `csv` package.\n\nYou can set it via `CsvLocalizationsConfigurations` when creating the `CsvLocalizationsDelegate`.\n\nHere are the default configurations:\n\n```Dart\n  const CsvLocalizationsConfigurations({\n    this.fieldDelimiter = ',',\n    this.textDelimiter = '\"',\n    this.textEndDelimiter = '\"',\n    this.eol = '\\n',\n    this.convertEmptyTo = '',\n    this.allowInvalid = true,\n    this.shouldParseNumbers = true,\n  });\n```\n\n## Example\n\nSee [example](example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferf%2Fcsv_localizations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferf%2Fcsv_localizations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferf%2Fcsv_localizations/lists"}