0

Is it possible to get a TermCollection by a specific language? Something like:

TermCollection termcollection = termset.Terms.ByLanguage("de-DE");
0

try this code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Taxonomy;
using System.Collections.ObjectModel;

namespace ManagedMetadataClient
{
    class Program
    {
        static void Main(string[] args)
        {
            // ClienContext - Get the context for the SharePoint Site 
            // SharePoint site URL - http://c4968397007/
            ClientContext clientContext = new ClientContext("http://c4968397007/");

            // Get the TaxonomySession
            TaxonomySession taxonomySession = TaxonomySession.GetTaxonomySession(clientContext);

            // Get the term store by Name
            TermStore termStore = taxonomySession.TermStores.GetByName("MMS");

            // Get the term group by Name
            TermGroup termGroup = termStore.Groups.GetByName("SP2013");

            // Get the term set by Name
            TermSet termSet = termGroup.TermSets.GetByName("BCS");

            // Get the term by Name 
            Term term = termSet.Terms.GetByName("External Content Type");

            // int variable - LCID
            int lcid = 1033;

            // Get all the labels for English language
            LabelCollection labelColl = term.GetAllLabels(lcid);

            clientContext.Load(labelColl);

            // Execute the query to the server
            clientContext.ExecuteQuery();

            // Loop through all the labels
            foreach (Label label in labelColl)
            {
                // Display the label value
                Console.WriteLine(label.Value);
            }
            Console.ReadLine();   
        }
    }
}

How to get all the term labels for a particular language using Client Side Object Model in SharePoint 2013

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.