Skip to content

Not sure to understand #16

@cyberlp23

Description

@cyberlp23

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions