mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Add Javados to Localizer#setLocale()
This commit is contained in:
@@ -68,7 +68,21 @@ public class Localizer {
|
|||||||
return new Locale(tag);
|
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) {
|
public Context setLocale(Context context) {
|
||||||
Resources res = context.getResources();
|
Resources res = context.getResources();
|
||||||
Configuration conf = res.getConfiguration();
|
Configuration conf = res.getConfiguration();
|
||||||
|
|||||||
Reference in New Issue
Block a user