OrchardCoreContrib/OrchardCoreContrib.PoExtractor

No output

vukasinpetrovic opened this issue · 10 comments

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.

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?

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

private static void ShowHelp()
{
Console.WriteLine("Usage:");
Console.WriteLine(" extractpo <INPUT_PATH> <OUTPUT_PATH> [options]");
Console.WriteLine();
Console.WriteLine("Arguments:");
Console.WriteLine(" <INPUT_PATH> The path to the input directory, all projects at the the path will be processed.");
Console.WriteLine(" <OUTPUT_PATH> The path to a directory where POT files will be generated.");
Console.WriteLine();
Console.WriteLine("Options:");
Console.WriteLine(" -l, --language <C#|VB> Specifies the code language to extracts translatable strings from.");
Console.WriteLine(" Default: C# language");
Console.WriteLine(" -t, --template <Razor|Liquid> Specifies the template engine to extract the translatable strings from.");
Console.WriteLine(" Default: Razor & Liquid templates");
}
}

@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

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

@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

"Controllers"

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

@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?

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

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!

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