-
SAP BTP - Luigi SAP UI5 Application에 다국어 기능 추가하기
Main.controller.js를 아래와 같이 수정해준다. sap.ui.define(["luigi/controller/BaseController"], function (Controller) { "use strict"; return Controller.extend("luigi.controller.Main", { onInit: function (Controller) { const oModel = new sap.ui.model.json.JSONModel(); oModel.loadData("../model/products.json"); this.getView().setModel(oModel); const updateCurrentLanguage = () => { const currentLanguage = LuigiClient.uxManager().getCurrentLocale(); sap.ui.getCore().getConfiguration().setLanguage(currentLanguage); } LuigiClient.addInitListener(updateCurrentLanguage); }, onListItemPress: function (oEvent) { const id = oEvent.getSource().getBindingContext().getProperty("id"); const title = this.getView().getModel("i18n").getResourceBundle().getText("ModalText");...
-
SAP BTP - Luigi React Application에 다국어 기능 추가하기
기존에 만들었던 프로젝트에서 react-cord-mf/public/luigi-config.js 파일을 수정해준다. 메뉴의 label을 바꿔보자. 아래 myTranslationProvider도 변경해주자 var dict = { "en-US": { PRODUCTS: "Products", ORDERHISTORY: "Order History" }, "de-DE": { PRODUCTS: "Kutentak product", ORDERHISTORY: "Kutentak History" }, "ko-KR": { PRODUCTS: "제품", ORDERHISTORY: "주문 내역" }, }; language.js에 언어 추가 export const dict = {...
-
SAP BTP - SAPU UI5 Micro Frontend를 Luigi에 붙이기
linkManager와 기타 API 기능을 사용할 수 있도록 Luigi Client를 UI Micro Frontend로 가져온다. index.html에서 sap-ui-cord의 frameOptions를 allower로 바꾸고 data-sap-ui-preload=”“를 추가해준다. luigi-config.js에 children 추가 { pathSegment: 'order', label: 'Order History', icon: 'history', viewUrl: 'http://localhost:8080/index.html' } ui5-mf/webapp/Main.view.xml을 아래 내용으로 overwrite 해준다. <mvc:View controllerName="luigi.controller.Main" displayBlock="true" xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc"> <List items="{/ProductCollection}"> <ObjectListItem title="{name}" type="Active" press="onListItemPress"...