Pnpjs: Taxonomy: Obtaining description info on terms for other languages/lcid?

Created on 16 Oct 2018  路  11Comments  路  Source: pnp/pnpjs

Category

  • [ ] Enhancement
  • [ ] Bug
  • [x] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [1.2.3]

Please specify what version(s) of SharePoint you are targeting: [SPO]

Question

@pnp/sp-taxonomy query:

Having some trouble finding how to get term description information for another language/lcid.

I'm able to access other language labels successfully from a term, but as for description I cannot seem to get description data for another lcid.

Is this not supported currently, or can someone point me in the correct direction?

code complete enhancement

Most helpful comment

Just created #301. If you get a chance @Kesudan please pull that code and see if the new method works for you as expected. Updated docs here

All 11 comments

In the docs you can see how to load terms. You can control what terms come back by using the label match information in your query.

@patrick-rodgers
I believe @Kesudan wants to get the description in other lcids, not filter terms by labels :)

I don't believe there is support right now for getting the description of other LCIDs @Kesudan

On term there is an setDescription, but not a getDescription.
the term also has term.Description (default language Description).

In old servercode atleast there is two methods:
GetDescription gets the description in the default LCID
GetDescription(LCID) gets the description of the supplied LCID.

@patrick-rodgers was thinking something. But I havn't gotten it to work. Any ideas?
In terms.ts

public get getDescriptionByLcid(lcid: number): IDescription {
            return this.getChild(Term, "GetDescription", MethodParams.build()
            .number(lcid));

    }

When using getTerms() and setting the LCID in the label match info not bring back all the properties for that term in that lcid? If not than I am wrong on how that works.

If there are methods missing and available we can def look at adding them.

I might be wrong aswell, gonna have a quick look

Yeah. Tried to have one Label named TermOne in English, and a TermEtt label in Swedish.

Different labelmatchinginfo targeting both of them still retrieves the same data.
So the term.Description is in the Default language.

Ah, my bad then, I thought it worked differently. So then I guess we need to add some methods to help here.

Yeah sorry I couldn't help out with any of the methods right now. Lack of time and understanding how it works :)

Working on this but actually found an issue with gulp serve so that is taking a bit of time to ensure that is working (unrelated to this issue) but that's the delay.

Really would like to see how you solved it later 馃榾馃憤

Just created #301. If you get a chance @Kesudan please pull that code and see if the new method works for you as expected. Updated docs here

@patrick-rodgers Perfect! Yes, that works fine :) Thanks for the speedy fix!

Was this page helpful?
0 / 5 - 0 ratings