-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from AndrewKeepCoding/v2.2.0
V2.2.0
- Loading branch information
Showing
5 changed files
with
58 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<LUTConfig Version="1.0"> | ||
<Repository /> | ||
<ParallelBuilds>true</ParallelBuilds> | ||
<ParallelTestRuns>true</ParallelTestRuns> | ||
<TestCaseTimeout>180000</TestCaseTimeout> | ||
</LUTConfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Microsoft.Windows.ApplicationModel.Resources; | ||
using System.Collections.Generic; | ||
|
||
namespace WinUI3Localizer; | ||
|
||
internal class PriResourceReaderFactory | ||
{ | ||
private readonly Dictionary<string, PriResourceReader> readers = new(); | ||
|
||
internal PriResourceReader GetPriResourceReader(string? priFile) | ||
{ | ||
string normalizedFilePath = string.Empty; | ||
|
||
if (string.IsNullOrEmpty(priFile) is false) | ||
{ | ||
normalizedFilePath = System.IO.Path.GetFullPath(priFile); | ||
} | ||
|
||
if (this.readers.TryGetValue(normalizedFilePath, out PriResourceReader? reader) is false) | ||
{ | ||
ResourceManager manager; | ||
|
||
if (string.IsNullOrEmpty(normalizedFilePath) is false) | ||
{ | ||
manager = new ResourceManager(normalizedFilePath); | ||
} | ||
else | ||
{ | ||
manager = new ResourceManager(); | ||
} | ||
|
||
reader = new PriResourceReader(manager); | ||
this.readers[normalizedFilePath] = reader; | ||
} | ||
|
||
return reader; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters