mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-05 06:29:41 +00:00
Added more text content to the I18N system (#446)
This commit is contained in:
1 parent
cfc2103b43
commit
7a08baf99b
43 files changed
+3356
-354
No files matched your search
@@ -1,25 +1,29 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class DataSourceSecurityExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(DataSourceSecurityExtensions).Namespace, nameof(DataSourceSecurityExtensions));
|
||||
|
||||
public static string ToSelectionText(this DataSourceSecurity security) => security switch
|
||||
{
|
||||
DataSourceSecurity.NOT_SPECIFIED => "Please select a security policy",
|
||||
DataSourceSecurity.NOT_SPECIFIED => TB("Please select a security policy"),
|
||||
|
||||
DataSourceSecurity.ALLOW_ANY => "This data source can be used with any LLM provider. Your data may be sent to a cloud-based provider.",
|
||||
DataSourceSecurity.SELF_HOSTED => "This data source can only be used with a self-hosted LLM provider. Your data will not be sent to any cloud-based provider.",
|
||||
DataSourceSecurity.ALLOW_ANY => TB("This data source can be used with any LLM provider. Your data may be sent to a cloud-based provider."),
|
||||
DataSourceSecurity.SELF_HOSTED => TB("This data source can only be used with a self-hosted LLM provider. Your data will not be sent to any cloud-based provider."),
|
||||
|
||||
_ => "Unknown security policy"
|
||||
_ => TB("Unknown security policy")
|
||||
};
|
||||
|
||||
public static string ToInfoText(this DataSourceSecurity security) => security switch
|
||||
{
|
||||
DataSourceSecurity.NOT_SPECIFIED => "The security of the data source is not specified yet. You cannot use this data source until you specify a security policy.",
|
||||
DataSourceSecurity.NOT_SPECIFIED => TB("The security of the data source is not specified yet. You cannot use this data source until you specify a security policy."),
|
||||
|
||||
DataSourceSecurity.ALLOW_ANY => "This data source can be used with any LLM provider. Your data may be sent to a cloud-based provider.",
|
||||
DataSourceSecurity.SELF_HOSTED => "This data source can only be used with a self-hosted LLM provider. Your data will not be sent to any cloud-based provider.",
|
||||
DataSourceSecurity.ALLOW_ANY => TB("This data source can be used with any LLM provider. Your data may be sent to a cloud-based provider."),
|
||||
DataSourceSecurity.SELF_HOSTED => TB("This data source can only be used with a self-hosted LLM provider. Your data will not be sent to any cloud-based provider."),
|
||||
|
||||
_ => "Unknown security policy"
|
||||
_ => TB("Unknown security policy")
|
||||
};
|
||||
|
||||
public static TextColor GetColor(this DataSourceSecurity security) => security switch
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
@@ -5,6 +7,8 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// </summary>
|
||||
public static class DataSourceTypeExtension
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(DataSourceTypeExtension).Namespace, nameof(DataSourceTypeExtension));
|
||||
|
||||
/// <summary>
|
||||
/// Get the display name of the data source type.
|
||||
/// </summary>
|
||||
@@ -12,10 +16,10 @@ public static class DataSourceTypeExtension
|
||||
/// <returns>The display name of the data source type.</returns>
|
||||
public static string GetDisplayName(this DataSourceType type) => type switch
|
||||
{
|
||||
DataSourceType.LOCAL_FILE => "Local File",
|
||||
DataSourceType.LOCAL_DIRECTORY => "Local Directory",
|
||||
DataSourceType.ERI_V1 => "External ERI Server (v1)",
|
||||
DataSourceType.LOCAL_FILE => TB("Local File"),
|
||||
DataSourceType.LOCAL_DIRECTORY => TB("Local Directory"),
|
||||
DataSourceType.ERI_V1 => TB("External ERI Server (v1)"),
|
||||
|
||||
_ => "None",
|
||||
_ => TB("None"),
|
||||
};
|
||||
}
|
||||
@@ -1,16 +1,20 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class PreviewFeaturesExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(PreviewFeaturesExtensions).Namespace, nameof(PreviewFeaturesExtensions));
|
||||
|
||||
public static string GetPreviewDescription(this PreviewFeatures feature) => feature switch
|
||||
{
|
||||
PreviewFeatures.PRE_WRITER_MODE_2024 => "Writer Mode: Experiments about how to write long texts using AI",
|
||||
PreviewFeatures.PRE_RAG_2024 => "RAG: Preview of our RAG implementation where you can refer your files or integrate enterprise data within your company",
|
||||
PreviewFeatures.PRE_WRITER_MODE_2024 => TB("Writer Mode: Experiments about how to write long texts using AI"),
|
||||
PreviewFeatures.PRE_RAG_2024 => TB("RAG: Preview of our RAG implementation where you can refer your files or integrate enterprise data within your company"),
|
||||
|
||||
PreviewFeatures.PRE_PLUGINS_2025 => "Plugins: Preview of our plugin system where you can extend the functionality of the app",
|
||||
PreviewFeatures.PRE_READ_PDF_2025 => "Read PDF: Preview of our PDF reading system where you can read and extract text from PDF files",
|
||||
PreviewFeatures.PRE_PLUGINS_2025 => TB("Plugins: Preview of our plugin system where you can extend the functionality of the app"),
|
||||
PreviewFeatures.PRE_READ_PDF_2025 => TB("Read PDF: Preview of our PDF reading system where you can read and extract text from PDF files"),
|
||||
|
||||
_ => "Unknown preview feature"
|
||||
_ => TB("Unknown preview feature")
|
||||
};
|
||||
|
||||
public static bool IsEnabled(this PreviewFeatures feature, SettingsManager settingsManager) => settingsManager.ConfigurationData.App.EnabledPreviewFeatures.Contains(feature);
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class SendToChatDataSourceBehaviorExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(SendToChatDataSourceBehaviorExtensions).Namespace, nameof(SendToChatDataSourceBehaviorExtensions));
|
||||
|
||||
public static string Description(this SendToChatDataSourceBehavior behavior) => behavior switch
|
||||
{
|
||||
SendToChatDataSourceBehavior.NO_DATA_SOURCES => "Use no data sources, when sending an assistant result to a chat",
|
||||
SendToChatDataSourceBehavior.APPLY_STANDARD_CHAT_DATA_SOURCE_OPTIONS => "Apply standard chat data source options, when sending an assistant result to a chat",
|
||||
SendToChatDataSourceBehavior.NO_DATA_SOURCES => TB("Use no data sources, when sending an assistant result to a chat"),
|
||||
SendToChatDataSourceBehavior.APPLY_STANDARD_CHAT_DATA_SOURCE_OPTIONS => TB("Apply standard chat data source options, when sending an assistant result to a chat"),
|
||||
|
||||
_ => "Unknown behavior",
|
||||
_ => TB("Unknown behavior"),
|
||||
};
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class ThemesExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(ThemesExtensions).Namespace, nameof(ThemesExtensions));
|
||||
|
||||
public static string GetName(this Themes theme) => theme switch
|
||||
{
|
||||
Themes.SYSTEM => "Synchronized with the operating system settings",
|
||||
Themes.LIGHT => "Always use light theme",
|
||||
Themes.DARK => "Always use dark theme",
|
||||
Themes.SYSTEM => TB("Synchronized with the operating system settings"),
|
||||
Themes.LIGHT => TB("Always use light theme"),
|
||||
Themes.DARK => TB("Always use dark theme"),
|
||||
|
||||
_ => "Unknown setting",
|
||||
_ => TB("Unknown setting"),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user