1

我正在使用 LazZiya Express Localization 来本地化我的项目。我有一个问题:我可以对 js 文件 (vuejs) 使用 LazZiya 本地化吗?例子:

const renderVueForm = () => {
    console.log('site js');
    let html = `<div localize-content>Oh my darling i love you so. You mean everything to me.</div>`;

    return html;
};
4

1 回答 1

0

将可本地化的文本放入隐藏的 html div 中:

<div id="my-localized-text" class="d-none" localize-content>
    Oh my darling i love you so. You mean everything to me.
</div>

然后在 JS 中获取本地化 div 的内容:

const renderVueForm = () => {
    console.log('site js');
    let html = $("#my-localized-text").html();

    return html;
};
于 2021-11-29T16:08:54.300 回答