{"id":15172685,"url":"https://github.com/erf/yaml_localizations","last_synced_at":"2026-01-25T21:38:26.310Z","repository":{"id":56842031,"uuid":"264101124","full_name":"erf/yaml_localizations","owner":"erf","description":"YAML localization for Flutter","archived":false,"fork":false,"pushed_at":"2025-07-07T22:42:15.000Z","size":272,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-02T18:05:05.698Z","etag":null,"topics":["dart","flutter","flutter-localization","flutter-localizations","localization","translation","yaml"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/yaml_localizations","language":"C++","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}},"created_at":"2020-05-15T05:08:03.000Z","updated_at":"2025-07-07T22:42:19.000Z","dependencies_parsed_at":"2024-02-14T23:31:55.331Z","dependency_job_id":"c4ea6734-103f-497d-a525-feb72602962c","html_url":"https://github.com/erf/yaml_localizations","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"b93b426629b9b9e3d4983940bcb6182dad5eee5a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/erf/yaml_localizations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fyaml_localizations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fyaml_localizations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fyaml_localizations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fyaml_localizations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erf","download_url":"https://codeload.github.com/erf/yaml_localizations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fyaml_localizations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28759419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T20:56:06.009Z","status":"ssl_error","status_checked_at":"2026-01-25T20:54:48.203Z","response_time":113,"last_error":"SSL_read: 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":["dart","flutter","flutter-localization","flutter-localizations","localization","translation","yaml"],"created_at":"2024-09-27T10:02:59.261Z","updated_at":"2026-01-25T21:38:26.291Z","avatar_url":"https://github.com/erf.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaml_localizations\n\nA minimal [YAML](https://en.wikipedia.org/wiki/YAML) localization package for Flutter.\n\nYAML is a human-readable, configuration file format with a minimal syntax, which allows you to represent [strings](https://yaml-multiline.info/) as key/value pairs in addition to other types. \n\nYAML is the format used by Flutter's `pubspec.yaml` file.\n\n## Install\n\nAdd `yaml_localizations` and `flutter_localizations` as dependencies to your `pubspec.yaml`.\n\n```yaml\ndependencies:\n  flutter_localizations:\n    sdk: flutter\n  yaml_localizations:\n```\n\n### Add a YAML file per language\n\nAdd a YAML file per language you support in an asset `path` and describe it in your `pubspec.yaml`\n\n```yaml\nflutter:\n  assets:\n    - assets/yaml_translations/\n```\n\nThe YAML file name must match the language tag described in `supportedLocales`.\n\nE.g. `Locale('en', 'US')` must have a corresponding `assetPath/en-US.yaml` file.\n\n### Add localizationDelegates and supportedLocales\n\nAdd `YamlLocalizationsDelegate` to `MaterialApp` and set `supportedLocales` using language/country codes.\n\n```\nMaterialApp(\n  localizationsDelegates: [\n    // global delegates\n    ...GlobalMaterialLocalizations.delegates,\n    // yaml localizations\n    YamlLocalizationsDelegate(path: 'assets/yaml_translations'),\n  ],\n  supportedLocales: [\n    Locale('en', 'GB'),\n    Locale('en', 'US'),\n    Locale('en'),\n    Locale('nb'),\n  ],\n}\n\n```\n\n### Note on **iOS**\n\nAdd supported languages to `ios/Runner/Info.plist` as described \n[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-GB\u003c/string\u003e\n\t\u003cstring\u003een\u003c/string\u003e\n\t\u003cstring\u003enb\u003c/string\u003e\n\u003c/array\u003e\n```\n\n\n## YAML format\n\n```yaml\nHi: Hi\nText: |\n  There once was a tall man from Ealing\n  Who got on a bus to Darjeeling\n      It said on the door\n      \"Please don't sit on the floor\"\n  So he carefully sat on the ceiling\nLong: \u003e\n  Wrapped text\n  will be folded\n  into a single\n  paragraph\n\n  Blank lines denote\n  paragraph breaks\n```\n\n\u003e Tip: Yaml supports several ways of expressing strings. Use the vertical bar character to indicate that a string will span several lines. Use the greater-than character to break up long lines.\n\n### API\n\nTranslate strings using\n\n```dart\nYamlLocalizations.of(context)?.string('Hi')\n```\n\nWe keep the API simple, but you can easily add an extension method to `String` like this:\n\n```dart\nextension LocalizedString on String {\n  String tr(BuildContext context) =\u003e YamlLocalizations.of(context)!.string(this);\n}\n```\n\n\nSo you can use it like this:\n\n```dart\n'Hi'.tr(context)\n```\n\n## Example\n\nSee [example](example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferf%2Fyaml_localizations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferf%2Fyaml_localizations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferf%2Fyaml_localizations/lists"}