web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Error switching langua...
Power Pages
Unanswered

Error switching language on power page when query string is present

(0) ShareShare
ReportReport
Posted on by 21

I've set up a power pages site from the blank template and done no customisation other than adding two additional languages.

 

I have a scenario where a query string parameter needs to be appended to the site/page address.

 

This all works fine except that when switching from one language to another using the switcher drop down on the site, it will url encode the query string, including the ? mark, which then results in an ASP.NET error. I disabled custom errors on the site to show the full exception message.

 

PDL_1-1699240921011.png

 

PDL_2-1699240946851.png

 

 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at
    • did you create the localized Web Page for the additional languages? 
    • is this working without the additional parameter?
    • does the URL look right when you just hover over the additional language? 
  • PDL Profile Picture
    21 on at

    Yep it's all working without the additional query parameter.

     

    When hovering on the link, you can see its encoded there. The rendered link in devtools shown

     

    PDL_0-1699308874953.png

     

    Feels like I may have to hack it with some javascript until this gets fixed.

  • LucasRoss232 Profile Picture
    6 on at

    This seems to be a recently introduced issue with the language.url_substitution liquid object. I've been able to fix it in a hacky way using the language.code and request.url liquid objects (removing the domain from request.url):

     

     

    href="/{{ language.code }}{{ request.url | remove: "domain/en-US" | remove: "domain/fr-FR" }}

     

    This seems to return the correct URL for language switching.

     

    Correction: This didn't actually work. Had to go with some Javascript function to change the href.

  • Verified answer
    PDL Profile Picture
    21 on at

    I raised a ticket with MS and they confirmed a recent change has resulted in this default behavior. 

     

    The good news is that it can be switched off with a portal site setting called Site/EnableLanguageDropUrlEncoding.

     

    Set to false to switch off the encoding.

     

    PDL_0-1699578840016.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard