当前位置: 首页 > news >正文

英文网站 字体大小中国菲律宾省

英文网站 字体大小,中国菲律宾省,天津网站建设定制,php网站建设难点在这个章节,我们会将一些文本常量独立出一个资源文件 这样的话,可以方便这些文本常量被翻译成任意的语言 这种国际化的操作,我们一般命名为i18n 新建一个文件i18n.properties webapp/i18n/i18n.properties (New) showHelloButtonTextSay …

在这个章节,我们会将一些文本常量独立出一个资源文件

这样的话,可以方便这些文本常量被翻译成任意的语言

这种国际化的操作,我们一般命名为i18n

新建一个文件i18n.properties

webapp/i18n/i18n.properties (New)

showHelloButtonText=Say Hello
helloMsg=Hello {0}

接着我们将这些常量,绑定到Controller.js

controller/App.controller.js

sap.ui.define(["sap/ui/core/mvc/Controller","sap/m/MessageToast","sap/ui/model/json/JSONModel","sap/ui/model/resource/ResourceModel"
], (Controller, MessageToast, JSONModel, ResourceModel) => {"use strict";return Controller.extend("ui5.walkthrough.controller.App", {onInit() {// set data model on viewconst oData = {recipient : {name : "World"}};const oModel = new JSONModel(oData);this.getView().setModel(oModel);// set i18n model on viewconst i18nModel = new ResourceModel({bundleName: "ui5.walkthrough.i18n.i18n"});this.getView().setModel(i18nModel, "i18n");},onShowHello() {// read msg from i18n modelconst oBundle = this.getView().getModel("i18n").getResourceBundle();const sRecipient = this.getView().getModel().getProperty("/recipient/name");const sMsg = oBundle.getText("helloMsg", [sRecipient]);// show messageMessageToast.show(sMsg);}});
});

另外将view.xml中的常量文本替代

webapp/view/App.view.xml

<mvc:ViewcontrollerName="ui5.walkthrough.controller.App"xmlns="sap.m"xmlns:mvc="sap.ui.core.mvc"><Buttontext="{i18n>showHelloButtonText}"press=".onShowHello"/><Inputvalue="{/recipient/name}"description="Hello {/recipient/name}"valueLiveUpdate="true"width="60%"/>
</mvc:View>

Conventions

  • The resource model for internationalization is called the i18n model.

  • The default filename is i18n.properties.

  • Resource bundle keys are written in (lower) camelCase.

  • Resource bundle values can contain parameters like {0}{1}{2}, …

  • Never concatenate strings that are translated, always use placeholders.

  • Use Unicode escape sequences for special characters.

http://www.yayakq.cn/news/262110/

相关文章:

  • 青岛城市建设档案馆网站长春公司网站模板建站
  • 山东住房和城乡建设厅网站首页重庆企业网站推广方案
  • 网址导航网站建站秦皇岛在哪里
  • 邢台网站建设优化自己做短视频网站
  • 北京城乡建设学校网站网站 如何做后台维护
  • 向国外支付网站开发费ps怎么logo设计制作
  • 学网站建设 去哪里网站维护需要哪些知识
  • 宣传不网站成都全案设计公司
  • 深圳哪里可以做网站怎么建个公司网站
  • wordpress建公司网站哈尔滨做网站公司哪家好
  • 网站建设新模式永修建设局网站
  • 河北省建设厅网站官网同步wordpress文章
  • 保定网站建设模板联系方式中国建设造价工程协会网站
  • 怎么用网站开发者工具更换网页贺卡制作网页
  • 别人用我的身份信息建设网站私人承接软件开发定制
  • 网站报名照片怎么做室内设计培训班学费一般多少
  • 关于手表网站建设策划书打开微信公众号
  • 做网站的职责seo云优化是什么意思
  • 网站建设要什么软件海东市住房和城乡建设局网站
  • 集团企业网站建设方案市场调研公司成功案例
  • 网站请人做要多少钱跨境电商数据分析网站
  • 网站开发项目需求分析说明书flash中国官网
  • 网站建设经费的请示企业建设网站的主要目的
  • 网站信息维护网站建设小说毕业设计
  • 青岛做网站排名wordpress幻灯片教程视频教程
  • 做wps的网站赚钱wordpress首页调用文章多张图片
  • 查询网站备案进度查询湖南人文科技学院图书馆
  • 网站开发平台 运行平台网站建设成品
  • 网站进度条建筑模板施工图片
  • 企业营销网站建设公司排名做网站时怎么透明化