{"id":19703473,"url":"https://github.com/crowdin/flutter-sdk","last_synced_at":"2025-04-29T14:30:44.503Z","repository":{"id":151200829,"uuid":"583058346","full_name":"crowdin/flutter-sdk","owner":"crowdin","description":"Crowdin Flutter SDK for instant translation delivery Over-The-Air directly to your application","archived":false,"fork":false,"pushed_at":"2025-02-25T11:51:36.000Z","size":268,"stargazers_count":29,"open_issues_count":4,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-20T13:07:59.006Z","etag":null,"topics":["android","content-delivery","flutter","hacktoberfest","internationalization","ios","localization","mobile"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/crowdin_sdk","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/crowdin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-12-28T16:31:24.000Z","updated_at":"2025-03-24T08:53:57.000Z","dependencies_parsed_at":"2023-06-27T17:02:00.192Z","dependency_job_id":"9856e5c8-4da7-46c0-b3a1-0292b6a9dc22","html_url":"https://github.com/crowdin/flutter-sdk","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fflutter-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fflutter-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fflutter-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crowdin%2Fflutter-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crowdin","download_url":"https://codeload.github.com/crowdin/flutter-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251518779,"owners_count":21602208,"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":["android","content-delivery","flutter","hacktoberfest","internationalization","ios","localization","mobile"],"created_at":"2024-11-11T21:17:58.905Z","updated_at":"2025-04-29T14:30:44.489Z","avatar_url":"https://github.com/crowdin.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cWhite.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n    \u003cimg width=\"150\" height=\"150\" src=\"https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n# Crowdin Flutter SDK [\u003cimg src=\"https://img.shields.io/badge/beta-yellow\"/\u003e](https://github.com/crowdin/flutter-sdk)\n\nThe Crowdin Flutter SDK delivers all new translations from Crowdin project to the application immediately. So there is no need to update the application via Store to get the new version with the localization.\n\n\u003cdiv align=\"center\"\u003e\n\n[**`Example project`**](https://github.com/crowdin/flutter-sdk/tree/main/example) \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Docs`**](https://support.crowdin.com/content-delivery)  \u0026nbsp;|\u0026nbsp;\n[**`Crowdin Enterprise Docs`**](https://support.crowdin.com/enterprise/content-delivery/)\n\n[![Pub Version](https://img.shields.io/pub/v/crowdin_sdk?cacheSeconds=9000)](https://pub.dev/packages/crowdin_sdk)\n[![Pub Likes](https://img.shields.io/pub/likes/crowdin_sdk)](https://pub.dev/packages/crowdin_sdk)\n[![Pub Points](https://img.shields.io/pub/points/crowdin_sdk?cacheSeconds=1000)](https://pub.dev/packages/crowdin_sdk)\n[![Build](https://github.com/crowdin/flutter-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/crowdin/flutter-sdk/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/crowdin/flutter-sdk/branch/main/graph/badge.svg?token=NDQW4BO0EK)](https://codecov.io/gh/crowdin/flutter-sdk)\n[![GitHub contributors](https://img.shields.io/github/contributors/crowdin/flutter-sdk?cacheSeconds=9000)](https://github.com/crowdin/flutter-sdk/graphs/contributors)\n[![GitHub](https://img.shields.io/github/license/crowdin/flutter-sdk?cacheSeconds=20000)](https://github.com/crowdin/flutter-sdk/blob/master/LICENSE)\n\n\u003c/div\u003e\n\n## Features\n\n- Load remote strings from Crowdin Over-The-Air Content Delivery Network\n  - Built-in translations caching mechanism (enabled by default, can be disabled)\n  - Network usage configuration (All, only Wi-Fi or Cellular)\n  - Load static strings from the bundled ARB files (usable as a fallback for the CDN strings)\n- Real-Time Preview – all the translations that are done in the Editor can be shown in your version of the application in real-time. View the translations already made and the ones you're currently typing in.\n\n## Requirements\n\n* Dart \u003e=2.17.0\n\n## Setup\n\nTo configure Flutter SDK integration you need to:\n\n- Upload your *.arb* localization files to Crowdin. If you have ready translations, you can also upload them. Alternatively, you can use the [Flutter .ARB String Exporter](https://store.crowdin.com/arb-export) to export Flutter `.arb` from your Crowdin project strings.\n- Set up Distribution in Crowdin.\n- Set up SDK and enable Over-The-Air Content Delivery feature in your project.\n\n**Distribution** is a CDN vault that mirrors the translated content of your project and is required for integration with the Flutter app.\n\nTo manage distributions, open the Crowdin project and go to the *Translations* \u003e *Over-The-Air Content Delivery* section. You can create as many distributions as you need and select different files for each. You'll need to click the *Release* button next to the distribution each time you want to send new translations to the app.\n\n**To integrate SDK with your application you need to follow the step-by-step instructions:**\n\n- First of all, your Flutter project should be internationalized using the `flutter_localizations` package. For more detail, see [Setting up an internationalized app](https://docs.flutter.dev/development/accessibility-and-localization/internationalization#setting-up).\n- Create a project in [Crowdin](https://crowdin.com/).\n- Upload your `app_en.arb` file to the created Crowdin project. Optionally, you can also [Upload Existing Translations](https://support.crowdin.com/uploading-translations/).\n- [Set up a Distribution](https://support.crowdin.com/content-delivery/#distribution-setup).\n- Add the `crowdin_sdk` dependency to your project:\n\n  ```yml\n  dependencies:\n    crowdin_sdk: ^0.7.0\n\n    flutter_localizations:\n      sdk: flutter\n    intl: any\n\n  flutter:\n    generate: true\n  ```\n\n- Run the following command to generate Crowdin localization:\n\n  ```consloe\n  flutter pub run crowdin_sdk:gen\n  ```\n\n  As a result, the `Crowdin_localizations.dart` will be created in the `{FLUTTER_PROJECT}/.dart_tool/flutter_gen/gen_l10n` directory.\n\n- Update localizationsDelegates in your project:\n\n  ```dart\n  import 'package:flutter_gen/gen_l10n/app_localizations.dart';\n  import 'package:crowdin_sdk/crowdin_sdk.dart';\n  import 'package:flutter_gen/gen_l10n/crowdin_localizations.dart';\n  ```\n\n  ```dart\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      // ...\n\n      localizationsDelegates: CrowdinLocalization.localizationsDelegates,\n      supportedLocales: AppLocalizations.supportedLocales,\n      ),\n\n      // ...\n    );\n  }\n  ```\n\n- Initialize Crowdin SDK in the `main` function of your application:\n\n   ```dart\n   void main() async {\n     WidgetsFlutterBinding.ensureInitialized();\n\n     await Crowdin.init(\n       distributionHash: 'distribution_hash', // Fill in with your distribution hash\n       connectionType: InternetConnectionType.any,\n       updatesInterval: const Duration(minutes: 15),\n     );\n\n     // ...\n   }\n   ```\n\n- Use the `Crowdin.loadTranslations` function to load translations from Crowdin for the specified locale:\n\n  ```dart\n  await Crowdin.loadTranslations(Locale('en'));\n  ```\n\nAfter receiving the translations, change the app locale as usual and the translations from Crowdin will be applied.\n\n## Configuration\n\n| Config option      | Description                                                                                                                                                                                           |\n|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `distributionHash` | Crowdin Distribution Hash                                                                                                                                                                             |\n| `connectionType`   | Network type to be used for translations download. Supported values are `any`, `wifi`, `mobileData`, `ethernet`                                                                                       |\n| `updatesInterval`  | Translations update interval. Translations will not be updated more frequently than the designated time interval (default minimum is 15 minutes). Instead, it will use previously cached translations |\n\n## Real-Time Preview\n\nAll translations done in the Crowdin Editor can be displayed in your version of the application in real-time. See the translations that have already been done and the ones you're typing.\n\n\u003e **Note:** Real-Time Preview feature should not be used in production builds.\n\u003e Currently, this feature is available only for Android and iOS applications.\n\n### Setup\n\nAdd the following code to the Crowdin initialization:\n\n ```dart\n void main() async {\n   WidgetsFlutterBinding.ensureInitialized();\n\n   await Crowdin.init(\n     distributionHash: 'distribution_hash',\n     connectionType: InternetConnectionType.any,\n     updatesInterval: const Duration(minutes: 15),\n     withRealTimeUpdates: true, // use this parameter for enable/disable real-time preview functionality\n     authConfigurations: CrowdinAuthConfig(\n      clientId: 'clientId', // your clientId from Crowdin OAuth app\n      clientSecret: 'clientSecret', // your client secret from Crowdin OAuth app\n      redirectUri: 'redirectUri', // your redirect uri from Crowdin OAuth app\n      organizationName: 'organizationName' // optional (only for Crowdin Enterprise)\n     ),\n   );\n\n   // ...\n }\n ```\n\nWrap your app root widget with the `CrowdinRealTimePreviewWidget`:\n\n```dart\n@override\nWidget build(BuildContext context) {\n  return CrowdinRealTimePreviewWidget(\n    child: MaterialApp(\n      // ...\n\n      localizationsDelegates: CrowdinLocalization.localizationsDelegates,\n      supportedLocales: AppLocalizations.supportedLocales,\n      ),\n\n      // ...\n    );\n  }\n}\n```\n\nFor [OAuth App](https://support.crowdin.com/creating-oauth-app/) the redirect URL should match your app scheme.\nFor example, for scheme `\u003cdata android:scheme=\"crowdintest\" /\u003e`, redirect URL in Crowdin should be `crowdintest://`.\nSpecify `project.translation` scope for the OAuth app on Crowdin.\n\nFor Android app, declare the following intent filter in `android/app/src/main/AndroidManifest.xml`:\n\n  ```xml\n  \u003cmanifest ...\u003e\n  \u003c!-- ... other tags --\u003e\n  \u003capplication ...\u003e\n    \u003cactivity ...\u003e\n      \u003c!-- ... other tags --\u003e\n\n      \u003cintent-filter android:autoVerify=\"true\"\u003e\n        \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n        \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n        \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n        \u003c!-- Accepts URIs that begin with https://YOUR_HOST --\u003e\n        \u003cdata android:scheme=\"[YOUR_SCHEME]\"/\u003e\n      \u003c/intent-filter\u003e\n      \n    \u003c/activity\u003e\n  \u003c/application\u003e\n\u003c/manifest\u003e\n  ```\n\nFor iOS app, declare the scheme in `ios/Runner/Info.plist`:\n\n```xml\n\u003c?xml ...\u003e\n\u003c!-- ... other tags --\u003e\n\u003cplist\u003e\n  \u003cdict\u003e\n    \u003c!-- ... other tags --\u003e\n\n    \u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n    \u003carray\u003e\n      \u003cdict\u003e\n        \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n        \u003carray\u003e\n          \u003cstring\u003e[YOUR_SCHEME]\u003c/string\u003e\n        \u003c/array\u003e\n      \u003c/dict\u003e\n    \u003c/array\u003e\n\n    \u003c!-- ... other tags --\u003e\n  \u003c/dict\u003e\n\u003c/plist\u003e\n```\n\n### Config options\n\n| Config option         | Description                                                                |\n|-----------------------|----------------------------------------------------------------------------|\n| `withRealTimeUpdates` | Enable Real-Time Preview feature                                           |\n| `authConfigurations`  | `CrowdinAuthConfig` class that contains parameters for OAuth authorization |\n| `clientId`            | Crowdin OAuth Client ID                                                    |\n| `clientSecret`        | Crowdin OAuth Client Secret                                                |\n| `redirectUri`         | Crowdin OAuth redirect URL                                                 |\n| `organizationName`    | An Organization domain name (for Crowdin Enterprise users only)            |\n\nFor more information about OAuth authorization in Crowdin, please check [this article](https://support.crowdin.com/creating-oauth-app/).\n\n\u003e **Note:** To easily run your app in the Crowdin Editor, you can use [Crowdin Appetize integration](https://store.crowdin.com/appetize-app). It allows your translators to run this app in the Editor, see more context, and provide better translations.\n\n## Notes\n\n- The CDN feature does not update the localization files. if you want to add new translations to the localization files you need to do it yourself.\n- Once SDK receives the translations, it's stored on the device as application files for further sessions to minimize requests the next time the app starts. Storage time can be configured.\n- CDN caches all the translations in release and even when new translations are released in Crowdin, CDN may return them with a delay.\n- Since some languages have different language codes maintained by the intl package and by Crowdin (for example, intl uses \"es\" for the Spanish language, and Crowdin uses \"es-ES\"). For the following intl language codes Crowdin SDK uses equivalent language codes:\n\n  - Armenian - `hy`: `hy-AM`\n  - Chinese Simplified - `zh`: `zh-CN`\n  - Gujarati - `gu`: `gu-IN`\n  - Nepali - `ne`: `ne-NP`\n  - Portuguese - `pt`: `pt-PT`\n  - Punjabi - `pa`: `pa-IN`\n  - Sinhala - `si`: `si-LK`\n  - Spanish - `es`: `es-ES`\n  - Swedish - `sv`: `sv-SE`\n  - Urdu (India) - `ur`: `ur-IN`\n\n## Contributing\n\nIf you would like to contribute, please read the [Contributing Guidelines](https://github.com/crowdin/flutter-sdk/blob/main/CONTRIBUTING.md).\n\n## Seeking Assistance\n\nIf you find any problems or would like to suggest a feature, please feel free to submit an issue on GitHub at the [Issues Page](https://github.com/crowdin/flutter-sdk/issues).\n\n## Security\n\nCrowdin Flutter SDK CDN feature is built with security in mind, which means minimal access possible from the end-user is required.\nWhen you decide to use Crowdin Flutter SDK, please make sure you’ve made the following information accessible to your end-users.\n\n- We use the advantages of Amazon Web Services (AWS) for our computing infrastructure. AWS has ISO 27001 certification and has completed multiple SSAE 16 audits. All the translations are stored at AWS servers.\n- When you use Crowdin Flutter SDK CDN – translations are uploaded to Amazon CloudFront to be delivered to the app and speed up the download. Keep in mind that your users download translations without any additional authentication.\n- We use encryption to keep your data private while in transit.\n- We do not store any Personally Identifiable Information (PII) about the end-user, but you can decide to develop the opt-out option inside your application to make sure your users have full control.\n\n## License\n\u003cpre\u003e\nThe Crowdin Flutter SDK is licensed under the MIT License.\nSee the LICENSE file distributed with this work for additional \ninformation regarding copyright ownership.\n\nExcept as contained in the LICENSE file, the name(s) of the above copyright \nholders shall not be used in advertising or otherwise to promote the sale, \nuse or other dealings in this Software without prior written authorization.\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fflutter-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdin%2Fflutter-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdin%2Fflutter-sdk/lists"}