coderifous / jquery-localize

a jQuery plugin that makes it easy to internationalize your web site.
465 stars 142 forks source link

how to get value from json in the JS file #104

Closed amerqt closed 3 years ago

amerqt commented 3 years ago

I need to set element properties with translated value from JS file , anyway to do that ?

amerqt commented 3 years ago

after deep check i found that this was mentioned in repo description you can use callbacks

$("[data-localize]").localize("languages/locale", { language: "en", callback: function(data, defaultCallback){ console.log(data.title); < -------- HERE defaultCallback(data) } });