Thomas
Thomas

Reputation: 51

Can I change the application name in appxmanifest for a UWP app for different languages?

I know, I can add statements for different languages like this

<Resources>
    <Resource Language="en-us">
    <Resource Language="de-de">
</Resources>

But how can I give my app different names for different languages like "My US App" and my "My DE App"?

Thank you!

P.S. I found nothing in the net about this question. FYI, I don't use Visual Studio.

Upvotes: 1

Views: 125

Answers (1)

Roy Li - MSFT
Roy Li - MSFT

Reputation: 8681

This could be done using the localization mechanism of UWP. I noticed that you mentioned that you are not using VS. You might need to create so necessary files by yourself.

  1. Create a Strings folder inside the Project folder.
  2. Under Strings, create a new sub-folder and name it en-US. You could create other sub-folders like de-DE and fr-FR for different language.
  3. Under en-US, create a new Resources File (.resw) and name it "Resources.resw". The Resources File (.resw) is a template in the Visual Studio. You need to create such file by yourself.
  4. Add key-value data in the Resources.resw file for name. For example, the key is AppDisplayName and the value is En-ValueTitle.
  5. Open your manifest file, under Applications-uap:VisualElements node, find DisplayName element and change its value as ms-resource:AppDisplayName.

Now your app will use the corresponding AppDisplayName value you defined in the Resources.resw file as the app name when you set the different default language for your app.

Here the Resources.resw file opened via notepad:

<?xml version="1.0" encoding="utf-8"?>
<root>
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="AppDisplayName" xml:space="preserve">
    <value>En-ValueTitle</value>
  </data>
</root>

Upvotes: 0

Related Questions