Localize Teams app manifest.json
Tags: localization, spfx, teams
Published: 2024-02-08 16:52:47

---
title: Localize Teams app manifest.json
published: true
date: 2024-02-07 10:00:00 UTC
tags: localization,SPFx,Teams
canonical_url: https://iamguidozam.blog/2024/02/07/localize-teams-app-manifest-json/
---

A while ago I’ve been asked to change the name of an SPFx Teams personal app and to localize it, I’ve never done something like that so I did my searches and luckily it came out that it’s a pretty easy thing to do!

To support localization in the manifest.json, like in my case to localize the application name in Teams, all you need to do is to specify in the Teams manifest.json what are the supported languages and also you have to create the files with the localization strings.

In the solution folder open the “teams” folder and in the manifest.json add the _localizationInfo_ property:

```
{ "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",..."localizationInfo": { "defaultLanguageTag": "en-us", "additionalLanguages": [{ "languageTag": "it", "file": "it.json" }] },...}
```

The block specify that the default language of your application is, in this example, the english language and that the additional supported language is the italian one. The default language is the one of the strings defined in the manifest.json.

In the additional languages you can see that the _file_ property contains the name of the file which contains the localized strings, that file must be in the same folder of the manifest.json file and must be included in the zip when packaging the application.

The localization file can be, following my italian example, like the following:

```
{"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.Localization.schema.json","name.short": "Esempio di localizzazione","name.full": "Esempio di localizzazione nome completo","description.short": "Esempio di localizzazione","description.full": "Esempio di localizzazione descrizione completa"}
```

Now, you are probably wondering: how do I map the properties in the it.json file with the ones in the manifest.json?

The answer is a simple one: _just use the path to each string that you want to localize_.

For example the short name in the schema is:

```
{...name: { short: "the short name here"...
```

So in the localization file the property to that value will be:

```
"name.short": "The localized short name"
```

Pay attention that if you have arrays of element you can access those using indexes. Say that you want to change the name of the second static tab present in your manifest.json, you can do the following:

```
"staticTabs[1].name": "Localized name",
```

#### The result

To write this article I’ve created a simple sample solution that supports, as default language, english and, as secondary language, italian. The result of the localization is the following:

![](https://iamguidozamcode.files.wordpress.com/2024/01/image.png?w=1024)
_For the english language._

![](https://iamguidozamcode.files.wordpress.com/2024/01/image-1.png?w=1024)
_For the italian language._

If you want to have a look at the code of this article you can go [here](https://github.com/GuidoZam/blog-samples/tree/main/web%20parts/TeamsManifestLocalization), if you want to have a look to a more detailed explanation you can have a look at the official documentation [here](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/apps-localization).

And this is all for today!

Hope this helps!