关于sap:关于-SAP-Fiori-Elements-应用标题属性title-的复制逻辑单步调试

2次阅读

共计 670 个字符,预计需要花费 2 分钟才能阅读完成。

为反对国际化 (internationalization),title 属性的值没有硬编码,而是保护在 i18n_<language_code>.properties 里:

https://ldai7er9.wdf.sap.corp…

https://ldcigm4.wdf.sap.corp:…’FA163EE5-6C3A-1ED7-B883-0ED9A99A201F’)

想要以中文环境加载 SAP UI5 利用,在 url 前面加上参数即可:

sap-ui-language=ZH

保护在 i18n_<language_code>.properties 里的题目内容,为汉字的 unicode:

HTML header 对应的设置:meta content=”text/html;charset=UTF-8″:

SAP Fiori Elements 利用 index.html 里 title 属性的值:

<title>{{appTitle}}</title>

应用下列这行 JavaScript 代码,能够在 window.document title 属性被批改时,让断点主动触发:

Object.defineProperty(window.document, "title", { set: function(){debugger;}});

从下图可见,Fiori Elements 利用的 title 属性,其值来自于 oMetadata.title:

再钻研 metadata 是从哪里解析的:

AppConfiguration.js:

答案是来自 manifest.json:

更多 Jerry 的原创文章,尽在:” 汪子熙 ”:

正文完
 0