backbone.marionette + i18n + handlebars

前端 未结 2 1528
日久生厌
日久生厌 2021-01-31 23:38

Can some one post an example of combining these libraries together? including the handler for the i18n and marionette.

Thanks

2条回答
  •  面向向阳花
    2021-02-01 00:21

    I use i18n-JS, which is everything-agnostic, so you can use it with any server-side framework (Ruby on Rails for me) and any Javascript template engine (Haml Coffee for me).

    Here is an example:

    %form.form-horizontal
      .modal
        .modal-header
          %button{ class: 'close', data: { dismiss: 'modal' } } ×
          %h3
            = I18n.t(@property.get('name'), scope: 'data_sheets.properties')
    
        .modal-body
          - unless @property.get('editable')
            %p= I18n.t('data_sheets.you_already_contributed_to_this_property')
    

    So there is nothing to do about Backbone nor Marionette side.

提交回复
热议问题