feat!: enhance Language to become more of a Locale
This PR enhances the Language DocType to become more of a locale, i.e. Language now bundles all date, time and number format settings that apply to a specific region.
Before, the user could only set an individual language. All other settings, like date, time and number format would be taken from System Settings. (The same applies to Lead, Customer and Supplier in ERPNext.) Now, the whole set of options is configurable per language/locale.
Overview
- Add settings for date and time to Language
- Add backend utils for retrieving locale settings from the user's Language or global defaults
- Refactor existing code to make use of above methods
- Update user defaults when user's Language or Language's settings change
Design considerations
- Language by default does not have any date/time/number formats set, these are fully optional.
- System defaults are used if language does not have any values.
This way, the behavior should be mostly backwards compatible. The only change is that the user's language/locale can now override the system defaults, if desired.
Nevertheless, to be safe, this is meant for develop only.
Language, in theory, should now be named Locale, but this would be too breaking, IMO.
Screenshots
System Settings:
Language "de" ("Deutsch"):
Language "en" ("English"):
Print with Language set to "en" (uses System Settings because "en" has no specific config set):
Print with Language set to "de" (uses more specific settings from Language "de"):
Form view with user's language set to "de" (uses more specific settings from Language "de"):
Form view when user has no specific language (uses System Settings):
To do
- [x] fix
money_in_words(The follow-up PR #27190 improvesmoney_in_words. Here, we just make sure it continues to work like before.)
Resolves #9001
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.