Closed Skogsfrae closed 4 years ago
Very useful feature! Tried it and works perfectly
Thanks for the pull request, however I will not merge this feature. This problem can easily be solved by creating an array of localization keys instead and is very situational.
An array of localization keys could be a solution if the array is of fixed length. However, if I want to add a new message with your solution I should add another key to that specific array and thus create another build of the app
And adding a new string to the localization files wouldn't require creating another build?
No if the strings are downloaded OTA
The localization service loads the localization strings from the embedded assets (JSON files). So in order to add a new string/message, you would need to add it to the specific JSON files and recompile the app.
What you're saying would work if the localization files would be retrieved remotely for example but this is not the case here.
If you meant the array keys would have to be static, this is not the case either. You can just retrieve the list of localization keys from an API and create/modify the array based on that.
What
Added support to translate a list of strings.
Why
For a project I'm working on I needed to get a list of strings to display in a random way (ex.: a pseudo bot that says different sentences for a specific action) using the nested json feature provided by lokalise (link to specific doc page).
Example
json:
flutter: