当前位置:网站首页>第十五章 字符串本地化和消息字典(一)
第十五章 字符串本地化和消息字典(一)
2022-07-02 15:18:00 【yaoxin521123】
第十五章 字符串本地化和消息字典(一)
本文概述了字符串本地化,并描述了如何导出、导入和管理消息字典。
字符串本地化
当本地化应用程序的文本时,会创建一种语言的文本字符串清单,然后当应用程序区域设置不同时,建立约定以另一种语言替换这些消息的翻译版本。
支持以下本地化字符串的过程:
- 开发人员在他们的代码中包含可本地化的字符串(在
REST应用程序或商业智能模型中)。
这种机制各不相同,但最常见的机制是 $$$Text 宏。代替硬编码的文字字符串,开发人员包含 $$$Text 宏的实例,为宏参数提供如下值:
- 默认字符串
- 此字符串所属的域(将字符串分组为域时,本地化更易于管理)
- 默认字符串的语言代码
write "Hello world"
替换为
write $$$TEXT("Hello world","sampledomain","en-us")
- 编译代码时,编译器会在消息字典中为
$$$Text宏的每个唯一实例生成条目。
消息字典是全局的,因此可以在管理门户中轻松查看(例如)。有一些类方法可以帮助完成常见任务。
- 开发完成后,发布工程师导出该域或所有域的消息字典。
结果是一个或多个 XML 消息文件,其中包含原始语言的文本字符串。
发布工程师将这些文件发送给翻译人员,请求翻译版本。
翻译人员使用他们喜欢的任何
XML创作工具来处理XML消息文件。从本质上讲,它们将文本从原始语言翻译成新语言,而不改变周围的XML。转换器返回一个新的
XML消息文件,该文件具有相同的结构并且:
- 标识
<MsgFile>元素的语言属性的新RFC1766值。 - 包含已识别语言的翻译文本。
- 发布工程师将翻译后的
XML消息文件导入到导出原始文件的同一个名称空间中。
译文和原文在消息词典中并存。
- 在运行时,应用程序根据浏览器默认语言选择要显示的文本。
消息字典
消息字典是一个 global,包含按域名、语言名称和消息 ID 组织的文本字符串:
- 每条消息的文本是最多
32K个字符的字符串。如果数据库启用了长字符串,则字符串可能会更长,但默认最大值为32K。消息可能只包含文本,也可能包含一个或多个由%1、%2等指定的参数。当应用程序页面需要时,可以将这些参数替换为文本(例如错误消息中的文件名)显示消息。 - 域名是任意字符串。它标识一组相关的文本项,例如特定应用程序或页面的所有消息。如果将域分配给一组邮件,可以稍后对具有相同域的所有邮件执行特定操作。
域名区分大小写,可以包含大小写字符。如果域名以 % 开头, 认为该域中的所有消息都是在所有命名空间中可见的系统消息。否则,当创建消息时,它仅在定义它的命名空间中可见。
- 语言名称是符合
RFC1766的全小写语言标记。它由一个或多个部分组成:主要语言标签(例如 en或ja)可选地后跟连字符 (-) 和次要语言标签(en-gb或ja-jp`)。 - 消息
ID是任意字符串;它唯一地标识一条消息。消息ID只需要在域内是唯一的。可以分配一个消息ID或允许编译器分配一个,这取决于用于创建消息的约定。消息ID区分大小写,可以包含大小写字符。
消息字典存储
每个用户定义的命名空间都将其消息字典存储在名为 ^IRIS.Msg 的下标全局中。 ^IRIS.Msg 中的下标顺序是域、语言和消息 ID。
要查看命名空间的 ^IRIS.Msg
- 启动管理门户。
- 切换到感兴趣的命名空间。
- 单击System Explorer > Globals。
- 在
IRIS.Msg行中,单击查看。
例如
DHC-APP>zw ^IRIS.Msg
^IRIS.Msg("Ensemble")="zh-cn"
^IRIS.Msg("Ensemble","zh-cn",27956811)="Business Rules"
^IRIS.Msg("Ensemble","zh-cn",46484733)="Create New Message Routing Rule"
^IRIS.Msg("Ensemble","zh-cn",52267811)="Business Rule Log"
^IRIS.Msg("Ensemble","zh-cn",56439219)="Edit the configuration of this production."
^IRIS.Msg("Ensemble","zh-cn",59992850)="Edit, Start or Stop an Ensemble Production."
^IRIS.Msg("Ensemble","zh-cn",60154202)="The following PubSub Domain Names are currently defined. PubSub domain names are used to group PubSub subscribers and their associated subscriptions."
^IRIS.Msg("Ensemble","zh-cn",65030300)="Edit Role definition:"
^IRIS.Msg("Ensemble","zh-cn",74372598)="Create New Subscriber"
^IRIS.Msg("Ensemble","zh-cn",103132939)="Defined Data Transformations:"
^IRIS.Msg("Ensemble","zh-cn",140775628)="Suspended"
...
DHC-APP>zw ^CacheMsg
^CacheMsg("Ensemble")="zh-cn"
^CacheMsg("Ensemble","zh-cn",27956811)="Business Rules"
^CacheMsg("Ensemble","zh-cn",39977858)="Select a Business Process"
^CacheMsg("Ensemble","zh-cn",46484733)="Create New Message Routing Rule"
^CacheMsg("Ensemble","zh-cn",52267811)="Business Rule Log"
^CacheMsg("Ensemble","zh-cn",56439219)="Edit the configuration of this production."
^CacheMsg("Ensemble","zh-cn",59992850)="Edit, Start or Stop an Ensemble Production."

边栏推荐
- Geoserver: publishing PostGIS data sources
- PCL知识点——体素化网格方法对点云进行下采样
- Income and risk of linear programming example investment
- Introduction to Hisilicon hi3798mv100 set top box chip [easy to understand]
- class和getClass()的区别
- vector的底层模拟实现
- Connect Porsche and 3PL EDI cases
- 871. 最低加油次数
- 深度之眼(三)——矩阵的行列式
- The construction of scalable distributed database cluster and the partition design of oneproxy sub database
猜你喜欢

Blog theme "text" summer fresh Special Edition
![[非线性控制理论]7_High gain and High Frequency](/img/e5/6c5ca4a89c97d9613cddccb281b35b.png)
[非线性控制理论]7_High gain and High Frequency

Platform management background and merchant menu resource management: merchant role management design

Qstype implementation of self drawing interface project practice (II)

From collection to output: inventory those powerful knowledge management tools - inventory of excellent note taking software (4)

Sword finger offer 21 Adjust the array order so that odd numbers precede even numbers

TCP congestion control details | 2 background

博客主题 “Text“ 夏日清新特别版

Smart trash can (V) - light up OLED

【GAMES101】作业4 Bézier 曲线
随机推荐
Green bamboo biological sprint Hong Kong stocks: loss of more than 500million during the year, tiger medicine and Beijing Yizhuang are shareholders
Vscode + eslint configuration
泡椒凤爪制作教程
Sword finger offer 24 Reverse linked list
When the industrial Internet began to enter the deep-water area, it appeared more in the form of industry
Un an à dix ans
ROS knowledge point - message_filters
剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
Win10 system uses pip to install juypter notebook process record (installed on a disk other than the system disk)
默认浏览器设置不了怎么办?
visibilitychange – 指定标签页可见时,刷新页面数据
ThreadLocal
Si446 usage record (I): basic data acquisition
Alibaba Tianchi SQL learning notes - Day3
【目标跟踪】|数据集汇总
Map集合详细讲解
SAP commerce Cloud Architecture Overview
SSB threshold_ SSB modulation "suggestions collection"
dstat使用[通俗易懂]
Vscode knowledge points - Common Errors