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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Issue with getting Lan...
Power Pages
Unanswered

Issue with getting Language Display Name using Power Pages Enhanced Data Model

(0) ShareShare
ReportReport
Posted on by 4

Hi All,

 

I'm trying to build language dropdown for a site that is using Enhanced Data model in Power pages. There are 2 languages English and French. On the portal I've modified the header code as follows so only the other language displays using the code below.

 

 

 

{% if website.languages.size > 1 %}
 {% for language in page.languages %}
 {% capture lang%}/{{language.code}}{%endcapture%}
 {% if request.url contains lang %}
 {% assign langCode = language.code %}
 {% else %}
 {% if user %}
 <a href="/{{ language.url_substitution }}">
 {% else %}
 <a href="/{{ language.code }}">
 {% endif %}
 <abbr title="{{ language.name }}">
 {{ language.code }}
 </abbr>
 <span>
 {{ language.name }} // I would like to use the value from display name here instead of name.
 </span>
 </a>
 {% endif %}
 {% endfor %}
{% endif %}

 

I've updated Display Name as Français but on the website, it shows French - France. 

 

 

PowePortalDev_1-1710182039760.pngPowePortalDev_0-1710182039594.png

 

 

 

 

Is there any liquid attribute in languages object that I can use to get the display name? Based on the Microsoft documentation I don't see an option to get display name.

 

Thanks

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi, is there any reason as to why you are building your custom code for the language dropdown?

    there is one available OOB in the Header Web Template:

    {% if website.languages.size > 1 %}
     <li class=' nav-item dropdown'>
     <a class=' nav-link dropdown-toggle' aria-roledescription='link' href='#' data-bs-toggle='dropdown' aria-label='{{ website.selected_language.name | escape }}' aria-haspopup='true' aria-expanded='false' title='{{ website.selected_language.name | escape }}'>
     <span class='drop_language'>{{ website.selected_language.name | escape }}</span>
     <span class='caret'></span>
     </a>
     {% include 'Languages Dropdown' %}
     </li>
     <li class=' nav-item divider-vertical' aria-hidden='true'></li>
  • PowePortalDev Profile Picture
    4 on at

    Thanks for getting back @OliverRodrigues 

     

    The reason for writing custom code is I don't want to show a dropdown containing both languages. I only need to show another available language that user can switch. Moreover, I'm using same Liquid tags that are used in Language Dropdown web template. The issue that I've is {{ language.name }} displays the actual language name and not the display name. 

     

  • RL-18031956-0 Profile Picture
    14 on at

    Did you manage to resolve this @PowePortalDev? Weird that the display name isn't available as an attribute in EDM.

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Apologies, I understand the issue now

    I think the "Display Name" is always ignored, that's my experience anyway

    Please take a look at this thread that I replied recently with the steps to change the "Name" of the Language:

    Language Displayname for language settings on webs... - Power Platform Community (microsoft.com)

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 38 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 37

#3
Fubar Profile Picture

Fubar 23 Super User 2026 Season 1

Last 30 days Overall leaderboard