-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Hello,
Sorry, i'm not sure to understand how this works.
Should I only add something like this?
It doesn't seem to work. Well, it does recognize the right language defined in $('body').translate({lang: "en", t: dict}); , but nothing happens when clicking on the translation buttons.
Also, do I need in the var dict to put the whole text of the variable, or can I use for example the id of an element?
Thanks!
<p class="trn">to be translated</p>
<a class="btn btn-default lang_selector trn" href="#" role="button" data-value="en">EN</a>
<a class="btn btn-default lang_selector trn" href="#" role="button" data-value="fr">FR</a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery.translate.js"/>
<script type="text/javascript">
var dict = {
"to be translated": {
en: "the translation",
fr: "la traduction"
}
}
$('body').translate({lang: "en", t: dict});
</script>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels