Irrelon / jquery-lang-js

i18n Allow instant language switching on HTML pages without reloading the page.
https://www.irrelon.com
362 stars 130 forks source link

Use default texts without trim #79

Closed tomasvalek closed 7 years ago

tomasvalek commented 8 years ago

Maybe will be better use in Lang.prototype._setTextNodes: defaultText = $.trim(textNode.langDefaultText); and textNode.node.data = textNode.node.data.split($.trim(textNode.node.data)).join(translation);

without $.trim() for better usable with template systems.

Example: template: Counter {{id}} data: data for id not exists result from template system will be: Counter (space at the end of the string) but with $.trim function translate does not work. Without trim yes.