How to retrieve the display language and default language set in SharePoint using Graph API.

Ayase Morita 160 Reputation points
2025-03-03T05:20:25.74+00:00

Is there a way to retrieve the display language and default language set in SharePoint using Graph API?

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,386 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xyza Xue_MSFT 29,181 Reputation points Microsoft External Staff
    2025-03-03T08:02:16.51+00:00

    Hi @Ayase Morita ,

    After my internal and external searches, there is currently no way to retrieve the display language and default language in SharePoint Online using Graph API or other methods.

    It is possible to retrieve the current site language in sharepoint server using javascript, but javascript is not available in sharepoint online.

    You can only view it through the sharepoint UI method to Check Site Language:

    • Navigate to your SharePoint site.
    • Click on the Settings gear icon in the top-right corner.
    • Select Site information.
    • Click on View all site settings.
    • Under the Site Administration section, click on Language settings. Here, you can see the default language and any alternate languages enabled for the site.
    • User's image

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Martin Laplante 326 Reputation points
    2025-03-04T14:17:14.5166667+00:00

    For the question as phrased there is no direct way that I know of. The problem is that there are many factors involved in setting a particular user's current display language on a particular site. It has to be one of the base or alternate languages of the site. Then it will depend on an exact or approximate match between one of the list of the user's preferred display languages from their profile and the site languages. If the user has no matching preferred language, then it is based on their browser's list of display languages, which Graph does not have access to, and if that is not set then it will be the base language of the site.

    You can't retrieve the preferred display language from the user profile. You can retrieve a similar property from the user account settings, which is different.

    https://learn.microsoft.com/en-us/graph/api/regionalandlanguagesettings-get?view=graph-rest-beta&tabs=http

    When you change the account language setting it propagates to the profile language, but not the other way around. If the user has changed their profile language it won't be reflected in the account language. So it will be right a lot of the time but no guarantees.

    One trick is to retrieve the display name of a list column that you know is localized, using

    https://graph.microsoft.com/v1.0/sites/{sit-id}/lists/{list-id}?expand=columns

    That will return both "name" (internal name) and displayName, and the display name may be different in different languages and reflect the language of the logged-in user.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.