Skip to content

Add liquid processor configuration file option to support custom inline and block tags#125

Open
safinilnur wants to merge 3 commits into
OrchardCoreContrib:mainfrom
safinilnur:feature/liquid-processor-configuration-file
Open

Add liquid processor configuration file option to support custom inline and block tags#125
safinilnur wants to merge 3 commits into
OrchardCoreContrib:mainfrom
safinilnur:feature/liquid-processor-configuration-file

Conversation

@safinilnur

@safinilnur safinilnur commented May 26, 2026

Copy link
Copy Markdown

Issue: #124

  • --liquid-processor-configuration {path to JSON file}

Specifies the path to a JSON file with LiquidProcessorConfiguration, containing InlineTags and BlockTags arrays used to register custom Liquid tags during parsing.

Example:

{
  "InlineTags": ["resources", "link", "script", "style"],
  "BlockTags": ["scriptblock", "styleblock"]
}

@hishamco

Copy link
Copy Markdown
Member

Before I dig into the details, does that mean all the custom tags and filters in OC are not recognized? If yes, give some examples that I can test later

@safinilnur

Copy link
Copy Markdown
Author

Before I dig into the details, does that mean all the custom tags and filters in OC are not recognized? If yes, give some examples that I can test later

yes, all OC tags are not recognized. Only default fluid constructions are parsed by default.

The sample: if liquid contains an OC tag like {% style name:"Step-PersonalInfo", src:"~/GuidedFlow-Step-PersonalInfo.css" %} - the tool will silently fail for this liquid file. Translations from this file will be not exported. If we use this extension and define it in InlineBlocks - all tranlsations will be extracted properly.

In my custom project with 40 OC modules I accidentally notices some missing translations, which were caused by this. To solve the problem, I checked, which OC and custom tags were used (found only 6). So for a big project it will be easy to note the tags-related errors from the console and to add LiquidProcessorConfiguration file to fix them.

@safinilnur

Copy link
Copy Markdown
Author

What I was thinking about - how OrchardCore created pot files for all their OC modules. As they had to fix also this problem, if they used poextractor without any modifications for that.

@hishamco

Copy link
Copy Markdown
Member

So let's think about pros & cons for your proposal, coz pointing to an external file might be risky, @sebastienros, your thought

@safinilnur

Copy link
Copy Markdown
Author

@MichaelPetrinolis FYI

Comment thread src/OrchardCoreContrib.PoExtractor.Liquid/LiquidProjectProcessor.cs Outdated
Comment thread src/OrchardCoreContrib.PoExtractor.Liquid/LiquidProjectProcessor.cs Outdated
}
else
{
Console.WriteLine($"Error: {errors}, file: {file}");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger instead?

@safinilnur safinilnur May 28, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hishamco I'm not sure we shold use logger instead. I don't see the reason why we should do this. Also it will require changes in several files, so maybe, if we will do that, lets do in a separate PR then?

But I can do this, just, please, approve that we want to bring logger in this PR

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean that we don't use logger in the tool right now and the code which introduces a logger will mix with the changes I did (we will get ditry git commit history)

Comment thread src/OrchardCoreContrib.PoExtractor/Program.cs Outdated
@hishamco

Copy link
Copy Markdown
Member

Just waiting for Seb's feedback,

@Skrypt your input

@safinilnur

Copy link
Copy Markdown
Author

@hishamco we have started to use this extension fix on our live environement, looking forward to complete and merge this fix here

@hishamco

Copy link
Copy Markdown
Member

I will try to let someone bring this into the steering meeting

@hishamco

Copy link
Copy Markdown
Member

Maybe it's related to OrchardCMS/OrchardCore#19394, so please hold on, I will check after the related issue is fixed

@hishamco

Copy link
Copy Markdown
Member

@safinilnur, the related PR has been merged. I will update to OC 3. Please recheck, then let me know if the issue is fixed. Otherwise, we might consider this PR with some modifications until we fix the original issue

@hishamco

Copy link
Copy Markdown
Member

Now you can use the nightly build to verify before we publish a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants