You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+119-3Lines changed: 119 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,10 @@ The Crowdin Flutter SDK delivers all new translations from Crowdin project to th
23
23
## Features
24
24
25
25
- Load remote strings from Crowdin Over-The-Air Content Delivery Network
26
-
- Built-in translations caching mechanism (enabled by default, can be disabled)
27
-
- Network usage configuration (All, only Wi-Fi or Cellular)
28
-
- Load static strings from the bundled ARB files (usable as a fallback for the CDN strings)
26
+
- Built-in translations caching mechanism (enabled by default, can be disabled)
27
+
- Network usage configuration (All, only Wi-Fi or Cellular)
28
+
- Load static strings from the bundled ARB files (usable as a fallback for the CDN strings)
29
+
- 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.
29
30
30
31
## Requirements
31
32
@@ -126,6 +127,121 @@ After receiving the translations, change the app locale as usual and the transla
126
127
|`connectionType`| Network type to be used for translations download. Supported values are `any`, `wifi`, `mobileData`, `ethernet`|
127
128
|`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 |
128
129
130
+
## Real-Time Preview
131
+
132
+
All 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.
133
+
134
+
> **Note:** Real-Time Preview feature should not be used in production builds.
135
+
> Currently, this feature is available only for Android and iOS applications.
136
+
137
+
### Setup
138
+
139
+
Add the following code to the Crowdin initialization:
140
+
141
+
```dart
142
+
void main() async {
143
+
WidgetsFlutterBinding.ensureInitialized();
144
+
145
+
await Crowdin.init(
146
+
distributionHash: 'distribution_hash',
147
+
connectionType: InternetConnectionType.any,
148
+
updatesInterval: const Duration(minutes: 15),
149
+
withRealTimeUpdates: true, // use this parameter for enable/disable real-time preview functionality
150
+
authConfigurations: CrowdinAuthConfig(
151
+
clientId: 'clientId', // your clientId from Crowdin OAuth app
152
+
clientSecret: 'clientSecret', // your client secret from Crowdin OAuth app
153
+
redirectUri: 'redirectUri', // your redirect uri from Crowdin OAuth app
154
+
organizationName: 'organizationName' // optional (only for Crowdin Enterprise)
155
+
),
156
+
);
157
+
158
+
// ...
159
+
}
160
+
```
161
+
162
+
Wrap your app root widget with the `CrowdinRealTimePreviewWidget`:
| `authConfigurations` | `CrowdinAuthConfig` class that contains parameters for OAuth authorization |
236
+
| `clientId` | Crowdin OAuth Client ID |
237
+
| `clientSecret` | Crowdin OAuth Client Secret |
238
+
| `redirectUri` | Crowdin OAuth redirect URL |
239
+
| `organizationName` | An Organization domain name (for Crowdin Enterprise users only) |
240
+
241
+
For more information about OAuth authorization in Crowdin, please check [this article](https://support.crowdin.com/creating-oauth-app/).
242
+
243
+
> **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.
244
+
129
245
## Notes
130
246
131
247
- 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.
0 commit comments