Is your feature request related to a problem? Please describe.
Currently, language strings sent in Discord messages and embeds are hardcoded in English in the C#. In some cases, particularly with error messages, the same string is often hardcoded in multiple places. If we want to change a string, we need to grep for it and potentially change it in multiple places. Additionally, if we ever decided to offer support for other languages, the current system would be completely unworkable.
Describe the solution you'd like
Instead, we should use .NET localization services, with language strings defined in resource files. The IStringLocalizer<T> service will be available via dependency injection and language strings can be retrieved by name. Information about this is available here.
If we decide to support other languages in the future, we could store language config per guild (or maybe per user, but I doubt it?) in the db and use the CustomRequestCultureProvider class, or our own provider class, to look up the language/culture for each request. More info here.
Is your feature request related to a problem? Please describe. Currently, language strings sent in Discord messages and embeds are hardcoded in English in the C#. In some cases, particularly with error messages, the same string is often hardcoded in multiple places. If we want to change a string, we need to grep for it and potentially change it in multiple places. Additionally, if we ever decided to offer support for other languages, the current system would be completely unworkable.
Describe the solution you'd like Instead, we should use .NET localization services, with language strings defined in resource files. The
IStringLocalizer<T>
service will be available via dependency injection and language strings can be retrieved by name. Information about this is available here.If we decide to support other languages in the future, we could store language config per guild (or maybe per user, but I doubt it?) in the db and use the
CustomRequestCultureProvider
class, or our own provider class, to look up the language/culture for each request. More info here.