Skip to content

Instantly share code, notes, and snippets.

@mitsuruog
Created August 10, 2014 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuruog/2d212e729f45542717f8 to your computer and use it in GitHub Desktop.
Save mitsuruog/2d212e729f45542717f8 to your computer and use it in GitHub Desktop.
[SAPUI5/OpenUI5]スマートに国際化する方法のBlogコードサンプル
sap.ui.controller "com.mitsuruog.sapui5.showroom.view.Locale",
onInit: ->
i18nModel = new sap.ui.model.resource.ResourceModel
bundleUrl : "i18n/messageBundle.properties"
@getView().setModel i18nModel, "i18n"
sap.ui.jsview "com.mitsuruog.sapui5.showroom.view.Locale",
getControllerName: -> "com.mitsuruog.sapui5.showroom.view.Locale"
createContent: (oController) ->
@page = new sap.m.Page
title: "{i18n>title}"
subHeader:
new sap.m.Bar
contentRight: [
new sap.m.Text
text: "{i18n>changeLocale}"
]
content: [
new sap.m.Text
text: "{i18n>text}"
]
footer:
new sap.m.Bar
contentRight: [
new sap.m.Button
type: "Accept"
text: "{i18n>button}"
]
@page
title = ロケール
text = 吾輩は猫である。名前はまだ無い。
changeLocale = ロケール変更:
button = これはボタンのテキスト
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment