OrchardCoreContrib / OrchardCoreContrib.PoExtractor

Extracts localizable strings from .cs, .vb, .cshtml and .liquid files into POT files
MIT License
48 stars 35 forks source link

No output #75

Closed vukasinpetrovic closed 1 year ago

vukasinpetrovic commented 1 year ago

I just tried the tool, but it gives no output, output folder is empty. Version installed is 1.0.1. This is the command called:

/Users/apple/.dotnet/tools/extractpo '/Users/apple/Documents/Projects/Web/Skenit/Skenit.API/Controllers/V1' '/Users/apple/Documents/Projects/Web/Skenit/Skenit.API/generated_po'

Path to extractpo is done manually as dotnet command would not find it after installing globally for some reason. If I miss the path, ie. input path is wrong, tool gives me output of instructions how to use it.

hishamco commented 1 year ago

Hi, @vukasinpetrovic I need to know if the issue is in your path and if you want the tool gives you the output instructions on how to use it. Or is there something else?

hishamco commented 1 year ago

The tool already shows the usage, have a look to the following snippet

https://github.com/OrchardCoreContrib/OrchardCoreContrib.PoExtractor/blob/354190e48f2d6edbce07b8e8e015d4c1c6a096e0/src/OrchardCoreContrib.PoExtractor/Program.cs#L171-L186

vukasinpetrovic commented 1 year ago

@hishamco If I set path that does not exist for input path argument, tool prints out usage text. See image below. image

If I add correct paths as the arguments, command looks like it executes right, but it generates no output, folder is empty. image

vukasinpetrovic commented 1 year ago

@hishamco Tool can extract string from Controllers (c# classes), or just razor views?

hishamco commented 1 year ago

@hishamco Tool can extract string from Controllers (c# classes), or just razor views?

It should extract everything, FYI you can select the language & template to help the tool what should be extracted

hishamco commented 1 year ago

"Controllers"

Try to point to your solution path, not the Controllers folder, also no need to provide the tool path, just use extractpo

vukasinpetrovic commented 1 year ago

@hishamco Ok, it had to be the root of the project and most importantly localizer has to be named "S" inside the code. Why is that mandatory as when I use Orchardcore I can name my variable whatever I want and it worked fine?

hishamco commented 1 year ago

Regarding the naming, we are using S, H, and T in Orchard Core by default, but we might add an option for this tool to allow you to customize these variables

vukasinpetrovic commented 1 year ago

That option would be amazing as many of us are used to naming localizer object simply "_localizer". Regardless of that, tool works fine. Thank you!

hishamco commented 1 year ago

Could you please file an issue suggesting that, also you can push a PR if you want to :)