Generating bundles for Flutter SDK

🚧

Lokalise Flutter SDK is in beta

Please reach out to our Support team through the chat widget at lokalise.com (bottom right corner) if you want to try out the SDK.

This guide will walk you trough:

To learn all about using the OTA API and working with bundles, please check out the corresponding guide.

Generating an OTA bundle

πŸ“˜

flutter_sdk is considered to be the Other platform.

Make sure you link the keys that you want to export to the Other platform.

You can adjust key platforms inside the key editor (please find more information in the corresponding article).

To generate a new bundle, proceed to the Download files endpoint in Lokalise API playground an fill in the following fields:

  • Authentication (header) β€” your API token.
  • project_id β€” ID of your Lokalise project.
  • format β€” provide flutter_sdk.
  • export_empty_as β€” set to skip.
  • placeholder_format β€” set to icu.
  • plural_format β€” set to icu.

Or pass this body if plan to use the Download files endpoint directly:

{
    "format": "flutter_sdk",
    "export_empty_as": "skip",
    "placeholder_format": "icu",
    "plural_format": "icu"
}

Configure any other options as needed. Please note that it is recommended to add only the modified translations to the OTA bundle to minimize its size. You can check the following blog post that sums up the recommended practices.

Make sure that you click Try it when using the API playground. Your new OTA bundle will be created.

🚧

Make sure you are enrolled into Beta

Otherwise, the generated bundle will not be registered by the OTA Service.

Please reach out to our Support team through the chat widget here or at lokalise.com (bottom left corner) to do that.

Listing OTA bundles

Once you have an OTA bundle, you can check its attributes by using the List bundles endpoint. Specifically, you will need a bundle ID to stage it for prerelease or publish for production.

What is the difference between prerelease and production bundles?

  • The production translation bundle will be served to mobile users by default: in other words, that the bundle aimed for stable app versions.
  • The prerelease bundle will be served to your users only if the mobile SDK specifically requests a prerelease version. It's usually utilized for testing purposes.

Fill in the following fields:

  • Authentication (Bearer) β€” your JWT (you can get it using the Create a service JWT token).
  • teamId β€” your team ID.
  • lokaliseProjectId β€” your project Id.

Click Try it and find the bundle you would like to work with. Take a note of its ID:

Publishing bundles to production

Now that you have a bundle ID, you can publish it for production. To achieve that, proceed to the Publish bundle endpoint and fill in the following fields:

  • Authentication (Bearer) β€” your JWT (you can get it using the Create a service JWT token).
  • teamId β€” your team ID.
  • lokaliseProjectId β€” your project Id.
  • framework β€” choose flutter_sdk.
  • bundleId β€” enter your bundle ID obtained on the previous step.

Once you are ready, click Try it. Your bundle is now ready for production usage, and your app users will automatically obtain new translations!

There can be one bundle published to production. To unpublish a bundle you simply publish another one.

For a more fine-tuned control, you can create bundle freezes as explained in the following guide.


What’s Next