diff --git a/app/views/stockit/_destroy_fail.js.haml b/app/views/stockit/_destroy_fail.js.haml index a9601900..7b35d38d 100644 --- a/app/views/stockit/_destroy_fail.js.haml +++ b/app/views/stockit/_destroy_fail.js.haml @@ -1,5 +1,5 @@ -# please polish the following line if you know how, same in view destroy -var errorDiv = $('
x
'); +var errorDiv = $('
#{t('ui.marks.close')}
'); errorDiv.append(document.createTextNode('#{j(fail_msg)}')); $('div.container-fluid').prepend(errorDiv); diff --git a/app/views/stockit/destroy.js.haml b/app/views/stockit/destroy.js.haml index 66d6d70d..b95deab8 100644 --- a/app/views/stockit/destroy.js.haml +++ b/app/views/stockit/destroy.js.haml @@ -1,7 +1,7 @@ -# please polish the following line if you know how, same in partial _destroy_fail -var successDiv = $('
x
'); +var successDiv = $('
#{escape_javascript(t('ui.marks.close'))}
'); -successDiv.append(document.createTextNode('Artikel #{j(@article.name)} gelöscht.')); +successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}')); $('div.container-fluid').prepend(successDiv); -# WARNING: If you try to use the escape j(...) here, an error occurs: diff --git a/config/locales/de/de.stockit.yml b/config/locales/de/de.stockit.yml index 5fcabc7a..0caccd04 100644 --- a/config/locales/de/de.stockit.yml +++ b/config/locales/de/de.stockit.yml @@ -29,6 +29,8 @@ de: new: title: 'Neuen Lagerartikel anlegen' search_text: 'Suche nache Artikeln aus allen Katalogen:' + destroy: + notice: 'Artikel %{name} gelöscht.' # used by controller stock_create: @@ -39,4 +41,3 @@ de: # used by model check: not_empty: '%{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null.' - diff --git a/config/locales/en/en.stockit.yml b/config/locales/en/en.stockit.yml index 7dae63c2..8f6c3b7b 100644 --- a/config/locales/en/en.stockit.yml +++ b/config/locales/en/en.stockit.yml @@ -29,6 +29,8 @@ en: new: title: 'Add new stock article' search_text: 'Search for articles in all catalogues:' + destroy: + notice: 'Article %{name} was deleted.' # used by controller stock_create: