aloussase / AlexandriaApp

:book: Search for books and download and convert them to different formats
MIT License
65 stars 4 forks source link

Added language exception handler, to show user an error message that contains the language code of his device and that the fallback language english is now used. #24

Closed Delorean12DMC closed 4 weeks ago

Delorean12DMC commented 3 months ago

When the menu init's it now checks if the language locale starts with en, es or de instead of directly comparing against a string, so that it doesn't matter, if the language locale consists of 2 letters, or 4 letters. Even if the device has a language locale, that isn't known to the app, an error message is shown, that the language is not found and the app defaults to english in that case, because in most cases english is known to the user (at least when he uses F-Droid and Github, the chances are pretty high). The user even gets informed in that error message, what language locale string his device has, and can make a report. That should be the best way to go at the moment.

Please check the implementations in the files thoroughly, as i didn't have the chance at the time of implementing, to test it myself. In my coding logic it should work as expected, but of course everyone can make errors and i'm not perfect either.

aloussase commented 3 months ago

What I don't like about this solution is that I think we should fallback to the device's locale instead of english. Also, as I said in the issue (#23) I don't see a good reason to have language settings inside the application, so I think I'm just going to remove this feature in the next update. Translations + system locale are the way to go for me.