Skip to content

Add German localization #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Apr 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c20b1c6
Fixed data collection for Lua comments
SommerEngineering Apr 27, 2025
8f27281
Enhance localization support by adding namespace and type parameters …
SommerEngineering Apr 27, 2025
18aadeb
Refactor IDisposable implementation in MSGComponentBase to improve re…
SommerEngineering Apr 27, 2025
989fb05
Fixed order of initialization
SommerEngineering Apr 27, 2025
ae0cb4c
Added missed text content
SommerEngineering Apr 27, 2025
8896a3c
Added more dialogs & components
SommerEngineering Apr 27, 2025
ea7a899
Updated
SommerEngineering Apr 27, 2025
1a59df8
Added German translation
SommerEngineering Apr 27, 2025
3f2b851
Added abbreviation for TB in code style settings
SommerEngineering Apr 27, 2025
09d87d2
Updated
SommerEngineering Apr 27, 2025
b1c0cb3
Remove generic suffix from type names in ILangExtensions
SommerEngineering Apr 27, 2025
74f6b07
Update German translations for clarity and consistency
SommerEngineering Apr 27, 2025
ad3c428
Refactor Vision and Home components to initialize items on async load…
SommerEngineering Apr 27, 2025
bcde1c2
Formatting
SommerEngineering Apr 27, 2025
22ce747
Refactor FindAllTextTags method to support multiple start tags and im…
SommerEngineering Apr 27, 2025
dc34028
Remove debug logging for language plugin checks
SommerEngineering Apr 27, 2025
b1319fa
Trigger state update for MudDialog on initialization to update the he…
SommerEngineering Apr 27, 2025
a3a1483
Enhance plugin loading with improved error handling and file reading …
SommerEngineering Apr 27, 2025
2492a58
Improve hot reload logic with enhanced logging and semaphore management
SommerEngineering Apr 27, 2025
ed58bae
Add new UI text entries and improve existing translations for chat co…
SommerEngineering Apr 27, 2025
28d6159
Added missed tooltip to the I18N system
SommerEngineering Apr 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enhance plugin loading with improved error handling and file reading …
…logic
  • Loading branch information
SommerEngineering committed Apr 27, 2025
commit a3a1483c84ea4bf16556486141be39f904ddefdf
69 changes: 42 additions & 27 deletions app/MindWork AI Studio/Tools/PluginSystem/PluginFactory.Loading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,39 +55,54 @@ public static async Task LoadAll(CancellationToken cancellationToken = default)
var pluginMainFiles = Directory.EnumerateFiles(PLUGINS_ROOT, "plugin.lua", SearchOption.AllDirectories);
foreach (var pluginMainFile in pluginMainFiles)
{
if (cancellationToken.IsCancellationRequested)
break;
try
{
if (cancellationToken.IsCancellationRequested)
break;

LOG.LogInformation($"Try to load plugin: {pluginMainFile}");
var code = await File.ReadAllTextAsync(pluginMainFile, Encoding.UTF8, cancellationToken);
var pluginPath = Path.GetDirectoryName(pluginMainFile)!;
var plugin = await Load(pluginPath, code, cancellationToken);
LOG.LogInformation($"Try to load plugin: {pluginMainFile}");
var fileInfo = new FileInfo(pluginMainFile);
string code;
await using(var fileStream = fileInfo.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
using var reader = new StreamReader(fileStream, Encoding.UTF8);
code = await reader.ReadToEndAsync(cancellationToken);
}

var pluginPath = Path.GetDirectoryName(pluginMainFile)!;
var plugin = await Load(pluginPath, code, cancellationToken);

switch (plugin)
{
case NoPlugin noPlugin when noPlugin.Issues.Any():
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: {noPlugin.Issues.First()}");
continue;
switch (plugin)
{
case NoPlugin noPlugin when noPlugin.Issues.Any():
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: {noPlugin.Issues.First()}");
continue;

case NoPlugin:
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: Unknown.");
continue;
case NoPlugin:
LOG.LogError($"Was not able to load plugin: '{pluginMainFile}'. Reason: Unknown.");
continue;

case { IsValid: false }:
LOG.LogError($"Was not able to load plugin '{pluginMainFile}', because the Lua code is not a valid AI Studio plugin. There are {plugin.Issues.Count()} issues to fix. First issue is: {plugin.Issues.FirstOrDefault()}");
#if DEBUG
foreach (var pluginIssue in plugin.Issues)
LOG.LogError($"Plugin issue: {pluginIssue}");
#endif
continue;
case { IsValid: false }:
LOG.LogError($"Was not able to load plugin '{pluginMainFile}', because the Lua code is not a valid AI Studio plugin. There are {plugin.Issues.Count()} issues to fix. First issue is: {plugin.Issues.FirstOrDefault()}");
#if DEBUG
foreach (var pluginIssue in plugin.Issues)
LOG.LogError($"Plugin issue: {pluginIssue}");
#endif
continue;

case { IsMaintained: false }:
LOG.LogWarning($"The plugin '{pluginMainFile}' is not maintained anymore. Please consider to disable it.");
break;
}
case { IsMaintained: false }:
LOG.LogWarning($"The plugin '{pluginMainFile}' is not maintained anymore. Please consider to disable it.");
break;
}

LOG.LogInformation($"Successfully loaded plugin: '{pluginMainFile}' (Id='{plugin.Id}', Type='{plugin.Type}', Name='{plugin.Name}', Version='{plugin.Version}', Authors='{string.Join(", ", plugin.Authors)}')");
AVAILABLE_PLUGINS.Add(new PluginMetadata(plugin, pluginPath));
LOG.LogInformation($"Successfully loaded plugin: '{pluginMainFile}' (Id='{plugin.Id}', Type='{plugin.Type}', Name='{plugin.Name}', Version='{plugin.Version}', Authors='{string.Join(", ", plugin.Authors)}')");
AVAILABLE_PLUGINS.Add(new PluginMetadata(plugin, pluginPath));
}
catch (Exception e)
{
LOG.LogError($"Was not able to load plugin '{pluginMainFile}'. Issue: {e.Message}");
LOG.LogDebug(e.StackTrace);
}
}

// Start or restart all plugins:
Expand Down