Skip to content

Commit 9aa0a91

Browse files
Added more text content to the localization (#469)
1 parent 217d31b commit 9aa0a91

20 files changed

+1874
-222
lines changed

app/MindWork AI Studio/Assistants/I18N/allTexts.lua

Lines changed: 549 additions & 0 deletions
Large diffs are not rendered by default.

app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
@using AIStudio.Settings.DataModel
22
@using AIStudio.Tools.ERIClient.DataModel
3+
@inherits MSGComponentBase
4+
35
<MudDialog>
46
<DialogContent>
57
<MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
68
@* ReSharper disable once CSharpWarnings::CS8974 *@
79
<MudTextField
810
T="string"
911
@bind-Text="@this.dataName"
10-
Label="Data Source Name"
12+
Label="@T("Data Source Name")"
1113
Class="mb-6"
1214
MaxLength="40"
1315
Counter="40"
@@ -24,7 +26,7 @@
2426
<MudTextField
2527
T="string"
2628
@bind-Text="@this.dataHostname"
27-
Label="ERI v1 Server Hostname"
29+
Label="@T("ERI v1 Server Hostname")"
2830
Class="mb-6"
2931
Immediate="@true"
3032
Validation="@this.dataSourceValidation.ValidatingHostname"
@@ -35,7 +37,7 @@
3537
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
3638

3739
<MudNumericField
38-
Label="Port"
40+
Label="@T("Port")"
3941
Immediate="@true"
4042
Min="1" Max="65535"
4143
Validation="@this.dataSourceValidation.ValidatePort"
@@ -47,17 +49,15 @@
4749
@if (!this.IsConnectionEncrypted())
4850
{
4951
<MudJustifiedText Typo="Typo.body1" Color="Color.Error" Class="mb-3">
50-
Please note: the connection to the ERI v1 server is not encrypted. This means that all
51-
data sent to the server is transmitted in plain text. Please ask the ERI server administrator
52-
to enable encryption.
52+
@T("Please note: the connection to the ERI v1 server is not encrypted. This means that all data sent to the server is transmitted in plain text. Please ask the ERI server administrator to enable encryption.")
5353
</MudJustifiedText>
5454
}
5555

5656
@if (this.IsConnectionPossible())
5757
{
5858
<MudStack Row="@true" AlignItems="AlignItems.Center">
5959
<MudButton Variant="Variant.Filled" Color="@this.GetTestResultColor()" StartIcon="@this.GetTestResultIcon()" Class="mb-3" OnClick="@this.TestConnection">
60-
Test connection & read available metadata
60+
@T("Test connection & read available metadata")
6161
</MudButton>
6262
<MudText Typo="Typo.body1" Class="mb-3">
6363
@this.GetTestResultText()
@@ -70,7 +70,9 @@
7070
<MudSelect @bind-Value="@this.dataAuthMethod" Text="@this.dataAuthMethod.DisplayName()" Label="Authentication Method" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateAuthMethod">
7171
@foreach (var authMethod in this.availableAuthMethods)
7272
{
73-
<MudSelectItem Value="@authMethod">@authMethod.DisplayName()</MudSelectItem>
73+
<MudSelectItem Value="@authMethod">
74+
@authMethod.DisplayName()
75+
</MudSelectItem>
7476
}
7577
</MudSelect>
7678
}
@@ -83,7 +85,7 @@
8385
<MudTextField
8486
T="string"
8587
@bind-Text="@this.dataUsername"
86-
Label="Username"
88+
Label="@T("Username")"
8789
Class="mb-6"
8890
Immediate="@true"
8991
Validation="@this.dataSourceValidation.ValidateUsername"
@@ -112,7 +114,7 @@
112114

113115
@if (this.availableRetrievalProcesses.Count > 0)
114116
{
115-
<MudSelect @bind-Value="@this.dataSelectedRetrievalProcess" Text="@this.dataSelectedRetrievalProcess.Name" Label="Select one retrieval process" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateRetrievalProcess">
117+
<MudSelect @bind-Value="@this.dataSelectedRetrievalProcess" Text="@this.dataSelectedRetrievalProcess.Name" Label="@T("Select one retrieval process")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateRetrievalProcess">
116118
@foreach (var retrievalProcess in this.availableRetrievalProcesses)
117119
{
118120
<MudSelectItem Value="@retrievalProcess">
@@ -122,7 +124,7 @@
122124
</MudSelect>
123125
}
124126

125-
<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="Your security policy" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
127+
<MudSelect @bind-Value="@this.dataSecurityPolicy" Text="@this.dataSecurityPolicy.ToSelectionText()" Label="@T("Your security policy")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.dataSourceValidation.ValidateSecurityPolicy">
126128
@foreach (var policy in Enum.GetValues<DataSourceSecurity>())
127129
{
128130
<MudSelectItem Value="@policy">
@@ -135,15 +137,17 @@
135137
<Issues IssuesData="@this.dataIssues"/>
136138
</DialogContent>
137139
<DialogActions>
138-
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">Cancel</MudButton>
140+
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
141+
@T("Cancel")
142+
</MudButton>
139143
<MudButton OnClick="@this.Store" Variant="Variant.Filled" Color="Color.Primary">
140144
@if(this.IsEditing)
141145
{
142-
@:Update
146+
@T("Update")
143147
}
144148
else
145149
{
146-
@:Add
150+
@T("Add")
147151
}
148152
</MudButton>
149153
</DialogActions>

app/MindWork AI Studio/Dialogs/DataSourceERI_V1Dialog.razor.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AIStudio.Assistants.ERI;
2+
using AIStudio.Components;
23
using AIStudio.Settings;
34
using AIStudio.Settings.DataModel;
45
using AIStudio.Tools.ERIClient;
@@ -13,7 +14,7 @@
1314
// ReSharper disable InconsistentNaming
1415
namespace AIStudio.Dialogs;
1516

16-
public partial class DataSourceERI_V1Dialog : ComponentBase, ISecretId
17+
public partial class DataSourceERI_V1Dialog : MSGComponentBase, ISecretId
1718
{
1819
[CascadingParameter]
1920
private IMudDialogInstance MudDialog { get; set; } = null!;
@@ -24,9 +25,6 @@ public partial class DataSourceERI_V1Dialog : ComponentBase, ISecretId
2425
[Parameter]
2526
public DataSourceERI_V1 DataSource { get; set; }
2627

27-
[Inject]
28-
private SettingsManager SettingsManager { get; init; } = null!;
29-
3028
[Inject]
3129
private ILogger<ProviderDialog> Logger { get; init; } = null!;
3230

@@ -195,7 +193,7 @@ private async Task TestConnection()
195193
await this.form.Validate();
196194

197195
Array.Resize(ref this.dataIssues, this.dataIssues.Length + 1);
198-
this.dataIssues[^1] = "Failed to connect to the ERI v1 server. The server is not supported.";
196+
this.dataIssues[^1] = T("Failed to connect to the ERI v1 server. The server is not supported.");
199197
return;
200198
}
201199

@@ -254,7 +252,7 @@ private async Task TestConnection()
254252
await this.form.Validate();
255253

256254
Array.Resize(ref this.dataIssues, this.dataIssues.Length + 1);
257-
this.dataIssues[^1] = $"Failed to connect to the ERI v1 server. The message was: {e.Message}";
255+
this.dataIssues[^1] = string.Format(T("Failed to connect to the ERI v1 server. The message was: {0}"), e.Message);
258256
this.Logger.LogError($"Failed to connect to the ERI v1 server. Message: {e.Message}");
259257

260258
this.connectionTested = true;
@@ -265,9 +263,9 @@ private async Task TestConnection()
265263
private string GetTestResultText()
266264
{
267265
if(!this.connectionTested)
268-
return "Not tested yet.";
266+
return T("Not tested yet.");
269267

270-
return this.connectionSuccessfulTested ? "Connection successful." : "Connection failed.";
268+
return this.connectionSuccessfulTested ? T("Connection successful.") : T("Connection failed.");
271269
}
272270

273271
private Color GetTestResultColor()
@@ -290,9 +288,9 @@ private string GetTestResultIcon()
290288

291289
private string GetSecretLabel() => this.dataAuthMethod switch
292290
{
293-
AuthMethod.TOKEN => "Access Token",
294-
AuthMethod.USERNAME_PASSWORD => "Password",
295-
_ => "Secret",
291+
AuthMethod.TOKEN => T("Access Token"),
292+
AuthMethod.USERNAME_PASSWORD => T("Password"),
293+
_ => T("Secret"),
296294
};
297295

298296
private async Task Store()
@@ -320,7 +318,7 @@ private async Task Store()
320318
var storeResponse = await this.RustService.SetSecret(this, this.dataSecret);
321319
if (!storeResponse.Success)
322320
{
323-
this.dataSecretStorageIssue = $"Failed to store the auth. secret in the operating system. The message was: {storeResponse.Issue}. Please try again.";
321+
this.dataSecretStorageIssue = string.Format(T("Failed to store the auth. secret in the operating system. The message was: {0}. Please try again."), storeResponse.Issue);
324322
await this.form.Validate();
325323
return;
326324
}
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,64 @@
11
@using AIStudio.Settings.DataModel
22
@using AIStudio.Tools.ERIClient.DataModel
3-
3+
@inherits MSGComponentBase
44
<MudDialog>
55
<DialogContent>
66

77
<MudText Typo="Typo.h5">
8-
Common data source information
8+
@T("Common data source information")
99
</MudText>
1010

11-
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="Data source name" Value="@this.DataSource.Name" ClipboardTooltipSubject="the data source name"/>
12-
<TextInfoLine Icon="@Icons.Material.Filled.NetworkCheck" Label="ERI server hostname" Value="@this.DataSource.Hostname" ClipboardTooltipSubject="the ERI server hostname"/>
13-
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="ERI server port" Value="@this.Port" ClipboardTooltipSubject="the ERI server port"/>
11+
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("Data source name")" Value="@this.DataSource.Name" ClipboardTooltipSubject="@T("the data source name")"/>
12+
<TextInfoLine Icon="@Icons.Material.Filled.NetworkCheck" Label="@T("ERI server hostname")" Value="@this.DataSource.Hostname" ClipboardTooltipSubject="@T("the ERI server hostname")"/>
13+
<TextInfoLine Icon="@Icons.Material.Filled.Tag" Label="@T("ERI server port")" Value="@this.Port" ClipboardTooltipSubject="@T("the ERI server port")"/>
1414

1515
@if (!this.IsConnectionEncrypted())
1616
{
1717
<MudJustifiedText Typo="Typo.body1" Color="Color.Error" Class="mb-3">
18-
Please note: the connection to the ERI v1 server is not encrypted. This means that all
19-
data sent to the server is transmitted in plain text. Please ask the ERI server administrator
20-
to enable encryption.
18+
@T("Please note: the connection to the ERI v1 server is not encrypted. This means that all data sent to the server is transmitted in plain text. Please ask the ERI server administrator to enable encryption.")
2119
</MudJustifiedText>
2220
}
2321

2422
@if (this.DataSource.AuthMethod is AuthMethod.USERNAME_PASSWORD)
2523
{
26-
<TextInfoLine Icon="@Icons.Material.Filled.Person2" Label="Username" Value="@this.DataSource.Username" ClipboardTooltipSubject="the username"/>
24+
<TextInfoLine Icon="@Icons.Material.Filled.Person2" Label="@T("Username")" Value="@this.DataSource.Username" ClipboardTooltipSubject="@T("the username")"/>
2725
}
2826

29-
<TextInfoLines Label="Server description" MaxLines="14" Value="@this.serverDescription" ClipboardTooltipSubject="the server description"/>
30-
<TextInfoLines Label="Security requirements of the data provider" MaxLines="3" Value="@this.securityRequirements.Explain()" ClipboardTooltipSubject="the security requirements of the data provider"/>
31-
<TextInfoLines Label="Your security policy" MaxLines="3" Value="@this.DataSource.SecurityPolicy.ToInfoText()" Color="@this.DataSource.SecurityPolicy.GetColor()" ClipboardTooltipSubject="your security policy"/>
27+
<TextInfoLines Label="@T("Server description")" MaxLines="14" Value="@this.serverDescription" ClipboardTooltipSubject="@T("the server description")"/>
28+
<TextInfoLines Label="@T("Security requirements of the data provider")" MaxLines="3" Value="@this.securityRequirements.Explain()" ClipboardTooltipSubject="@T("the security requirements of the data provider")"/>
29+
<TextInfoLines Label="@T("Your security policy")" MaxLines="3" Value="@this.DataSource.SecurityPolicy.ToInfoText()" Color="@this.DataSource.SecurityPolicy.GetColor()" ClipboardTooltipSubject="@T("your security policy")"/>
3230

3331
<MudText Typo="Typo.h5" Class="mt-6">
34-
Retrieval information
32+
@T("Retrieval information")
3533
</MudText>
3634
@if (!this.retrievalInfoformation.Any())
3735
{
3836
<MudJustifiedText Typo="Typo.body1" Color="Color.Info" Class="mb-3">
39-
The data source does not provide any retrieval information.
37+
@T("The data source does not provide any retrieval information.")
4038
</MudJustifiedText>
4139
}
4240
else
4341
{
4442
<MudExpansionPanels Class="mb-3">
4543
<ExpansionPanel HeaderText="@this.RetrievalName(this.selectedRetrievalInfo)" HeaderIcon="@Icons.Material.Filled.Info">
46-
<TextInfoLines Label="Description" MaxLines="14" Value="@this.selectedRetrievalInfo.Description" ClipboardTooltipSubject="the retrieval description"/>
47-
<TextInfoLines Label="Parameters" MaxLines="14" Value="@this.RetrievalParameters(this.selectedRetrievalInfo)" ClipboardTooltipSubject="the retrieval parameters"/>
44+
<TextInfoLines Label="Description" MaxLines="14" Value="@this.selectedRetrievalInfo.Description" ClipboardTooltipSubject="@T("the retrieval description")"/>
45+
<TextInfoLines Label="Parameters" MaxLines="14" Value="@this.RetrievalParameters(this.selectedRetrievalInfo)" ClipboardTooltipSubject="@T("the retrieval parameters")"/>
4846

4947
@if (!string.IsNullOrWhiteSpace(this.selectedRetrievalInfo.Link))
5048
{
5149
<MudButton Href="@this.selectedRetrievalInfo.Link" Target="_blank" Class="mt-3" Color="Color.Primary" StartIcon="@Icons.Material.Filled.OpenInNew">
52-
Open web link, show more information
50+
@T("Open web link, show more information")
5351
</MudButton>
5452
}
5553

5654
<MudText Typo="Typo.h6" Class="mt-3">
57-
Embeddings
55+
@T("Embeddings")
5856
</MudText>
5957
@* ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract *@
6058
@if (this.selectedRetrievalInfo.Embeddings is null || !this.selectedRetrievalInfo.Embeddings.Any())
6159
{
6260
<MudJustifiedText Typo="Typo.body1" Color="Color.Info" Class="mb-3">
63-
The data source does not provide any embedding information.
61+
@T("The data source does not provide any embedding information.")
6462
</MudJustifiedText>
6563
}
6664
else
@@ -70,14 +68,14 @@
7068
{
7169
var embedding = this.selectedRetrievalInfo.Embeddings[embeddingIndex];
7270
<ExpansionPanel HeaderText="@embedding.EmbeddingName" HeaderIcon="@Icons.Material.Filled.Info" IsExpanded="embeddingIndex == 0">
73-
<TextInfoLine Icon="@Icons.Material.Filled.FormatShapes" Label="Type" Value="@embedding.EmbeddingType" ClipboardTooltipSubject="the embedding type"/>
74-
<TextInfoLines Label="Description" MaxLines="14" Value="@embedding.Description" ClipboardTooltipSubject="the embedding description"/>
75-
<TextInfoLines Label="When to use" MaxLines="3" Value="@embedding.UsedWhen" ClipboardTooltipSubject="when is the embedding used"/>
71+
<TextInfoLine Icon="@Icons.Material.Filled.FormatShapes" Label="Type" Value="@embedding.EmbeddingType" ClipboardTooltipSubject="@T("the embedding type")"/>
72+
<TextInfoLines Label="@T("Description")" MaxLines="14" Value="@embedding.Description" ClipboardTooltipSubject="@T("the embedding description")"/>
73+
<TextInfoLines Label="@T("When to use")" MaxLines="3" Value="@embedding.UsedWhen" ClipboardTooltipSubject="@T("when is the embedding used")"/>
7674

7775
@if (!string.IsNullOrWhiteSpace(embedding.Link))
7876
{
7977
<MudButton Href="@embedding.Link" Target="_blank" Class="mt-3" Color="Color.Primary" StartIcon="@Icons.Material.Filled.OpenInNew">
80-
Open web link, show more information
78+
@T("Open web link, show more information")
8179
</MudButton>
8280
}
8381
</ExpansionPanel>
@@ -95,7 +93,11 @@
9593
{
9694
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="ml-5 mr-5"/>
9795
}
98-
<MudButton OnClick="@this.GetERIMetadata" Variant="Variant.Filled" Color="Color.Info">Reload</MudButton>
99-
<MudButton OnClick="@this.Close" Variant="Variant.Filled">Close</MudButton>
96+
<MudButton OnClick="@this.GetERIMetadata" Variant="Variant.Filled" Color="Color.Info">
97+
@T("Reload")
98+
</MudButton>
99+
<MudButton OnClick="@this.Close" Variant="Variant.Filled">
100+
@T("Close")
101+
</MudButton>
100102
</DialogActions>
101103
</MudDialog>

0 commit comments

Comments
 (0)