Irrelon/jquery-lang-js

data-lang-token can't have more than one?

Closed this issue · 0 comments

edit: okay found the issue, so can data-lang-token contain HTML elements? I would need to be able to replace HTML elements for certain languages

Example:
English = <div lang="en" data-lang-token="dolor"><ul><li>1</li><li>2</li></ul></div>
Spanish = <div lang="es" data-lang-token="dolor"><ul><li>1</li><li>2</li><li>3</li></ul></div>
As I'm looking to replace entire content in html, does this script have issues with html in the use of data-lang-token ?

Example:

<div>
Long text translation with a custom defined token(data-lang-token attribute):<br>
<div lang="en" data-lang-token="lorem">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in ...</div>
</div>
<div>
Change Elements:<br>
<div lang="en" data-lang-token="change"><b>Hello</b></div>
</div>

Once I added in the new data-lang-token="change" and placed the token in the language files, the script breaks.

example from language file:

{
	"token": {
		"Property Search":"Búsqueda de Propiedades",
		"lorem" : "Quisque dapibus dictum ligula non lobortis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
		"change" : "<i>Hola</i>"
	},
	"regex": [
		["Budget", "Presupuesto"]
	]
}