OfficeDev / Office-Addin-Scripts

A set of scripts and packages that are consumed in Office add-ins projects.
MIT License
152 stars 93 forks source link

office-addin-manifest export fails when localization file is referenced #822

Open atremel opened 6 months ago

atremel commented 6 months ago

Prerequisites

As per the docs (https://learn.microsoft.com/en-us/office/dev/add-ins/develop/localization?tabs=jsonmanifest), manifest localization can be done like so:

"localizationInfo": {
    "defaultLanguageTag": "en",
    "additionalLanguages": [
        {
            "languageTag": "de",
            "file": "de.json"
        }
    ]
},

the file de.json is in the manifest's directory, has the correct name and the correct contents as per the docs (see above).

Expected behavior

office-addin-manifest export should work. However, it fails. This is because the translation file is not included in the manifest.zip, see code, only the main json will get zipped:

https://github.com/OfficeDev/Office-Addin-Scripts/blob/0c210e9efbbf971900a7448eedc09ae8b884ccba/packages/office-addin-manifest/src/export.ts#L26

Current behavior

I get an error "File for languageTag de is missing from the package or path is pointed to a wrong file."