Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String resource changes not reflected on the UI unless changing the key

We got a project at work where we support multiple languages and countries. I wanted to update an already translated string resource to show more info and the changes I made are not showing up in the app.

I tried deleting the gradle caches, I tried re-cloning the project, different devices, different computers, android emulators and even went as far as telling some colleagues to try the changes on their computers and nothing worked. I thought maybe the problem was related to the string I was changing having translated siblings but even after deleting them, the changes weren't reflected.

The only thing that works is changing the string resource key.

So, basically, the problem I have is that whatever string resource I try to update, it doesn't update.

like image 624
Kostas Andrianos Avatar asked Jan 18 '26 12:01

Kostas Andrianos


1 Answers

I had the same issue. In my case it turned out to be because of the Lokalise library implemented in the project (of which I was unaware), which updates the string resource values "on the fly". https://docs.lokalise.com/en/articles/3487109-lokalise-android-sdk-2-0 In this case, I obviously should first update the value on the Lokalise dashboard or using the Lokalise API.

Editing the string resource key helped because it then was not recognised by Lokalise, and therefore not overwritten by it.

Have a look at your project's Application class and check if there's Lokalise.init() in there. If it's not Lokalise, there's other localisation libraries, so you might need to look into that.

like image 157
Serge Avatar answered Jan 20 '26 03:01

Serge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!