i18n_keyless 3.8.0
i18n_keyless: ^3.8.0 copied to clipboard
Keyless i18n for Flutter. No ARB files, no gen-l10n, no keys. Write T('Bonjour') and ship 48 languages at runtime with AI translations.
Changelog #
3.8.0 #
- The precompiled bundle (
docs/PROTOCOL.mdsections 4.5 and 7.4): ship the translations with the app and keep the API for the misses. Export the files with the MCPexport_bundletool orGET /translate/bundle(manifest.jsonplus one<namespace>/<lang>.json), declare them as assets, and hand the manifest and a loader toinitasbundle: I18nKeylessBundle(manifest:, load:)(loadI18nKeylessBundleFromAssets('assets/i18n-keyless')builds one onrootBundle). A namespace the manifest covers in the current language is seeded from the file instead of fetched, at boot and on every language switch, with the bundle's cursor; storage wins only when newer and in the same language. A miss still POSTs, and the delta fetch after it starts from the seeded cursor. Nothing else changes.bundleCoversandmergeBundleWithStoragereplayconformance/vectors/bundle-seed.json.
3.7.0 #
No change in the port. The version tracks the JavaScript SDKs: 3.7.0 adds plurals, ordinals and
select choices (ICU MessageFormat, docs/PROTOCOL.md section 5.4). The port stores and returns
such a cell verbatim and does not render it yet.
3.6.1 #
No change in the port. The version tracks the JavaScript SDKs: 3.6.1 makes every SDK render the source text
before init() instead of throwing. Protocol reference unchanged.
3.6.0 #
No change in the port. The version tracks the JavaScript SDKs: 3.6.0 adds the function form
of useTranslation() to i18n-keyless-react and makes every SDK render the source text
before init() instead of throwing. Protocol reference unchanged.
3.5.0 #
No change in the port. The version tracks the JavaScript SDKs: 3.5.0 adds
awaitForTranslationOrThrow / awaitForTranslationOrFallbackToOriginal to i18n-keyless-node
and deprecates awaitForTranslation there. Protocol reference unchanged.
3.4.0 #
First release of the Flutter port. The version tracks the JavaScript SDKs and the protocol
revision it implements: docs/PROTOCOL.md reference 3.4.0 (i18n-keyless-core 3.4.0).
I18nKeylessClient: pure-Dart port of the core and of the react store. Synchronous lookup, translate-on-miss queue (30 concurrent, deduplicated bynamespace:key), bulk fetch withETag/If-None-Matchreplay, 10 s timeout, 3 attempts with 500 ms and 1500 ms backoff, no retry on 4xx, never throws, never clears a stored translation.- Device id: generated before the first request, persisted under
i18n-keyless-user-id, sent asunique_idwithsdk: flutterandVersion: 3.4.0. - Usage analytics recorded per render and sent once per
init;sendUsage: falseto disable (thessr: trueof the JavaScript SDKs). - Storage:
I18nKeylessStorage(three async methods),MemoryStorage,SharedPreferencesStorage. Same keys and serialisation asi18n-keyless-react. - Flutter:
I18nKeylessScope,I18nKeyless.of(context), theTwidget,context.t(),context.i18n. - Languages: the
Langenum with the 48 v3 codes,availableLangs,resolveLang,toAppStoreLocale. - Tests:
core_test.dart,widget_test.dart, andconformance_test.dartreplaying every vector ofconformance/vectors/that applies to a device SDK. - Documented divergences from the reference: a rebuild does not re-request a string
already queued for the current language until its namespace's bulk fetch has landed;
sendUsage: falsekeeps the device identity (sdk: flutter,unique_id) instead of switching to a server runtime.