Skip to content

Commit 039f0f0

Browse files
authored
Merge pull request #771 from PHOENIXCONTACT/fix/localizations
Harmonized localization and fixed several issues and misconfigurations
2 parents f5cbb8a + a521a41 commit 039f0f0

File tree

189 files changed

+3120
-4931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+3120
-4931
lines changed

docs/migrations/v8_to_v10.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The simulator module has also been renamed, and its namespace and package id hav
2121
- TcpListenerConfig.IpAdress -> TcpListenerConfig.IpAddress
2222
- ResourceRelationType.CurrentExchangablePart -> ResourceRelationType.CurrentExchangeablePart
2323
- ResourceRelationType.PossibleExchangablePart -> ResourceRelationType.PossibleExchangeablePart
24+
- MqttDriver.BrokerURL -> MqttDriver.BrokerUrl
2425

2526
## Reduction of interfaces
2627

src/Moryx.AbstractionLayer.Products.Endpoints/Moryx.AbstractionLayer.Products.Endpoints.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,19 @@
1717
<ProjectReference Include="..\Moryx.Runtime\Moryx.Runtime.csproj" />
1818
</ItemGroup>
1919

20+
<ItemGroup>
21+
<EmbeddedResource Update="Properties\Strings.resx">
22+
<Generator>PublicResXFileCodeGenerator</Generator>
23+
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
24+
</EmbeddedResource>
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<Compile Update="Properties\Strings.Designer.cs">
29+
<DesignTime>True</DesignTime>
30+
<AutoGen>True</AutoGen>
31+
<DependentUpon>Strings.resx</DependentUpon>
32+
</Compile>
33+
</ItemGroup>
34+
2035
</Project>

src/Moryx.AbstractionLayer.Products.Endpoints/ProductManagementController.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
using Moryx.Serialization;
99
using System.Net;
1010
using Microsoft.AspNetCore.Authorization;
11+
using Moryx.AbstractionLayer.Products.Endpoints.Properties;
12+
using Moryx.AbstractionLayer.Products.Endpoints.Properties;
1113
using Moryx.Configuration;
1214
using Moryx.Asp.Extensions;
13-
using Moryx.AbstractionLayer.Properties;
1415
using Moryx.Runtime.Modules;
1516

1617
namespace Moryx.AbstractionLayer.Products.Endpoints
@@ -117,7 +118,7 @@ public ActionResult<long> SaveType(ProductModel newTypeModel)
117118
var type = ReflectionTool.GetPublicClasses<ProductType>(t => t.Name == newTypeModel.Type)
118119
.FirstOrDefault();
119120
if (type == null)
120-
return NotFound(new MoryxExceptionResponse { Title = Strings.TYPE_NOT_FOUND });
121+
return NotFound(new MoryxExceptionResponse { Title = Strings.ProductManagementController_TypeNotFound });
121122
var productType = (ProductType)Activator.CreateInstance(type);
122123
var newType = _productConverter.ConvertProductBack(newTypeModel, productType);
123124
return _productManagement.SaveType(newType);
@@ -147,7 +148,7 @@ public ActionResult<ProductModel[]> GetTypeByIdentity(string identity = null)
147148
var productIdentity = new ProductIdentity(identityArray[0], Convert.ToInt16(identityArray[1]));
148149
var productType = _productManagement.LoadType(productIdentity);
149150
if (productType == null)
150-
return NotFound(new MoryxExceptionResponse { Title = Strings.TYPE_NOT_FOUND });
151+
return NotFound(new MoryxExceptionResponse { Title = Strings.ProductManagementController_TypeNotFound });
151152
return new ProductModel[] { _productConverter.ConvertProduct(productType, false) };
152153
}
153154

@@ -184,7 +185,7 @@ public ActionResult<ProductModel> GetTypeById(long id)
184185
{
185186
}
186187
if (productType == null)
187-
return NotFound(new MoryxExceptionResponse { Title = Strings.TYPE_NOT_FOUND });
188+
return NotFound(new MoryxExceptionResponse { Title = Strings.ProductManagementController_TypeNotFound });
188189
return _productConverter.ConvertProduct(productType, false);
189190
}
190191

@@ -197,7 +198,7 @@ public ActionResult<bool> DeleteType(long id)
197198
{
198199
var result = _productManagement.DeleteProduct(id);
199200
if (!result)
200-
return NotFound(new MoryxExceptionResponse { Title = Strings.TYPE_NOT_FOUND });
201+
return NotFound(new MoryxExceptionResponse { Title = Strings.ProductManagementController_TypeNotFound });
201202
return result;
202203
}
203204

@@ -278,7 +279,7 @@ public ActionResult<ProductInstanceModel> GetInstance(long id)
278279
return BadRequest($"Id was 0");
279280
var productInstance = _productManagement.GetInstance(id);
280281
if (productInstance == null)
281-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductNotFoundException_Message, id) });
282+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductManagementController_InstanceNotFound, id) });
282283
return _productConverter.ConvertProductInstance(productInstance);
283284
}
284285

@@ -321,7 +322,7 @@ public ActionResult SaveInstance(ProductInstanceModel instanceModel)
321322
var type = ReflectionTool.GetPublicClasses<ProductType>(t => t.Name == instanceModel.Type)
322323
.FirstOrDefault();
323324
if (type == null)
324-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductNotFoundException_Message, "null") });
325+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductManagementController_InstanceNotFound, "null") });
325326
var productType = (ProductType)Activator.CreateInstance(type);
326327
var productInstance = _productConverter.ConvertProductInstanceBack(instanceModel, productType);
327328
_productManagement.SaveInstance(productInstance);
@@ -342,7 +343,7 @@ public ActionResult<RecipeModel> GetRecipe(long id)
342343
return BadRequest($"Id was 0");
343344
var recipe = _productManagement.LoadRecipe(id);
344345
if (recipe == null)
345-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.RecipeNotFoundException_Message, id) });
346+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductManagementController_RecipeNotFound, id) });
346347
return _productConverter.ConvertRecipeV2(recipe);
347348
}
348349

@@ -359,7 +360,7 @@ public ActionResult<long> SaveRecipe(RecipeModel recipe)
359360
var type = ReflectionTool.GetPublicClasses<IProductRecipe>(t => t.Name == recipe.Type)
360361
.FirstOrDefault();
361362
if (type == null)
362-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.RecipeNotFoundException_Message, "null") });
363+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.ProductManagementController_RecipeNotFound, "null") });
363364
var productRecipe = (IProductRecipe)Activator.CreateInstance(type);
364365
return _productManagement.SaveRecipe(_productConverter.ConvertRecipeBack(recipe, productRecipe, null));
365366
}

src/Moryx.AbstractionLayer.Products.Endpoints/Properties/Strings.Designer.cs

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<root>
2+
<resheader name="resmimetype">
3+
<value>text/microsoft-resx</value>
4+
</resheader>
5+
<resheader name="version">
6+
<value>1.3</value>
7+
</resheader>
8+
<resheader name="reader">
9+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
10+
</resheader>
11+
<resheader name="writer">
12+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
13+
</resheader>
14+
<data name="ProductManagementController_TypeNotFound" xml:space="preserve">
15+
<value>Der angegebene Typ konnte nicht gefunden werden.</value>
16+
</data>
17+
<data name="WorkplanController_WorkplanNotFound" xml:space="preserve">
18+
<value>Arbeitsplan nicht gefunden für id: {0}</value>
19+
</data>
20+
<data name="ProductManagementController_InstanceNotFound" xml:space="preserve">
21+
<value>Produkt mit der Id '{0}' wurde nicht gefunden!</value>
22+
</data>
23+
<data name="ProductManagementController_RecipeNotFound" xml:space="preserve">
24+
<value>Rezept mit der Id '{0}' wurde nicht gefunden!</value>
25+
</data>
26+
</root>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<root>
2+
<resheader name="resmimetype">
3+
<value>text/microsoft-resx</value>
4+
</resheader>
5+
<resheader name="version">
6+
<value>1.3</value>
7+
</resheader>
8+
<resheader name="reader">
9+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
10+
</resheader>
11+
<resheader name="writer">
12+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
13+
</resheader>
14+
<data name="ProductManagementController_TypeNotFound" xml:space="preserve">
15+
<value>Il tipo indicato non è stato trovato.</value>
16+
</data>
17+
<data name="WorkplanController_WorkplanNotFound" xml:space="preserve">
18+
<value>Piano di lavoro non trovato per l'id: {0}</value>
19+
</data>
20+
<data name="ProductManagementController_InstanceNotFound" xml:space="preserve">
21+
<value>Prodotto non trovato per id: {0}</value>
22+
</data>
23+
</root>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<root>
4+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
5+
<xsd:element name="root" msdata:IsDataSet="true">
6+
7+
</xsd:element>
8+
</xsd:schema>
9+
<resheader name="resmimetype">
10+
<value>text/microsoft-resx</value>
11+
</resheader>
12+
<resheader name="version">
13+
<value>1.3</value>
14+
</resheader>
15+
<resheader name="reader">
16+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
17+
</resheader>
18+
<resheader name="writer">
19+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
20+
</resheader>
21+
<data name="ProductManagementController_TypeNotFound" xml:space="preserve">
22+
<value>The given type was not found.</value>
23+
</data>
24+
<data name="WorkplanController_WorkplanNotFound" xml:space="preserve">
25+
<value>Workplan not found for id: {0}</value>
26+
</data>
27+
<data name="ProductManagementController_InstanceNotFound" xml:space="preserve">
28+
<value>Product not found for id: {0}</value>
29+
</data>
30+
<data name="ProductManagementController_RecipeNotFound" xml:space="preserve">
31+
<value>Recipe with id '{0}' not found!</value>
32+
</data>
33+
</root>

src/Moryx.AbstractionLayer.Products.Endpoints/WorkplanController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Microsoft.AspNetCore.Authorization;
55
using Microsoft.AspNetCore.Http;
66
using Microsoft.AspNetCore.Mvc;
7-
using Moryx.AbstractionLayer.Properties;
7+
using Moryx.AbstractionLayer.Products.Endpoints.Properties;
88
using Moryx.Asp.Extensions;
99
using Moryx.Workplans;
1010

@@ -57,7 +57,7 @@ public ActionResult<WorkplanModel[]> GetVersions(long id)
5757
return BadRequest($"Workplan id was 0");
5858
var versions = _workplans.LoadVersions(id);
5959
if (versions == null)
60-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.WORKPLAN_NOT_FOUND, id) });
60+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.WorkplanController_WorkplanNotFound, id) });
6161
var model = new List<WorkplanModel>();
6262
foreach (var v in versions)
6363
{
@@ -78,7 +78,7 @@ public ActionResult<WorkplanModel> GetWorkplan(long id)
7878
return BadRequest($"Workplan id was 0");
7979
var workplan = _workplans.LoadWorkplan(id);
8080
if (workplan == null)
81-
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.WORKPLAN_NOT_FOUND, id) });
81+
return NotFound(new MoryxExceptionResponse { Title = string.Format(Strings.WorkplanController_WorkplanNotFound, id) });
8282
return ProductConverter.ConvertWorkplan(workplan);
8383
}
8484

src/Moryx.AbstractionLayer.Resources.Endpoints/Moryx.AbstractionLayer.Resources.Endpoints.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,19 @@
1818
<ProjectReference Include="..\Moryx.Runtime\Moryx.Runtime.csproj" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<EmbeddedResource Update="Properties\Strings.resx">
23+
<Generator>PublicResXFileCodeGenerator</Generator>
24+
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
25+
</EmbeddedResource>
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<Compile Update="Properties\Strings.Designer.cs">
30+
<DesignTime>True</DesignTime>
31+
<AutoGen>True</AutoGen>
32+
<DependentUpon>Strings.resx</DependentUpon>
33+
</Compile>
34+
</ItemGroup>
35+
2136
</Project>

src/Moryx.AbstractionLayer.Resources.Endpoints/Properties/Strings.Designer.cs

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)