Second iteration of source generated localized strings

- Strs renamed to strs
- Generic params will now default to object instead of string for convenient argument passing
- Many strings changed to use generated properties
This commit is contained in:
Kwoth
2021-07-24 20:41:07 +02:00
parent 34d0f66466
commit 70288f7670
63 changed files with 410 additions and 363 deletions

View File

@@ -16,6 +16,7 @@ using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
@@ -375,5 +376,22 @@ namespace NadekoBot.Extensions
return msg.Content.Headers.ContentLength / 1.MB();
}
public static string GetText(this IBotStrings strings, LocStr str, ulong? guildId = null)
=> strings.GetText(str.Key, guildId);
public static string GetText(this IBotStrings strings, LocStr str, CultureInfo culture)
=> strings.GetText(str.Key, culture);
public static string GetText<T>(this IBotStrings strings, LocStr<T> str, ulong? guildId, T obj1)
=> strings.GetText(str.Key, guildId, obj1);
public static string GetText<T>(this IBotStrings strings, LocStr<T> str, CultureInfo culture, T obj1)
=> strings.GetText(str.Key, culture, obj1);
public static string GetText<T1, T2>(this IBotStrings strings, LocStr<T1, T2> str, ulong? guildId, T1 obj1, T2 obj2)
=> strings.GetText(str.Key, guildId, obj1, obj2);
public static string GetText<T1, T2>(this IBotStrings strings, LocStr<T1, T2> str, CultureInfo culture, T1 obj1, T2 obj2)
=> strings.GetText(str.Key, culture, obj1, obj2);
}
}