mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-27 22:39:47 +00:00
16 lines
483 B
C#
16 lines
483 B
C#
|
namespace AIStudio.Tools.Services;
|
|||
|
|
|||
|
public sealed partial class RustService
|
|||
|
{
|
|||
|
public async Task<string> ReadUserLanguage()
|
|||
|
{
|
|||
|
var response = await this.http.GetAsync("/system/language");
|
|||
|
if (!response.IsSuccessStatusCode)
|
|||
|
{
|
|||
|
this.logger!.LogError($"Failed to read the user language from Rust: '{response.StatusCode}'");
|
|||
|
return string.Empty;
|
|||
|
}
|
|||
|
|
|||
|
return await response.Content.ReadAsStringAsync();
|
|||
|
}
|
|||
|
}
|