Skip to content

Commit

Permalink
Give up on that strat
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Sep 8, 2024
1 parent f91b5b0 commit a4766d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GangsTest/TestLocale/LocalFileLocalizerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public class LocalFileLocalizerFactory : IStringLocalizerFactory {
private readonly string path;

public LocalFileLocalizerFactory() {
var current = Directory.GetCurrentDirectory().Split("GangsTest")[^2];
var parent = Directory.GetParent(current);
if (parent is null)
throw new DirectoryNotFoundException("Could not find parent directory");
path = Path.Combine(parent.FullName, "Gangs", "lang");
Console.WriteLine(path);
// Lang folder is in the root of the project
// keep moving up until we find it
var current = Directory.GetCurrentDirectory();
while (!Directory.Exists(Path.Combine(current, "lang")))
current = Path.GetFullPath(Path.Combine(current, ".."));
path = Path.Combine(current, "lang");
}

public IStringLocalizer Create(Type resourceSource) {
Expand Down
File renamed without changes.

0 comments on commit a4766d6

Please sign in to comment.