pnp / pnp/powershell

[BUG] Import-PnPTermGroupFromXml creates terms with incorrect translations

Open
#3,603 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Reporting an Issue or Missing Feature

After using Export-PnPTermGroupFromXml, I import the group using Import-PnPTermGroupFromXml. This results in the terms having the English instead of the Dutch translation.

Expected behavior

Create the terms with the correct translation

Actual behavior

The Dutch translation contains English
After import

Steps to reproduce behavior
  1. My tenant is in Dutch. I create a term called "Test term NL" and give it an English translation "Test term EN"
    Original

  2. I Export the group using Export-PnPTermGroupFromXml. The name of the term element is the English name (no idea of this is expected behavior). It does list the translations correctly.
    xml

  3. I delete the Test termset

  4. I import the group using Import-PnPTermGroupFromXml. This results in the term being recreated but with the English text showing up as Dutch.
    After import

What I think happens

What I think causes this bug is:

  1. The term doesn't exist so it is created. It creates it with the value in the "Name" attribute that is in English, but since the tenant is in Dutch it is now wrongly labeled as Dutch.
  2. It goes on to create the lables, the fist one is English. This lable is new so it is created.
  3. Next is the Dutch label, this label already exists so it is skipped...

And now we have English in both lables and lose the Dutch label!

What is the version of the Cmdlet module you are running?

PnP.PowerShell 2.2.0

Which operating system/environment are you running PnP PowerShell on?
  • Windows

  • Linux

  • MacOS

  • Azure Cloud Shell

  • Azure Functions

  • Other : please specify

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Import-PnPTermGroupFromXml and Export-PnPTermGroupFromXml cmdlets, reproduce the issue using the supplied Dutch and English term translations, and inspect how the XML Name and translation labels are processed. Done means importing the exported group preserves the Dutch label as Dutch rather than displaying the English text for both labels.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
49/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.