{"id":32301035,"url":"https://github.com/litlifesoftware/lit_localization_service","last_synced_at":"2026-02-21T07:39:51.468Z","repository":{"id":56834045,"uuid":"350814856","full_name":"litlifesoftware/lit_localization_service","owner":"litlifesoftware","description":"A Flutter package to create localizations using JSON files.","archived":false,"fork":false,"pushed_at":"2021-03-30T14:15:39.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-23T05:41:25.576Z","etag":null,"topics":["android","dart","flutter","flutter-package","ios","json","localization"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litlifesoftware.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}},"created_at":"2021-03-23T18:22:03.000Z","updated_at":"2024-03-23T13:43:04.000Z","dependencies_parsed_at":"2022-09-08T07:41:58.162Z","dependency_job_id":null,"html_url":"https://github.com/litlifesoftware/lit_localization_service","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/litlifesoftware/lit_localization_service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litlifesoftware%2Flit_localization_service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litlifesoftware%2Flit_localization_service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litlifesoftware%2Flit_localization_service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litlifesoftware%2Flit_localization_service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litlifesoftware","download_url":"https://codeload.github.com/litlifesoftware/lit_localization_service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litlifesoftware%2Flit_localization_service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["android","dart","flutter","flutter-package","ios","json","localization"],"created_at":"2025-10-23T05:34:20.305Z","updated_at":"2026-02-21T07:39:51.462Z","avatar_url":"https://github.com/litlifesoftware.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lit Localization Service\n\nA Flutter package to create localizations using JSON files.\n\n## Screenshots\n\n| English Localization                                                                          | German Localization                                                                          |\n| --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |\n| !['Hello Word' in English Localization](assets/img/Lit_Localization_Service_Screenshot_1.jpg) | !['Hello Word' in German Localization](assets/img/Lit_Localization_Service_Screenshot_2.jpg) |\n\n## How it works\n\nThe JSON file is fetched on the localization delegate. Its content will then be extracted into a local `Map` and made accessible using the `BuildContext`. The localized strings can then be read by calling `LitLocalizations.of(context).getLocalizedValue(\"your_key_you_specified_on_the_json_file\")` on the `build` method.\n\nReading essential values like texts from local storage will require a status check of the current fetch process on startup. This will increase the loading time of your application. It's used best when already depending on a persistent storage solution where loading processes on startup are required anyway.\n\n## How to use\n\n### Setup\n\n- Provide a JSON file containing all localized strings in a predefined structure (Vide infra).\n- Include the JSON file asset on your `pubspec.yaml` file of your app.\n```yaml\nassets:\n  - assets/json/\n```\n\n- Include `lit_localization_service` as git dependency on your `pubspec.yaml` file of your app:\n```yaml\nlit_localization_service:\n  git: https://github.com/litlifesoftware/lit_localization_service.git\n```\n\nor as a pub dependency:\n```yaml\nlit_localization_service:\n```\n\n\n- Set the `localizationsDelegates` property value of your `MaterialApp` by initializing the `LitLocalizationServiceDelegate`. Provide your JSON file's location.\n\n```dart\n  localizationsDelegates: [\n    // The LitLocalizationServiceDelegate will be passed here.\n    LitLocalizationServiceDelegate(\n      // Set your asset url\n      jsonAssetURL: 'assets/json/localized_strings.json',\n      // Set all language code whose localization are available on the json file\n      supportedLanguages: ['en', 'de'],\n      // State whether to output logs.\n      debug: true,\n    ),\n    GlobalMaterialLocalizations.delegate,\n    GlobalWidgetsLocalizations.delegate,\n    GlobalCupertinoLocalizations.delegate,\n  ],\n```\n\n- Create a `FutureBuilder` to call the `initLocalizations` method in order to montitor the parsing state and conditionally returning either your screen containing your localized strings or a fallback/loading screen\n\n```dart\nclass ParsingStateBuilder extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return FutureBuilder(\n      future: LitLocalizationController()\n          .initLocalizations('assets/json/localized_strings.json'),\n      builder: (context, localizatonsInitalization) {\n        return localizatonsInitalization.connectionState ==\n                ConnectionState.waiting\n            ? LoadingScreen()\n            : MyHomeScreen();\n      },\n    );\n  }\n}\n```\n\n- Call your localized strings by accessing the `BuildContext` once the parsing has been finished.\n\n```dart\n  Text(LitLocalizations.of(context).getLocalizedValue(\"hello\")),\n```\n\n- This should display the string 'Hello' extracted from your JSON file as a Flutter `Text` widget.\n\n### JSON file structure\n\nThe JSON file should contain a list of objects, whose keys can be arbitrary. Each of these objects will in turn have a list of key-value pairs, representing the language and the localized string `\"languageCode\": \"Localized String\"`.\n\n```json\n{\n  \"hello\": {\n    \"en\": \"Hello\",\n    \"de\": \"Hallo\"\n  },\n  \"world\": {\n    \"en\": \"World\",\n    \"de\": \"Welt\"\n  }\n}\n```\n\n## Getting Started with Flutter\n\nFor help getting started with Flutter, view our\n[online documentation](https://flutter.dev/docs), which offers tutorials,\nsamples, guidance on mobile development, and a full API reference.\n\n## Example\n\nThe `example` folder contains an example app demonstrating the most basic implementation using a local JSON asset file.\n\n## License\n\nThe source code of this repository is distributed under the\n**BSD 3-Clause** license as specified in the `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitlifesoftware%2Flit_localization_service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitlifesoftware%2Flit_localization_service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitlifesoftware%2Flit_localization_service/lists"}