mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
- Added NadekoBot.Generators projects which will contain source generators
- Implemented initial version of the response strings source generator - Creates a class with property names equivalent to key names in responses.en-US.json - Each Property has struct type (with generic type parameters matching the number of string format placeholders) for type safe GetText implementation - Struct types are readonly refs as they should be ephermal, and only used to pass string keys to GetText
This commit is contained in:
@@ -31,6 +31,9 @@ namespace NadekoBot.Modules
|
||||
|
||||
protected string GetText(string key) =>
|
||||
Strings.GetText(key, _cultureInfo);
|
||||
|
||||
protected string GetText(in LocStr key) =>
|
||||
Strings.GetText(key.Key, _cultureInfo);
|
||||
|
||||
protected string GetText(string key, params object[] args) =>
|
||||
Strings.GetText(key, _cultureInfo, args);
|
||||
|
Reference in New Issue
Block a user