The most common questions related to Localazy Gradle plugin. How does it work? How to use it with app bundles and libraries?
Why does the download task fail for the new app? 🔗
If you have just added Localazy to your app and uploaded strings, please wait for up to 30 minutes for our servers to process your strings and prepare data.
Why don’t new strings appear in my app? 🔗
The most common reasons are:
- It’s possible that published changes are not available yet. The publishing process may take up to 30 minutes.
- The locally cached version is used when building the app.
Wait for up to 30 minutes, clean your project, and rebuild it.
What are the known limitations? 🔗
- While Localazy fully supports flavors in app modules, it doesn’t support flavors in library modules. However, using flavors in libraries is rare.
- The app module and library modules must use the same set of build types. It only applies to library modules added in localazy > upload > projects.
- All flavors must have the default translation of the string. Otherwise, it cannot be correctly handled by the Localazy platform. However, not respecting this rule is considered bad practice anyway.
- Deprecated feature modules may not be fully supported. The new dynamic feature modules and App Bundles are fully supported.
Does Localazy affect my tests? 🔗
The bytecode injection and resources processing is not applied to unit and instrumentation tests. This is for a reason: to keep tests predictable.
How to apply Localazy to dynamic feature modules? 🔗
Localazy fully supports App Bundles and dynamic feature modules. For App Bundles without dynamic feature modules, you just follow the Quick start chapter of Localazy Gradle plugin documentation, and that’s it.
If your app makes use of dynamic features, do this:
1. Follow steps 2 and 3 from Quick start chapter of Localazy Gradle plugin documentation for all dynamic feature modules you want to include. Be sure to use the same version (plain, support, androidx) of the Android library as in your app’s module.
2. Adds your dynamic feature modules in the plugin configuration of your app’s module under localazy > upload > projects.
3. And that’s it!
Strings from the dynamic feature module are placed inside a namespace corresponding to the module name. If you change its name, our Localazy InTM will assist you in moving translations.
How to apply Localazy to libraries? 🔗
Localazy is designed to work for app modules, and it’s not suitable for translating libraries only.
However, it works perfectly for apps with library modules.
1. Follow steps 2 and 3 from Quick start chapter of Localazy Gradle plugin documentation for all library modules you want to include. No special configuration is necessary as only the injection process is involved for libraries. Be sure to use the same version (plain, support, androidx) of the Android library as in your app’s module.
Adds your library modules in the plugin configuration of your app’s module under localazy > upload > projects.
And that’s it!
What about older versions of my app? 🔗
Localazy keeps track of removed strings and delivers them for older versions of your app. There is nothing you need to do.
However, there is one rule to keep in mind. Never change the meaning of the existing string radically. It’s not a good practice anyway, and it would interfere with older app versions.
For example, imagine that you have string string_app_new containing text New Item. You no longer need it, and you want to reuse it for Delete New Items. Don’t do it. Create a new string with different key and just remove string my_app_new from your strings.xml.
How does Localazy modify my code? 🔗
Localazy Gradle plugin changes the bytecode of your app in several ways.
It needs to add the library initialization and resources overriding code to your
Application (if available), all
It also needs to modify code that creates menus and preferences.
Additional changes to your bytecode may be required for some features like @StringLoaded annotation, etc.
- Why does the download task fail for the new app?
- Why don't new strings appear in my app?
- What are the known limitations?
- Does Localazy affect my tests?
- How to apply Localazy to dynamic feature modules?
- How to apply Localazy to libraries?
- What about older versions of my app?
- How does Localazy modify my code?