Question: Actually I'm handling 3 languages in my app so I have:

`values/strings.xml`

`values-it/strings.xml`

`values-de/strings.xml`

When I install the app, it is properly installed in the current language of the device.
But if I change the language of the device, the language of the app doesn't switch. I have to reinstall it to switch the language.

I've seent that this happens also to other apps, but not to all. The "big" ones (whatsapp, viber, all google's, etc) change.

So the question is: how can an app follow the device's language change ?

Answer: 
If the file is not fixed length, you are out of luck. Some function will have to read the file. If the file is fixed length, you can open the file, use the function `file.seek(line*linesize)`. Then read the file from there.
As others have commented python doesn't support this as it doesn't know where lines start and end (unless they're fixed length). If you're doing this repeatedly I'd recommend either padding out the lines to a constant length (if practical) or failing that reading them into some kind of basic database. You'll take a bit of a hit to memory size but unless you're only indexing once in a blue moon it'll probably be worth it.

If space is a big concern and padding isn't possible you could also add a (linenumber) tag at the start of each line. While you would have to guess the size of jumps and then parse a sample of line to check them that would allow you to make a searching algorithm to find the right line quickly for only around 10 characters per line