Skip to content

SharePoint Online returns a title list in English instead of returning the title in the site language (Communication Site).  #7151

@sara-menoncin-revevol

Description

@sara-menoncin-revevol

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint CSOM

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

Code executed in Azure Function based on library PnP Sites Core v. 3.20.2004.
The problem can be reproduced with a sample code running on .NET Framework 4.6 and using library SharePoint CSOM v. 16.1.19927.12000 and v. 16.1.21312.12000.

Describe the bug / error

The error happens when Communication Sites are created in a different language than English.
When communication sites are created, all lists are created in the same language of the site (i.e. German or Dutch). The title especially is created in the site language.
When loading through the CSOM SharePoint library (v. 16.1.19927.12000 e v. 16.1.21312.12000.), SharePoint answers correctly providing the lists and their titles in the site language. Loading the single list with title provided by SharePoint works correctly.
The issue shows up whenever a new list is created after generating the site. In that case, when loading all the lists from SharePoint, the response query returns the lists and their titles in English, and not in the site language. If the list title provided is used later to load the single list, SharePoint will return an error “List <list_title> does not exist at site with URL ''.” as the list was previously created with a title in the site language.

Steps to reproduce

  1. Create a new Communication Site in a language different than English (i.e. German or Dutch).
  2. Execute the code provided below. There won't be any issue and the title of the list is in the site language.
  3. Add a custom list to the Communication Site created.
  4. Re-run the code below. The issue reported will show up as the return lists have the title in English and not in the site language.

`
using (var ctx = new ClientContext(""))
{
string password = "";
string username = "";

            System.Security.SecureString secureString = new System.Security.SecureString();
            password.ToCharArray().ToList().ForEach(a => secureString.AppendChar(a));

            ctx.Credentials = new SharePointOnlineCredentials(username, secureString);

            ListCollection targetlListCollection = ctx.Web.Lists;

            ctx.Web.Context.Load(targetlListCollection);
            ctx.Web.Context.ExecuteQuery();

            foreach (List list in targetlListCollection)
            {
                Console.WriteLine("List: " + list.Title + " Id: " + list.Id);

                var singleList = ctx.Web.Lists.GetByTitle(list.Title);

                ctx.Web.Context.Load(singleList);
                ctx.Web.Context.ExecuteQuery();
                Console.WriteLine("List was loaded: " + singleList.Title + " " + singleList.Id);
            }

}
`

Expected behavior

When adding a custom list, the pre-existing lists should return the title of the list in the language site and not English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:otherCategory: unknown (does not fit any other category)type:archive-old-issueIssues which are closed as tool old for active worktype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions