1

I'm on SP2013 on prem, using JSOM trying to retrieved localized version of term's path:

function getTranslation(refinerguid, language, termstorename, success, error){

    initTax(termstorename);         
    var found_term = termStore.getTerm(refinerguid);

    context.load(found_term);

    context.executeQueryAsync(
        function() {
            if(found_term){
            // success(found_term.get_pathOfTerm());  
              success(found_term.getPath(language).get_value());                                  
            }else{
              error("No translations found for " + refinerguid);
            }
        }, 
        function(){
          error("Translation Failed: "+ refinerguid.toString()+ " " + language.toString());
        }
    );
}

get_pathOfTerm() does return path in Default language, however getPath(lcid), supposed to return localized version, returns "0".

Was anybody able to figure this?

0

I suspect we need to explicitly load the Name and Labels

context.load(found_term,'Include(Name,Labels)');
  • Thank you for an idea, tried, did not help, was getting js error, without "include" it runs fine but returns "0". I can use term.get_pathOfTerm() to get full path but only in default language, – Victor Shostak Oct 23 '17 at 21:07
  • According to MS SP.Taxonomy.Term.getPath should return localized version... – Victor Shostak Oct 23 '17 at 21:14

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.