resource bunlde이 있는 이유는 코드를 변경할 필요 없이 앱을 여러 언어로 실행 할 수 있도록 하기 위함이다. 독일어 버전의 앱을 한번 만들어보자.
de
는 독일어의 locale이다.# Field labels
firstName=Vorname
lastName=Nachname
enabled=Aktiviert
# Screen titles
panelHeaderText=Data Binding Grundlagen
supported locales
와 fallback
프로퍼티에 관련된 사항을 더 알고 싶다면 해당 링크 참조 const oResourceModel = new ResourceModel({
bundleName: "sap.ui.demo.db.i18n.i18n",
supportedLocales: ["", "de"], // de locale 지원
fallbackLocale: ""
});
<script
id="sap-ui-bootstrap"
...
data-sap-ui-language="de"
...
></script>
MainView.controller.js에 해당 구문을 추가해서 콘솔창을 보면 해당 앱이 어떤 언어로 설정되었는지 볼수 있다.
console.log(sap.ui.getCore().getConfiguration().getLanguage());