{"id":16216735,"url":"https://github.com/skyost/ezlocalization","last_synced_at":"2026-03-14T06:01:02.164Z","repository":{"id":56828608,"uuid":"223482182","full_name":"Skyost/EzLocalization","owner":"Skyost","description":"Localize your flutter application quickly and easily.","archived":false,"fork":false,"pushed_at":"2024-01-01T14:35:25.000Z","size":145,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T17:50:59.551Z","etag":null,"topics":["easy","ez-localization","flutter","localization","plugin","translate"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/ez_localization","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/Skyost.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":"2019-11-22T20:34:50.000Z","updated_at":"2023-07-11T02:28:59.000Z","dependencies_parsed_at":"2024-10-23T03:23:42.611Z","dependency_job_id":null,"html_url":"https://github.com/Skyost/EzLocalization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyost%2FEzLocalization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyost%2FEzLocalization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyost%2FEzLocalization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Skyost%2FEzLocalization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Skyost","download_url":"https://codeload.github.com/Skyost/EzLocalization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982177,"owners_count":20378604,"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":["easy","ez-localization","flutter","localization","plugin","translate"],"created_at":"2024-10-10T11:21:59.070Z","updated_at":"2026-03-14T06:00:57.141Z","avatar_url":"https://github.com/Skyost.png","language":"Dart","funding_links":["https://paypal.me/Skyost"],"categories":[],"sub_categories":[],"readme":"# EzLocalization\n\nThis package allows you to setup a powerful localization system with ease and in only a few minutes.\n\n## Features\n\nHere are some features:\n\n* Easy, lightweight, open-source.\n* MIT licensed.\n* Easily extensible.\n\n## Getting started\n\nIt only takes a few steps in order to get EzLocalization to work !  \nFirst, add the following code to your `MaterialApp` definition (usually in `main.dart`) :\n\n```dart\nEzLocalizationDelegate ezLocalization = EzLocalizationDelegate(supportedLocales: [Locale('en'), Locale('fr')]); // The first language is your default language.\n\nreturn MaterialApp(\n  // ...\n  localizationsDelegates: ezLocalization.localizationDelegates,\n  supportedLocales: ezLocalization.supportedLocales,\n  localeResolutionCallback: ezLocalization.localeResolutionCallback,\n);\n```\n\nThen you create a folder named `languages` in your `assets` directory with the defined languages in it.\nAn example structure could be :\n\n```\nassets\n└── languages\n    ├── en.json\n    └── fr.json\n```\n\nHere's an example of `en.json` :\n\n```json\n{\n  \"hello\": \"Hello !\"\n}\n```\n\nAnd a translated `fr.json` :\n\n```json\n{\n  \"hello\": \"Bonjour !\"\n}\n```\n\nDon't forget to add the assets in your `pubspec.yml` :\n\n```yml\nflutter:\n  # ...\n  assets:\n    - \"assets/languages/\"\n```\n\n**That's it !** To get your string you only have to call `EzLocalization.of(context)!.get('hello')`.\n\n## Advanced\n\n### Extension method\n\nWith the extension method, it's even easier to get a localized string !\nThe only thing you have to do is to replace `EzLocalization.of(context)!.get('key')` by `context.getString('key')`.\n\n_You may have to manually import EzLocalization in your file._\n\n### Builder widget\n\nEzLocalization provides a builder widget called `EzLocalizationBuilder`. You can use it as such :\n\n```dart\nconst EzLocalizationBuilder(\n  delegate: EzLocalizationDelegate(\n    supportedLocales: [\n      Locale('en'),\n      Locale('fr'),\n      Locale('es'),\n    ],\n  ),\n  builder: (context, localizationDelegate) =\u003e MaterialApp(\n    title: 'Beautifully localized app',\n    home: MyMainWidget(),\n    localizationsDelegates: localizationDelegate.localizationDelegates,\n    supportedLocales: localizationDelegate.supportedLocales,\n    localeResolutionCallback: localizationDelegate.localeResolutionCallback,\n  ),\n);\n```\n\nIt has two advantages :\n* It helps reducing boilerplate.\n* You can dynamically change the current locale using `EzLocalizationBuilder.of(context)!.changeLocale(yourLocale)`.\n\n### Nested strings\n\nYou can nest translation strings as such :\n\n```json\n{\n  \"tabs\": {\n    \"home\": \"Home\"\n  }\n}\n```\n\nAnd it can be access using `EzLocalization.of(context)!.get('tabs.home')`.\n\n### Format arguments\n\nIn your translation string, you may add arguments using `{}` :\n\n```json\n{\n  \"greeting\": \"Hello {target}, my name is {me} !\"\n}\n```\n\nYou can then fill them with `EzLocalization.of(context)!.get('greeting', {'target': 'John', 'me': 'Bob'})`.\nAlso, instead of a map you can pass a list and get your arguments by their indexes.\n\n### Change the files path\n\nYou can change from the default path of `assets/languages/$languageCode.json` by passing `getPathFunction`\nto `EzLocalizationDelegate`. You will then have to provide a valid asset path according to the specified locale.\n\nDon't forget to update your `assets` entry in your pubspec !\n\n### Updating the iOS app bundle\n\nSee [the official flutter.dev documentation](https://flutter.dev/docs/development/accessibility-and-localization/internationalization#appendix-updating-the-ios-app-bundle)\nabout updating the iOS app bundle.\n\n## Contributing\n\nYou have a lot of options to contribute to this project ! You can :\n\n* [Fork it](https://github.com/Skyost/EzLocalization/fork) on Github.\n* [Submit](https://github.com/Skyost/EzLocalization/issues/new/choose) a feature request or a bug report.\n* [Donate](https://paypal.me/Skyost) to the developer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyost%2Fezlocalization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyost%2Fezlocalization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyost%2Fezlocalization/lists"}