https://kotlinlang.org logo
#detekt
Title
# detekt
p

Peter

12/12/2023, 8:44 PM
could someone be so kind to give me some further explanation / examples, when using "implicit default locale" is a bad practice? (for rule ImplicitDefaultLocale)
It makes sense to me, to use specific locale for some data transfer (DTO). But I'm not completely sure, when it's a bad practice otherwise. I guess it's to use the default locale, when displaying some text on the UI?
e

Emil Kantis

12/12/2023, 8:52 PM
If your code depends on system locale, then deploying into a new environment may cause unintended side-effects. Can happen if you move between on-premise servers and cloud, change how you package your application, etc. Not sure about android aspects of this.
p

Peter

12/12/2023, 9:26 PM
I see. I guess same could apply for some business logic on frontend clients.
m

mkrussel

12/13/2023, 3:00 PM
My view is that sometimes it is wrong to use the default locale and sometimes it is not. I'm guessing it is more often wrong on a server than on a client app. When you want to use the default locale, manually using it shows that it was an intentional decision and not something forgotten which might be a bug.
👍 1