-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localize AutoroutePart pattern #5626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs
Outdated
Show resolved
Hide resolved
FYI I tried this var orchardHelper = LiquidViewTemplate.Context.Services.GetService<IOrchardHelper>();
var contentItemCulture = await orchardHelper.GetContentCultureAsync(model.ContentItem);
LiquidViewTemplate.Context.CultureInfo = contentItemCulture; it doesn't work as expected |
I did the change, please check |
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs
Outdated
Show resolved
Hide resolved
Hope to check it ASAP, also I will check why the build is fail |
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutoroutePartHandler.cs
Outdated
Show resolved
Hide resolved
The code looks fine but it doesn't work. |
That's why I asked before when I used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work. I've tested this and the pipe t liquid filter doesn't translate anything. I don't know why but when I approved the changes it was working. I'm looking at the previous commits and the original commit from @hishamco and at that point it was working ; now not anymore.
LiquidTemplateView.Context.Culture doesn't affect the parsing of the Liquid template.
The only thing working so far is changing the CultureInfo.CurrentUICulture and moving it back to what it was afterward.
If you tried the original commit it works perfectly |
@Skrypt did you remove the permlink and add it again after the build? |
I'm using the refresh permalink checkbox option of the AutoroutePart. So I've set it to be updatable. I would be surprised that it makes any difference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't merge
I didn't know there's a checkbox, but when I remove and add the permlink again it works with my me at the first time before the other commits have been added |
@hishamco I tried also by clearing the permalink input of course. Does the same. |
Strange!! Could you please clean the solution and be sure that the translations are there, I can try this too if you want |
Translations are there don't worry about that. You can see it's working on a previous gif. |
I will try this again with m initial commit with |
Cleaned up the solution, same result. |
Nooo .. let me try it now |
Oops, I'm getting an exception whenever I create or edit content item .. I'm checking why this happing, I didn't change anything since then |
Why this is closed? I will test it again once I fixed the exception I got |
Fixes #5599