Translate JQuery Mobile widgets

后端 未结 1 376
陌清茗
陌清茗 2021-01-27 00:06

Using i18next, how can I translate JQuery Mobile widgets? Specifically, I\'d like to know how to do that without resorting to using data-i18n-target to modify gener

相关标签:
1条回答
  • 2021-01-27 00:20

    jQuery Mobile widgets are auto-initialized (Markup enhancement) on two events, pagebeforecreate and pagecreate. The majority of widgets are initialized once pagecreate occurs.

    All you need is to wrap i18n code in pagebeforecreate.

    $(document).on("pagebeforecreate", function () {
      // code
    });
    

    Demo

    0 讨论(0)
提交回复
热议问题