Refactor localization helper in RustService class

This commit is contained in:
Thorsten Sommer 2025-12-16 21:11:13 +01:00
parent f7748be845
commit 30af510e12
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 3 additions and 4 deletions

View File

@ -5,8 +5,6 @@ namespace AIStudio.Tools.Services;
public sealed partial class RustService
{
private static string TB_Clipboard(string fallbackEN) => I18N.I.T(fallbackEN, typeof(RustService).Namespace, $"{nameof(RustService)}.Clipboard");
/// <summary>
/// Tries to copy the given text to the clipboard.
/// </summary>
@ -14,8 +12,6 @@ public sealed partial class RustService
/// <param name="text">The text to copy to the clipboard.</param>
public async Task CopyText2Clipboard(ISnackbar snackbar, string text)
{
static string TB(string fallbackEN) => TB_Clipboard(fallbackEN);
var message = TB("Successfully copied the text to your clipboard");
var iconColor = Color.Error;
var severity = Severity.Error;

View File

@ -2,6 +2,7 @@ using System.Security.Cryptography;
using System.Text.Json;
using AIStudio.Settings;
using AIStudio.Tools.PluginSystem;
using Version = System.Version;
@ -14,6 +15,8 @@ namespace AIStudio.Tools.Services;
/// </summary>
public sealed partial class RustService : BackgroundService
{
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(RustService).Namespace, nameof(RustService));
private readonly HttpClient http;
private readonly JsonSerializerOptions jsonRustSerializerOptions = new()