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?

1 Answer 1

0

I suspect we need to explicitly load the Name and Labels

context.load(found_term,'Include(Name,Labels)');
2
  • 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, Oct 23, 2017 at 21:07
  • According to MS SP.Taxonomy.Term.getPath should return localized version... Oct 23, 2017 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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