Skip to content

Instantly share code, notes, and snippets.

@mitsuruog
Created August 10, 2014 15:04
Show Gist options
  • Save mitsuruog/2d212e729f45542717f8 to your computer and use it in GitHub Desktop.
Save mitsuruog/2d212e729f45542717f8 to your computer and use it in GitHub Desktop.

Revisions

  1. mitsuruog created this gist Aug 10, 2014.
    7 changes: 7 additions & 0 deletions Locale.controller.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    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"
    26 changes: 26 additions & 0 deletions Locale.view.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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
    4 changes: 4 additions & 0 deletions messageBundle_ja.properties
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    title = ロケール
    text = 吾輩は猫である。名前はまだ無い。
    changeLocale = ロケール変更:
    button = これはボタンのテキスト