parameters:
  - name: includePseudoLoc
    type: boolean
    default: true

steps:
  - task: TouchdownBuildTask@1
    displayName: Download Localization Files
    inputs:
      teamId: 7105
      authId: $(TouchdownAppId)
      authKey: $(TouchdownAppKey)
      resourceFilePath: |
        src\cascadia\**\en-US\*.resw
      appendRelativeDir: true
      localizationTarget: false
      ${{ if eq(parameters.includePseudoLoc, true) }}:
        pseudoSetting: Included

  - pwsh: |-
      $Files = Get-ChildItem . -R -Filter 'Resources.resw' | ? FullName -Like '*en-US\*\Resources.resw'
      $Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore }
    displayName: Move Loc files into final locations

  - pwsh: |-
      ./build/scripts/Copy-ContextMenuResourcesToCascadiaPackage.ps1
    displayName: Copy the Context Menu Loc Resources to CascadiaPackage
