学习008-02-04-08 Localize UI Elements(本地化UI元素)

news2024/9/8 23:56:14

Localize UI Elements(本地化UI元素)

This lesson explains how to localize an XAF application. It describes how to translate UI elements into German and create a multi-language application.
本课介绍如何本地化XAF应用程序。它描述了如何将UI元素翻译成德语并创建多语言应用程序。

Note
For more information on localization, review the following topics:
有关本地化的更多信息,请查看以下主题:

  • How to: Localize an XAF .NET Application
  • Localization Basics

Step-by-Step Instructions(分步说明)

1.Add the following packages to the MySolution.Blazor.Server and MySolution.Win projects:
将以下包添加到MySolutions. Blazor.Server并MySolution.Win项目:
在这里插入图片描述

The packages are available only for the following languages: German (de), Spanish (es), and Japanese (ja). For other languages, use the Localization Service to download satellite assemblies. See the Localize Standard XAF Modules and DevExpress Controls Used in an Application topic for more information on how to use this service to localize XAF modules.
这些软件包仅适用于以下语言:德语(de)、西班牙语(es)和日语(ja)。对于其他语言,请使用本地化服务下载附属程序集。有关如何使用此服务本地化XAF模块的更多信息,请参阅应用程序主题中使用的本地化标准XAF模块和DevExpress控件。

2.In the MySolution.Blazor.Server project, open the appsettings.json file. Add the German language to the DevExpress:ExpressApp:Languages section and enable the runtime language switcher. You should always use the fully qualified language name that includes the country code (for example, de-DE instead of de):
在MySolutions. Blazor.Server项目中,打开appset.json文件。将德语添加到DevExpress:ExpressApp:语言部分并启用运行时语言切换器。您应该始终使用包含国家代码的完全限定语言名称(例如,de-DE而不是de):

appsettings.json {
    // ...
    "DevExpress": {
        "ExpressApp": {
            "Languages": "en-US;de-DE",
            "ShowLanguageSwitcher": true,  
             // ...
        }
    }
} 

See the Current Culture in XAF ASP.NET Core Blazor Applications help section for more information on how an XAF ASP.NET Core Blazor application determines the default language.
有关XAF ASP.NETCore Blazor应用程序如何确定默认语言的更多信息,请参阅XAF ASP.NETCore Blazor应用程序中的当前区域性帮助部分。

3.Open the Model.DesignedDiffs.xafml file in the Model Editor. Focus the MySolution node and click Languages Manager… in the Language combo box on the Model Editor Toolbar.
在模型编辑器中打开Model. DesignedDiffs.xafml文件。聚焦MySolution节点,然后在模型编辑器工具栏的语言组合框中单击语言管理器…。
在这里插入图片描述

4.Add the target language in the invoked dialog and click OK.
在调用的对话框中添加目标语言,然后单击确定。
在这里插入图片描述

Save the model changes but don’t restart Visual Studio as the Languages Manager suggests. When you restart Visual Studio, the Model Editor loads the localized property value from the assemblies that you added previously and they become available at design time. For the purposes of this tutorial, these values aren’t necessary.
保存模型更改,但不要按照语言管理器的建议重新启动Visual Studio。重新启动Visual Studio时,模型编辑器会从您之前添加的程序集加载本地化属性值,这些值在设计时可用。出于本教程的目的,这些值不是必需的。

5.In the Solution Explorer, right-click the Model.DesignedDiffs.Localization.de-DE.xafml file and open its Properties window. Make sure that the Build Action field is set to Embedded resource.
在解决方案资源管理器中,右键单击Model.DesignedDiffs.Localization.de-DE. xafml文件并打开其属性窗口。确保构建操作字段设置为嵌入式资源。

6.Open the Model.DesignedDiffs.xafml file in the Model Editor. Select the newly added language in the Language combo box.
在模型编辑器中打开Model. DesignedDiffs.xafml文件。在语言组合框中选择新添加的语言。
在这里插入图片描述

7.The localization packages translate standard strings/messages used in XAF. You also need to translate the strings that are unique to your current application (such as object or property names). To do that, locate properties denoted by the “globe” glyph in all the nodes and child nodes and assign a German translation to them. For the purposes of this tutorial, translate the Employees navigation item to Angestellte:
本地化包翻译XAF中使用的标准字符串/消息。您还需要翻译当前应用程序独有的字符串(例如对象或属性名称)。为此,请在所有节点和子节点中找到由“全局”字形表示的属性,并为它们分配德语翻译。出于本教程的目的,将员工导航项翻译为Angestellte:
在这里插入图片描述

Tip
Instead of going through each node to find strings that require translation one by one, use the Localization Tool to streamline your localization process.
不要通过每个节点逐个查找需要翻译的字符串,而是使用本地化工具来简化您的本地化过程。

8.In the MySolution.Win project, open the Model.xafml file in the Model Editor and navigate to the MySolution node. Set the PreferredLanguage property to de-De to display the localized strings in the UI when you run the Windows Forms application.
在MySolution.Win项目中,在模型编辑器中打开Model. xafml文件并导航到MySolution节点。将PreferredLanguage属性设置为de-De以在运行Windows窗体应用程序时在UI中显示本地化字符串。

9.Run the application.
运行应用程序。

In ASP.NET Core Blazor, you can switch the language in the application settings menu. To access the settings menu, click the gear icon in the upper right corner:
在ASP.NETCore Blazor中,您可以在应用程序设置菜单中切换语言。要访问设置菜单,请单击右上角的齿轮图标:
在这里插入图片描述

10.The application should display the German translation of the Employees navigation item.
应用程序应显示员工导航项的德语翻译。

ASP.NET Core Blazor
在这里插入图片描述

Windows Forms
在这里插入图片描述

Next Lesson(下一课)

Assign a Standard Image
分配标准图像

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1958067.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C语言】在限制定条件下数据移动

C语言 在限制定条件下数据移动 给定一个数组 nums,编写一个函数将所有0移动到数组的末尾,同时保持非零元素的相对顺序。 请注意,必须在不复制数组的情况下原地对数组进行操作。 作业题 解决思路及代码 要将数组中的所有 0 移动到数组的末…

数学中的连分式、无穷连根式、平方根

连分式 连分式(continued fraction)由和与倒数的多层嵌套构成,可以是有限的,也可以是无限的。 表达式:或 import mathdef fraction_to_continued_fraction(numerator, denominator, max_terms):"""计算…

WordPress原创插件:搜索引擎抓取首图seo图片

WordPress原创插件:搜索引擎抓取首图seo图片 插件设置 插件将在网站头部添加适当的meta标签,以便百度等搜索引擎抓取指定的固定图像。 插件下载 https://download.csdn.net/download/huayula/89596527

[Meachines] [Easy] Friendzone LFI+Python-OS库污染权限提升

信息收集 IP AddressOpening Ports10.10.10.123TCP:21,22,53,80,139,443,445 $ nmap -p- 10.10.10.123 --min-rate 1000 -sC -sV PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4 (Ubuntu Lin…

vue项目上线打包后出现的问题

1、出现空白页 1.1 打包路径: module.exports {publicPath:./, //修改为绝对路径 } 修改完打包路径后build可以展示页面 1.2 路由模式: 项目上线要求是history模式,需要后端做重定向 前端自测可以使用hash模式 2、代理和环境变量 问题…

信创系统上的数据加密和防泄露该如何对应?

随着信息技术的快速发展和数字化转型的深入推进,关于信创加密和信创防泄露的信息安全问题日益凸显。特别是在国家战略层面,推动自主可控的信息技术体系建设成为重中之重。深信达信创沙盒作为一款基于国产操作系统(如麒麟、统信等)…

Hugo 部署与自动更新(Git)

文章目录 Nginx部署Hugonginx.confhugo.conf Hugo自动更新Hugo自动更新流程添加访问令牌添加web hookrust实现自动更新接口 Nginx部署Hugo nginx.conf user nginx; worker_processes auto;error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid;even…

大模型系统学习路线

随着技术的进步,大模型如OpenAI的GPT-4和Sora、Google的BERT和Gemini等已经展现出了惊人的能力-从理解和生成自然语言到创造逼真的图像及视频。所以掌握大模型的知识和技能变得越来越重要。 下面是学习大模型的一些建议,供大家参考。 必备基础知识 **…

爬虫实战-掌上高考网实战

1.确定需求:爬取什么数据爬取大学名称 2.找到数据源地址数据在哪个链接中https://api.zjzw.cn/web/api/?keyword&page1&province_id&ranktype&request_type1&size20&top_school_id[3703,2461,659,3117,597,1724]&type&uriapidata/…

【NPU 系列专栏 2.6 -- - NVIDIA Xavier SoC】

文章目录 NVIDIA Xavier SoCXavier 主要组件Xavier SoC 的型号Xavier SoC 的算力Xavier AGXXavier NXXavier 应用场景自动驾驶机器人物联网(IoT)医疗设备NPU 对比SummaryNVIDIA Xavier SoC 英伟达 Xavier SoC 是英伟达推出的一款高性能系统级芯片,专门为人工智能(AI)和自…

c# - - - ASP.NET Core 网页样式丢失,样式不对

c# - - - ASP.NET Core 网页样式丢失,样式不对 问题 正常样式是这样的。 修改项目名后,样式就变成这样了。底部的内容跑到中间了。 解决 重新生成解决方案,然后发布网站。 原因: 修改项目名之前的 div 上有个这个自定义属…

Mysql开启远程控制简化版,亲测有效

首先关闭防火墙 改表法 打开上图的CMD,输入密码进入,然后输入一下指令 1.use mysql; 2.update user set host % where user root;//更新root用户的权限,允许任何主机连接 3.FLUSH PRIVILEGES;//刷新权限,使更改生效 具体参考…

详解 @RequestHeader 注解在 Spring Boot 中的使用

个人名片 🎓作者简介:java领域优质创作者 🌐个人主页:码农阿豪 📞工作室:新空间代码工作室(提供各种软件服务) 💌个人邮箱:[2435024119@qq.com] 📱个人微信:15279484656 🌐个人导航网站:www.forff.top 💡座右铭:总有人要赢。为什么不能是我呢? 专栏导…

JS+H5在线文心AI聊天(第三方接口)

源码在最后面 调用的不是文心官方接口 可以正常聊天 有打字动画 效果图 源代码 <!DOCTYPE html> <html lang"zh"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-s…

文献笔记|综述|A Survey of Large Language Models (前3章)

A Survey of Large Language Models 题目&#xff1a;大语言模型综述 作者&#xff1a;Wayne Xin Zhao, Kun Zhou, Junyi Li et al. 来源&#xff1a;arXiv 单位&#xff1a;中国人民大学高瓴人工智能学院、中国人民大学信息学院 关键词&#xff1a;Large Language Models; Eme…

如何快速获取全网精准客流?揭秘不为人知的5大运营策略!

有同行所在的地方&#xff0c;就一定拥有咱们需要的客户。客户看的是结果&#xff0c;搜索的是问题&#xff0c;寻找的是答案。 如果没有付费流量&#xff0c;单纯靠搞免费流量&#xff0c;很多大厂的运营也会变得一文不值。一个牛逼的运营&#xff0c;不仅是会做付费流量&…

【Vue2】3-使用Vue脚手架

目录 初始化脚手架 说明 具体步骤 模板项目的结构 关于不同版本的Vue vue.config.js配置文件 ref属性 配置项props mixin&#xff08;混入&#xff09; 插件 scoped样式 总结TodoList案例 webStorage&#xff08;浏览器本地存储&#xff09; TodoList本地存储 组…

pp 5 报废 分派 替代

报废&#xff1a; 装配报废是关于成品的&#xff0c;会在生产订单自动增加数量&#xff0c;对组件有影响 但是在组件上面设置报废是不是影响成品物料的 注意&#xff1a;成品报废和组件报废数量会进行叠加的 但是物料主数据和bom同时设置报废率&#xff0c;不会叠加&#xff0…

python画蜡烛图

Claude3 Opus 在Python中&#xff0c;您可以使用各种绘图库来绘制蜡烛图&#xff0c;例如Matplotlib和Plotly。这里我以Matplotlib库为例&#xff0c;演示如何使用Python绘制蜡烛图。 首先&#xff0c;您需要安装并导入Matplotlib库。您可以使用以下命令来安装Matplotlib&…

字符串专题

1. 2. 3. 4.CtrlAltV自动生成左侧&#xff1b; 5.拼接字符串 6. 7.金额转换之CtrlAltT猛猛包裹 package 字符串; import java.util.Scanner; public class MoneyReverse {public static void main(String[] args) {//1.键盘录入一个金额Scanner sc new Scanner(System.in);i…