{"id":17586973,"url":"https://github.com/abdelrahmanghanem/smart_localize","last_synced_at":"2025-04-30T10:44:27.369Z","repository":{"id":257821082,"uuid":"868988239","full_name":"abdelrahmanghanem/smart_localize","owner":"abdelrahmanghanem","description":"SmartLocalize is a Flutter localization package that efficiently handles translations by dynamically loading language resources based on the app's locale, with robust fallback support.","archived":false,"fork":false,"pushed_at":"2024-11-07T13:41:15.000Z","size":452,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-07T14:26:13.388Z","etag":null,"topics":["dart","flutter","localization"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/smart_localize","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/abdelrahmanghanem.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":"2024-10-07T14:26:04.000Z","updated_at":"2024-11-07T13:41:18.000Z","dependencies_parsed_at":"2024-10-10T23:41:35.909Z","dependency_job_id":"38ac82d0-0f2e-4c90-9952-c89cbe7de52f","html_url":"https://github.com/abdelrahmanghanem/smart_localize","commit_stats":null,"previous_names":["abdelrahmanghanem/main_app_strings","abdelrahmanghanem/smart_localize"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanghanem%2Fsmart_localize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanghanem%2Fsmart_localize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanghanem%2Fsmart_localize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdelrahmanghanem%2Fsmart_localize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdelrahmanghanem","download_url":"https://codeload.github.com/abdelrahmanghanem/smart_localize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225030776,"owners_count":17409946,"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":["dart","flutter","localization"],"created_at":"2024-10-22T03:30:03.048Z","updated_at":"2024-11-17T11:27:24.906Z","avatar_url":"https://github.com/abdelrahmanghanem.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Localize Package\n\nSmartLocalize is a Flutter localization package that efficiently handles translations by dynamically loading language resources based on the app's locale, with robust fallback support.\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/abdelrahmanghanem/smart_localize?style=social\" alt=\"Repo stars\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize/commits/main\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/abdelrahmanghanem/smart_localize/main?logo=git\" alt=\"Last Commit\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr/abdelrahmanghanem/smart_localize\" alt=\"Repo PRs\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize/issues?q=is%3Aissue+is%3Aopen\"\u003e\u003cimg src=\"https://img.shields.io/github/issues/abdelrahmanghanem/smart_localize\" alt=\"Repo issues\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize/blob/main/LICENSE\"\u003e\u003cimg src=\"https://badgen.net/github/license/abdelrahmanghanem/smart_localize\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- **Easy setup** with Flutter's localization system.\n- **Dynamic locale support** with the ability to load multiple languages.\n- **Fallback translations** for robust error handling.\n- **Singleton design pattern** for efficient resource management.\n- **Customizable translation keys** and error logging for development debugging.\n\n## Installation\n\n1. Add the following to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  smart_localize: \u003clatest_version\u003e\n```\n\n\n## Usage\n\n### Example\n\n```dart\n  Text(\n    SmartLocalize.company,\n    style: const TextStyle(fontSize: 14),\n  )\n```\n\n### Basic Usage\n\nHere is an example of how to use the `SmartLocalize` widget in your Flutter application:\n\n```dart\nclass MyApp extends StatelessWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      debugShowCheckedModeBanner: false,\n      supportedLocales: const [\n        Locale('en'),\n        Locale('ar'),\n      ],\n      locale: const Locale('ar'),\n      localeResolutionCallback: (locale, supportedLocales) =\u003e\n      supportedLocales.contains(locale) ? locale : const Locale('ar'),\n      localizationsDelegates: context.smartLocalizeDelegates,\n      title: 'Flutter Demo',\n      theme: ThemeData(\n        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),\n        useMaterial3: true,\n      ),\n      home: const MyHomePage(),\n    );\n  }\n}\n\nclass MyHomePage extends StatelessWidget {\n  const MyHomePage({super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        backgroundColor: Theme.of(context).colorScheme.inversePrimary,\n        title: Text(SmartLocalize.home),\n      ),\n      body: Center(\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: [\n            Text(\n              SmartLocalize.company,\n              style: const TextStyle(fontSize: 14),\n            ),\n            Text(\n              SmartLocalizeValidation.passwordLowercase,\n              style: const TextStyle(fontSize: 14),\n            ),\n            Text(\n              SmartLocalizeConfirmation.addToCart,\n              style: const TextStyle(fontSize: 14),\n            ),\n            Text(\n              SmartLocalizePlaceholder.enterEmail,\n              style: const TextStyle(fontSize: 14),\n            ),\n          ],\n        ),\n      ),\n    );\n  }\n}\n```\n\n## Localization\n\nTo enable validation message localization in the Factory Constructors, add `LocalizeDelegate.delegate` to your app's list of delegates:\n\n```dart\n  MaterialApp(\n    localizationsDelegates: context.smartLocalizeDelegates,\n    // other app configurations...\n  )\n```\n## Contributions\nFeel free to contribute to this project.\n\nIf you find a bug or want a feature, but don't know how to fix/implement it, please fill an [issue](https://github.com/abdelrahmanghanem/smart_localize/issues).  \nIf you fixed a bug or implemented a feature, please send a [pull request](https://github.com/abdelrahmanghanem/smart_localize/pulls).\n\n\u003ca href=\"https://github.com/abdelrahmanghanem/smart_localize/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=abdelrahmanghanem/smart_localize\"  alt=\"\"/\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahmanghanem%2Fsmart_localize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdelrahmanghanem%2Fsmart_localize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdelrahmanghanem%2Fsmart_localize/lists"}