{"id":21260713,"url":"https://github.com/erf/minimal_localizations","last_synced_at":"2026-04-12T22:04:37.324Z","repository":{"id":57677046,"uuid":"489384422","full_name":"erf/minimal_localizations","owner":"erf","description":"Localize your Flutter app given a map of translations per language.","archived":false,"fork":false,"pushed_at":"2024-04-25T08:23:48.000Z","size":224,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T21:53:50.233Z","etag":null,"topics":["flutter","flutter-localization","localization"],"latest_commit_sha":null,"homepage":"","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":"2022-05-06T14:26:17.000Z","updated_at":"2024-04-25T08:23:53.000Z","dependencies_parsed_at":"2024-11-16T03:24:41.276Z","dependency_job_id":"0a142866-8ddf-480b-9a41-02221a5924d6","html_url":"https://github.com/erf/minimal_localizations","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"39478e0cc5a3689e5380b42031cebecf39a2fa6f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erf/minimal_localizations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fminimal_localizations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fminimal_localizations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fminimal_localizations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fminimal_localizations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erf","download_url":"https://codeload.github.com/erf/minimal_localizations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erf%2Fminimal_localizations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978905,"owners_count":23239417,"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":["flutter","flutter-localization","localization"],"created_at":"2024-11-21T04:20:17.630Z","updated_at":"2026-04-12T22:04:37.253Z","avatar_url":"https://github.com/erf.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimal_localizations\n\nLocalize your Flutter app by providing a map of translations per language, along with methods to retrieve values, strings, and supported locales.\n\nBased on the [minimal localization example](https://github.com/flutter/website/tree/main/examples/internationalization/minimal).\n\n## Features\n\n- Ideal for small projects\n- Easy to use without code generation\n- No need for assets, just pure code\n- Fast performance without asset parsing\n- Supports both String and dynamic types\n- Automatically generates supported locales\n- No external dependencies\n\n## Install\n\nAdd `minimal_localizations` and `flutter_localizations` as dependencies to your `pubspec.yaml`.\n\n```yaml\ndependencies:\n  flutter_localizations:\n    sdk: flutter\n  minimal_localizations:\n```\n\n### Add translations per language\n\nDeclare `MinimalLocalizationsDelegate` given a map of translations per language tag.\n\n\u003e Language tags must be valid [Unicode BCP47](https://www.unicode.org/reports/tr35/)\n\n```Dart\nfinal minimalLocalizationsDelegate = MinimalLocalizationsDelegate({\n  'en': {\n    'title': 'Localizations',\n    'hello': 'Hello',\n  },\n  'nb-NO': {\n    'title': 'Lokaliseringer',\n    'hello': 'Hei',\n  },\n});\n```\n\nAdd `localizationDelegates` and set `supportedLocales`.\n\n```Dart\nMaterialApp(\n  localizationsDelegates: [\n    // global delegates\n    ...GlobalMaterialLocalizations.delegates,\n    // minimal localizations delegate\n    minimalLocalizationsDelegate,\n  ],\n  supportedLocales: minimalLocalizationsDelegate.supportedLocales,\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\u003c/string\u003e\n\t\u003cstring\u003enb-NO\u003c/string\u003e\n\u003c/array\u003e\n```\n\n### API\n\nTranslate `dynamic` values using\n\n```Dart\nMinimalLocalizations.of(context).value('some_value')\n```\n\nTranslate `String` values using\n\n```Dart\nMinimalLocalizations.of(context).string('Hi')\n```\n\nWe keep the API minimal, 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 MinimalLocalizations.of(context).string(this);\n}\n```\n\nSo you can translate `String` values 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%2Fminimal_localizations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferf%2Fminimal_localizations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferf%2Fminimal_localizations/lists"}