-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
If Weld is used for inserting strings on a page that have targets for insertion that occur more than once it will ignore all but the first. This is seen especially when using Weld as a dynamic translation engine. Often a page can hold the same strings at different locations in the DOM. As of now Weld demands all those targets to be unique and only occur once on each page.
Example (Weld used as jQuery plugin):
<div id="panels">
<div id="settings">
<input type="text" name="name" />
<a class="lang-CANCEL"> </a><a class="lang-SUBMIT"> </a>
</div>
<div id="configuration">
<label><input type="checkbox" name="visible" /><span class="lang-SHOWNAME"> </span></label>
<a class="lang-CANCEL"> </a><a class="lang-SUBMIT"> </a>
</div>
</div>
jQuery(document).ready(function() {
$('#panels').weld({
"lang-CANCEL" : "Avbryt",
"lang-SUBMIT" : "OK",
"lang-SHOWNAME" : "Visa namnet"
});
});
The code above would leave the two <a>-tags in the configuration div untouched. Since matching of the keys in the Weld object is done using class names, expected would be that Weld inserted the strings on all elements with corresponding classes.