You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在appxmanifest中为UWP应用设置多语言应用名称?

实现多语言应用名称的方案

1. 在语言资源字典中添加应用名称字符串

在你现有的<Resources>结构里,给每个语言的<Resource>节点添加对应的应用名称字符串资源,记得先引入system命名空间来支持字符串类型:

<Resources xmlns:system="clr-namespace:System;assembly=mscorlib">
    <Resource Language="en-us">
        <system:String x:Key="AppName">My US App</system:String>
        <!-- 这里可以添加其他英文资源 -->
    </Resource>
    <Resource Language="de-de">
        <system:String x:Key="AppName">My DE App</system:String>
        <!-- 这里可以添加其他德文资源 -->
    </Resource>
</Resources>

2. 在应用中引用该资源

针对WPF应用

直接在主窗口的Title属性中绑定这个动态资源,系统会根据当前系统的语言设置自动加载对应版本的名称:

<Window x:Class="YourAppNamespace.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{DynamicResource AppName}">
    <!-- 窗口内容 -->
</Window>

针对UWP应用

如果是UWP应用,需要修改Package.appxmanifest文件,将应用的显示名称替换为资源引用格式:

<Applications>
    <Application Id="App"
                 Executable="$targetnametoken$.exe"
                 EntryPoint="YourAppNamespace.App">
        <uap:VisualElements DisplayName="ms-resource:AppName"
                            <!-- 其他视觉配置项 -->
                            />
    </Application>
</Applications>

此时你需要确保每个语言的资源文件(如en-us/Resources.resw、de-de/Resources.resw)中都定义了AppName的键值对——如果是用统一的<Resources>字典文件,保持上面的写法即可,资源能被系统正确识别。


内容的提问来源于stack exchange,提问作者Thomas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 05:00:21