Mourad Louha
Mourad Louha

Reputation: 123

Localizing Manifest files for an Office JS Add-In

When localizing manifest files, according to Localization for Office Add-ins, the English default values can be overridden by adding a XML tag and specifying the country code. For example:

<Description DefaultValue="Hello world.">
    <Override Locale="de-de" Value="Hallo Welt."/>
</Description>`

Now this addresses only Germany (de-de). But in Austria (de-at) and in some regions of Switzerland (de-ch), people also speak German.

So, should I know create for each country code a separate line in my manifest files? For example:

<Description DefaultValue="Hello world.">
    <Override Locale="de-de" Value="Hallo Welt."/>
    <Override Locale="de-at" Value="Hallo Welt."/>
    <Override Locale="de-ch" Value="Hallo Welt."/>
</Description>`

Is there a better way to achieve this?

Or will my Add-In automatically use German strings for Austria and Switzerland be recognizing the first two letters, so that I don't need to specify the regions for Austria and Switzerland?

Thanks in advance.

Best, Mourad

Upvotes: 1

Views: 543

Answers (1)

Slava Ivanov
Slava Ivanov

Reputation: 6912

You are in the right direction, according to Localization for Office Add-ins the Locale attribute of the Override element have to follow to RFC 3066. This means you should be able to use "Primary-subtag" only, without specifying "Subtag" (in your case "de") and your code would looks like ...

<Description DefaultValue="Hello world.">
    <Override Locale="de" Value="Hallo Welt."/>
</Description>`

The fall back mechanism supposed to work according to RFC. Unfortunately, this looks like doesn't work in the real life for all clients. There are difference for desktop and OWA clients on how they consume Locale. Confirmed by Microsoft Outlook team work around is in this thread: Language Override entries that can work in Outlook 2016 and OWA. Indeed, if you work with yet another Office product (Excel, Word, etc.) you may have differences between online and desktop versions as well.

Upvotes: 1

Related Questions