How to switch back to system default locales?
See original GitHub issueHi,
I’m considering to use this library in my projects but I didn’t find way how to switch back to original system settings? What value should be set to updateLocale
method if I don’t want to override system settings anymore?
Rationale: users may try this feature but find that localization to any language from the list does not fit them. So they want to return back to original state before they tried the feature. But I don’t know how to implement that.
Thanks for your help Tom
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to change system locale in Windows 10 - The Language for
Click the Administrative tab, and then, under Language for non-Unicode programs, click Change system locale. Image If you're prompted for an ...
Read more >2 Ways to Change System Locale in Windows 10
Select the desired language from the Current system locale drop-down list, and click OK. Restart your computer for the changes to take effect....
Read more >How to Change System Locale on Windows 10 - YouTube
How to Change System Locale on Windows 10. How to Change the System Locale on a Windows Computer.Issues addressed in this tutorial: change...
Read more >How to Change or Set System Locales in Linux - Tecmint
If you want to change or set system local, use the update-locale program. The LANG variable allows you to set the locale for...
Read more >Change System Locale in Windows 10 - Winaero
The option that specifies the default language to use for non-Unicode programs is called System Locale. The system locale defines the bitmap ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can pass the locale below to achieve what you want:
ConfigurationCompat.getLocales(Resources.getSystem().configuration)[0]
Hi @thubalek,
It is pretty rare scenario but it is easy to handle. Because if you give the user option to change language on the fly you present them let say x amount of languages. When they select a language they can always select their native language from the list again.
So if you want to mark the system language for the user for instance, you can do that easily. When the app first loads, the
Locale
is filled statically by the system default. SoLocale.getDefault()
returns the system language at the beginning. The idea is you save this information somewhere and use it later on. If this is useful I can directly return it from the library itself actually.In your custom
Application
class, override theattachBaseContext
method and before calling the super save the systemLocale.After that point though, Locale is overridden by the library.