add data-sw-translate to templates

This commit is contained in:
Josh Ponelat
2015-06-16 11:31:53 +02:00
parent 673881007c
commit 372723b82d
9 changed files with 47 additions and 28 deletions

View File

@@ -17,10 +17,11 @@ window.SwaggerTranslator = {
_words:[],
translate: function() {
translate: function(sel) {
var $this = this;
var sel = sel || '[data-sw-translate]';
$('[data-sw-translate]').each(function() {
$(sel).each(function() {
$(this).html($this._tryTranslate($(this).html()));
$(this).val($this._tryTranslate($(this).val()));