From e5bd43469e9918548ae80f04e30b0508716092f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= Date: Mon, 15 Feb 2021 14:47:14 +0100 Subject: [PATCH] Add Javados to Localizer#setLocale() --- .../briarproject/briar/android/Localizer.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/briar-android/src/main/java/org/briarproject/briar/android/Localizer.java b/briar-android/src/main/java/org/briarproject/briar/android/Localizer.java index eb9c1f431..5e99eba79 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/Localizer.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/Localizer.java @@ -68,7 +68,21 @@ public class Localizer { return new Locale(tag); } - // Returns the localized version of context + /* + * Apply localization to the specified context. + * + * It updates the configuration of the context's resources object but can + * also return a new context derived from the context parameter. Hence + * make sure to work with the return value of this method instead of + * the context you passed as a parameter. + * + * This method also has side-effects as it calls Locale#setDefault(). + * + * When using this in attachBaseContext() of Application, Service or + * Activity subclasses, it is important to not only apply this method to the + * base Context parameter received in that method, but also apply it on the + * class itself which also extends Context. + */ public Context setLocale(Context context) { Resources res = context.getResources(); Configuration conf = res.getConfiguration();