Improve translations for create/edit lightbox

stable
Daniel García 2018-09-13 11:19:59 +02:00 committed by Alex Hermida
parent 4b67893e79
commit 3898d69c46
4 changed files with 34 additions and 21 deletions

View File

@ -778,6 +778,8 @@ $confirm, $q, attachmentsService, $template, $compile) ->
params: { include_attachments: true, include_tasks: true }, params: { include_attachments: true, include_tasks: true },
data: (project) -> data: (project) ->
return { return {
translationID: 'US'
translationIDPlural: 'US'
statusList: _.sortBy(project.us_statuses, "order") statusList: _.sortBy(project.us_statuses, "order")
} }
initialData: (data) -> initialData: (data) ->
@ -797,6 +799,8 @@ $confirm, $q, attachmentsService, $template, $compile) ->
params: { include_attachments: true }, params: { include_attachments: true },
data: (project) -> data: (project) ->
return { return {
translationID: 'TASK'
translationIDPlural: 'TASKS'
statusList: _.sortBy(project.task_statuses, "order") statusList: _.sortBy(project.task_statuses, "order")
} }
initialData: (data) -> initialData: (data) ->
@ -818,6 +822,8 @@ $confirm, $q, attachmentsService, $template, $compile) ->
params: { include_attachments: true }, params: { include_attachments: true },
data: (project) -> data: (project) ->
return { return {
translationID: 'ISSUE'
translationIDPlural: 'ISSUES'
project: project project: project
statusList: _.sortBy(project.issue_statuses, "order") statusList: _.sortBy(project.issue_statuses, "order")
typeById: groupBy(project.issue_types, (x) -> x.id) typeById: groupBy(project.issue_types, (x) -> x.id)
@ -949,7 +955,7 @@ $confirm, $q, attachmentsService, $template, $compile) ->
return attachmentsService.delete($scope.objType, attachment.id) return attachmentsService.delete($scope.objType, attachment.id)
return $q.all(promises) return $q.all(promises)
addExisting = (item) -> addExistingToSprint = (item) ->
currentLoading = $loading().target($el.find(".add-existing-button")).start() currentLoading = $loading().target($el.find(".add-existing-button")).start()
if item.milestone if item.milestone
@ -995,8 +1001,8 @@ $confirm, $q, attachmentsService, $template, $compile) ->
$scope.isDisabledExisting = (selectedItem) -> $scope.isDisabledExisting = (selectedItem) ->
isDisabledExisting(selectedItem) isDisabledExisting(selectedItem)
$scope.addExisting = (selectedItem) -> $scope.addExistingToSprint = (selectedItem) ->
addExisting(selectedItem) addExistingToSprint(selectedItem)
submit = debounce 2000, (event) -> submit = debounce 2000, (event) ->
form = $el.find("form").checksley() form = $el.find("form").checksley()

View File

@ -628,7 +628,7 @@ class TaskboardController extends mixOf(taiga.Controller, taiga.PageMixin, taiga
sprintId: @scope.sprintId, sprintId: @scope.sprintId,
relatedField: 'milestone', relatedField: 'milestone',
relatedObjectId: @scope.sprintId, relatedObjectId: @scope.sprintId,
title: "#{@translate.instant("COMMON.FIELDS.SPRINT")} #{@scope.sprint.name}", targetName: @scope.sprint.name,
}) })
when "standard" then @rootscope.$broadcast("taskform:new", @scope.sprintId, us?.id) when "standard" then @rootscope.$broadcast("taskform:new", @scope.sprintId, us?.id)
when "bulk" then @rootscope.$broadcast("issueform:bulk", @scope.projectId, @scope.sprintId) when "bulk" then @rootscope.$broadcast("issueform:bulk", @scope.projectId, @scope.sprintId)

View File

@ -1091,14 +1091,21 @@
"LAST_SPRINT_NAME": "last sprint is <strong> {{lastSprint}} ;-) </strong>" "LAST_SPRINT_NAME": "last sprint is <strong> {{lastSprint}} ;-) </strong>"
}, },
"CREATE_EDIT": { "CREATE_EDIT": {
"PLACEHOLDER_DESCRIPTION": "Please add descriptive text to help others better understand this {{ objName }}", "TASK_PLACEHOLDER_DESCRIPTION": "Please add descriptive text to help others better understand this Task",
"NEW": "New {{ objName }}", "ISSUE_PLACEHOLDER_DESCRIPTION": "Please add descriptive text to help others better understand this Issue",
"EDIT": "Edit {{ objName }}", "US_PLACEHOLDER_DESCRIPTION": "Please add descriptive text to help others better understand this User Story",
"ADD_EXISTING": "Add {{ objName }} to {{ targetName }}", "NEW_TASK": "New Task",
"NEW_ISSUE": "New Issue",
"NEW_US": "New User Story",
"EDIT_TASK": "Edit Task",
"EDIT_ISSUE": "Edit Issue",
"EDIT_US": "Edit User Story",
"ADD_EXISTING_ISSUE": "Add Issue to {{ targetName }}",
"CONFIRM_CLOSE": "You have not saved changes.\nAre you sure you want to close the form?", "CONFIRM_CLOSE": "You have not saved changes.\nAre you sure you want to close the form?",
"EXISTING_OBJECT": "Existing {{ objName }}", "EXISTING_ISSUE": "Existing Issue",
"NEW_OBJECT": "New {{ objName }}", "CHOOSE_EXISTING_ISSUE": "Which Issue?",
"CHOOSE_EXISTING": "Which {{ objName }}?" "ADD_ISSUE": "Add Issue",
"FILTER_ISSUES": "Filter Issues"
}, },
"DELETE_DUE_DATE": { "DELETE_DUE_DATE": {
"TITLE": "Delete due date", "TITLE": "Delete due date",

View File

@ -2,9 +2,9 @@ tg-lightbox-close
form(ng-if="lightboxOpen") form(ng-if="lightboxOpen")
h2.title(ng-switch="mode") h2.title(ng-switch="mode")
span(ng-switch-when="new") {{ 'LIGHTBOX.CREATE_EDIT.NEW' | translate: { objName: objName } }} span(ng-switch-when="new") {{ 'LIGHTBOX.CREATE_EDIT.NEW_' + translationID | translate }}
span(ng-switch-when="edit") {{ 'LIGHTBOX.CREATE_EDIT.EDIT' | translate: { objName: objName } }} span(ng-switch-when="edit") {{ 'LIGHTBOX.CREATE_EDIT.EDIT_' + translationID | translate }}
span(ng-switch-when="add-existing") {{ 'LIGHTBOX.CREATE_EDIT.ADD_EXISTING' | translate: { objName: objName, targetName: title } }} span(ng-switch-when="add-existing") {{ 'LIGHTBOX.CREATE_EDIT.ADD_EXISTING_' + translationID | translate: { targetName: targetName } }}
.existing-or-new-selector(ng-show="getOrCreate == true") .existing-or-new-selector(ng-show="getOrCreate == true")
.existing-or-new-selector-single(ng-click="setMode('add-existing')") .existing-or-new-selector-single(ng-click="setMode('add-existing')")
@ -16,7 +16,7 @@ form(ng-if="lightboxOpen")
ng-model="mode" ng-model="mode"
) )
label.e2e-existing-item-label(for="add-existing") label.e2e-existing-item-label(for="add-existing")
span.name {{ 'LIGHTBOX.CREATE_EDIT.EXISTING_OBJECT' | translate: { objName: objName } }} span.name {{ 'LIGHTBOX.CREATE_EDIT.EXISTING_' + translationID | translate }}
.existing-or-new-selector-single(ng-click="setMode('new')") .existing-or-new-selector-single(ng-click="setMode('new')")
input( input(
@ -27,13 +27,13 @@ form(ng-if="lightboxOpen")
ng-model="mode" ng-model="mode"
) )
label.e2e-new-item-label(for="new") label.e2e-new-item-label(for="new")
span.name {{ 'LIGHTBOX.CREATE_EDIT.NEW_OBJECT' | translate: { objName: objName } }} span.name {{ 'LIGHTBOX.CREATE_EDIT.NEW_' + translationID | translate }}
div(ng-if="mode == 'add-existing'") div(ng-if="mode == 'add-existing'")
.existing-item-wrapper .existing-item-wrapper
tg-search-list( tg-search-list(
label="{{ 'LIGHTBOX.CREATE_EDIT.CHOOSE_EXISTING' | translate: { objName: objName } }}" label="{{ 'LIGHTBOX.CREATE_EDIT.CHOOSE_EXISTING_' + translationID | translate }}"
placeholder="{{ 'ISSUES.FILTER_ISSUES' | translate }}" placeholder="{{ 'LIGHTBOX.CREATE_EDIT.FILTER_' + translationIDPlural | translate }}"
items="existingItems" items="existingItems"
ng-model="selectedItem" ng-model="selectedItem"
filter-by="['ref', 'subject']" filter-by="['ref', 'subject']"
@ -43,9 +43,9 @@ form(ng-if="lightboxOpen")
) )
button.button-green.add-existing-button( button.button-green.add-existing-button(
ng-click="addExisting(selectedItem)" ng-click="addExistingToSprint(selectedItem)"
ng-disabled="!selectedItem || isDisabledExisting(selectedItem)" ng-disabled="!selectedItem || isDisabledExisting(selectedItem)"
) {{ 'COMMON.ADD' | translate }} {{ objName }} ) {{ 'LIGHTBOX.CREATE_EDIT.ADD_' + translationID | translate }}
div(ng-if="mode != 'add-existing'") div(ng-if="mode != 'add-existing'")
.form-wrapper .form-wrapper
@ -77,7 +77,7 @@ form(ng-if="lightboxOpen")
name="description" name="description"
ng-model="obj.description" ng-model="obj.description"
ng-model-options="{ debounce: 200 }" ng-model-options="{ debounce: 200 }"
ng-attr-placeholder="{{ 'LIGHTBOX.CREATE_EDIT.PLACEHOLDER_DESCRIPTION' | translate }}" ng-attr-placeholder="{{ 'LIGHTBOX.CREATE_EDIT.' + translationID + '_PLACEHOLDER_DESCRIPTION' | translate }}"
) )
fieldset fieldset
section section