Extract translations from javascript

This commit is contained in:
Julius Pabrinkis
2017-05-11 18:38:28 +01:00
committed by Maikel Linke
parent 9fa7a30c7e
commit 739d06cf03
23 changed files with 120 additions and 63 deletions

View File

@@ -21,16 +21,16 @@ angular.module("admin.indexUtils").factory "pendingChanges", ($q, resources, Sta
submitAll: (form=null) =>
all = []
@errors = []
StatusMessage.display('progress', "Saving...")
StatusMessage.display('progress', t('js.saving'))
for id, objectChanges of @pendingChanges
for attrName, change of objectChanges
all.push @submit(change)
$q.all(all).then =>
if @errors.length == 0
StatusMessage.display('success', "All changes saved successfully")
StatusMessage.display('success', t('js.all_changes_saved_successfully'))
form.$setPristine() if form?
else
StatusMessage.display('failure', "Oh no! I was unable to save your changes")
StatusMessage.display('failure', t('js.oh_no'))
all
submit: (change) ->

View File

@@ -10,7 +10,7 @@ angular.module("admin.indexUtils").factory "SpreeApiAuth", ($q, $http, SpreeApiK
deferred.resolve()
.error (response) ->
error = response?.error || "You are unauthorised to access this page."
error = response?.error || t('js.unauthorized')
deferred.reject(error)
deferred.promise