[i18n] Minor fixes

stable
David Barragán Merino 2015-05-18 16:55:55 +02:00
parent d2600453a7
commit dcc84d9ae8
9 changed files with 71 additions and 58 deletions

View File

@ -196,7 +196,8 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
responseError: httpResponseError responseError: httpResponseError
} }
$provide.factory("authHttpIntercept", ["$q", "$location", "$tgNavUrls", "lightboxService", authHttpIntercept]) $provide.factory("authHttpIntercept", ["$q", "$location", "$tgNavUrls", "lightboxService",
authHttpIntercept])
$httpProvider.interceptors.push("authHttpIntercept") $httpProvider.interceptors.push("authHttpIntercept")
@ -292,9 +293,7 @@ init = ($log, $config, $rootscope, $auth, $events, $analytics, $translate) ->
$rootscope.contribPlugins = @.taigaContribPlugins $rootscope.contribPlugins = @.taigaContribPlugins
$rootscope.adminPlugins = _.where(@.taigaContribPlugins, {"type": "admin"}) $rootscope.adminPlugins = _.where(@.taigaContribPlugins, {"type": "admin"})
# i18n $rootscope.$on "$translateLoadingEnd", (e, ctx) ->
#$rootscope.$on "$translateChangeEnd", (ctx) ->
$rootscope.$on "$translateLoadingEnd'", (ctx) ->
lang = ctx.language lang = ctx.language
i18nInit(lang, $translate) i18nInit(lang, $translate)

View File

@ -33,7 +33,6 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading,
link = ($scope, $el, attrs) -> link = ($scope, $el, attrs) ->
hasErrors = false hasErrors = false
createSprint = true createSprint = true
prettyDate = $translate.instant("BACKLOG.SPRINTS.DATE")
$scope.sprint = { $scope.sprint = {
project: null project: null
@ -107,6 +106,7 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading,
form.reset() form.reset()
createSprint = true createSprint = true
prettyDate = $translate.instant("COMMON.PICKERDATE.FORMAT")
$scope.sprint.project = projectId $scope.sprint.project = projectId
$scope.sprint.name = null $scope.sprint.name = null
$scope.sprint.slug = null $scope.sprint.slug = null
@ -147,6 +147,8 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading,
$scope.$on "sprintform:edit", (ctx, sprint) -> $scope.$on "sprintform:edit", (ctx, sprint) ->
createSprint = false createSprint = false
prettyDate = $translate.instant("COMMON.PICKERDATE.FORMAT")
$scope.$apply -> $scope.$apply ->
$scope.sprint = sprint $scope.sprint = sprint
$scope.sprint.estimated_start = moment($scope.sprint.estimated_start).format(prettyDate) $scope.sprint.estimated_start = moment($scope.sprint.estimated_start).format(prettyDate)

View File

@ -52,9 +52,11 @@ module.directive("tgDateRange", ["$translate", DateRangeDirective])
## Date Selector Directive (using pikaday) ## Date Selector Directive (using pikaday)
############################################################################# #############################################################################
DateSelectorDirective = ($translate) -> DateSelectorDirective = ($rootscope, $translate) ->
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->
selectedDate = null selectedDate = null
initialize = () ->
$el.picker = new Pikaday({ $el.picker = new Pikaday({
field: $el[0] field: $el[0]
onSelect: (date) => onSelect: (date) =>
@ -96,15 +98,22 @@ DateSelectorDirective = ($translate) ->
format: $translate.instant("COMMON.PICKERDATE.FORMAT") format: $translate.instant("COMMON.PICKERDATE.FORMAT")
}) })
unbind = $rootscope.$on "$translateChangeEnd", (ctx) => initialize()
$scope.$watch $attrs.ngModel, (val) -> $scope.$watch $attrs.ngModel, (val) ->
initialize() if val? and not $el.picker
$el.picker.setDate(val) if val? $el.picker.setDate(val) if val?
$scope.$on "$destroy", ->
$el.off()
unbind()
return { return {
link: link link: link
require: "ngModel" require: "ngModel"
} }
module.directive("tgDateSelector", ["$translate", DateSelectorDirective]) module.directive("tgDateSelector", ["$rootScope", "$translate", DateSelectorDirective])
############################################################################# #############################################################################
@ -131,6 +140,9 @@ SprintProgressBarDirective = ->
renderProgress($el, percentage, visual_percentage) renderProgress($el, percentage, visual_percentage)
$scope.$on "$destroy", ->
$el.off()
return {link: link} return {link: link}
module.directive("tgSprintProgressbar", SprintProgressBarDirective) module.directive("tgSprintProgressbar", SprintProgressBarDirective)

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "This value should be the same." "EQUAL_TO": "This value should be the same."
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Previous Month", "PREV_MONTH": "Previous Month",
@ -239,7 +239,7 @@
"ATTACHMENT": { "ATTACHMENT": {
"SECTION_NAME": "Adjunts", "SECTION_NAME": "Adjunts",
"TITLE": "{{ fileName }} pujat el {{ date }}", "TITLE": "{{ fileName }} pujat el {{ date }}",
"DESCIPTION": "Escriu una descripció curta", "DESCRIPTION": "Type a short description",
"DEPRECATED_FILE": "Obsolet?", "DEPRECATED_FILE": "Obsolet?",
"ADD": "Afegir nou adjunt. <%- maxFileSizeMsg %>", "ADD": "Afegir nou adjunt. <%- maxFileSizeMsg %>",
"MAX_FILE_SIZE": "[Max. grandària: {{maxFileSize}}]", "MAX_FILE_SIZE": "[Max. grandària: {{maxFileSize}}]",

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "This value should be the same." "EQUAL_TO": "This value should be the same."
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Previous Month", "PREV_MONTH": "Previous Month",

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "Este valor debe ser el mismo." "EQUAL_TO": "Este valor debe ser el mismo."
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Mes Anterior", "PREV_MONTH": "Mes Anterior",
@ -239,7 +239,7 @@
"ATTACHMENT": { "ATTACHMENT": {
"SECTION_NAME": "adjuntos", "SECTION_NAME": "adjuntos",
"TITLE": "{{ fileName }} subido el {{ date }}", "TITLE": "{{ fileName }} subido el {{ date }}",
"DESCIPTION": "Escribe una descripción corta", "DESCRIPTION": "Escribe una pequeña descripción",
"DEPRECATED_FILE": "¿Desactualizado?", "DEPRECATED_FILE": "¿Desactualizado?",
"ADD": "Agrega nuevos adjunto", "ADD": "Agrega nuevos adjunto",
"MAX_FILE_SIZE": "[Tamaño Max. : {{maxFileSize}}]", "MAX_FILE_SIZE": "[Tamaño Max. : {{maxFileSize}}]",

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "This value should be the same." "EQUAL_TO": "This value should be the same."
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Previous Month", "PREV_MONTH": "Previous Month",
@ -239,7 +239,7 @@
"ATTACHMENT": { "ATTACHMENT": {
"SECTION_NAME": "liitteet", "SECTION_NAME": "liitteet",
"TITLE": "{{ fileName }} ladattu {{ date }}\n", "TITLE": "{{ fileName }} ladattu {{ date }}\n",
"DESCIPTION": "Kirjoita lyhyt kuvaus", "DESCRIPTION": "Type a short description",
"DEPRECATED_FILE": "Vanhentunut?", "DEPRECATED_FILE": "Vanhentunut?",
"ADD": "Lisää liite. <%- maxFileSizeMsg %>", "ADD": "Lisää liite. <%- maxFileSizeMsg %>",
"MAX_FILE_SIZE": "[Maks. koko: {{maxFileSize}}]", "MAX_FILE_SIZE": "[Maks. koko: {{maxFileSize}}]",

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "This value should be the same." "EQUAL_TO": "This value should be the same."
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Previous Month", "PREV_MONTH": "Previous Month",
@ -239,7 +239,7 @@
"ATTACHMENT": { "ATTACHMENT": {
"SECTION_NAME": "pièces jointes", "SECTION_NAME": "pièces jointes",
"TITLE": "{{ fileName }} transmis le {{ date }}\n", "TITLE": "{{ fileName }} transmis le {{ date }}\n",
"DESCIPTION": "Entrez une courte description", "DESCRIPTION": "Type a short description",
"DEPRECATED_FILE": "Obsolète?", "DEPRECATED_FILE": "Obsolète?",
"ADD": "Ajouter une pièce jointe. <%- maxFileSizeMsg %>", "ADD": "Ajouter une pièce jointe. <%- maxFileSizeMsg %>",
"MAX_FILE_SIZE": "[Taille max.: {{maxFileSize}}]", "MAX_FILE_SIZE": "[Taille max.: {{maxFileSize}}]",

View File

@ -62,7 +62,7 @@
"EQUAL_TO": "該數值應為一致" "EQUAL_TO": "該數值應為一致"
}, },
"PICKERDATE": { "PICKERDATE": {
"FORMAT": "DD/MM/YYYY", "FORMAT": "DD MMM YYYY",
"IS_RTL": "false", "IS_RTL": "false",
"FIRST_DAY_OF_WEEK": "1", "FIRST_DAY_OF_WEEK": "1",
"PREV_MONTH": "Previous Month", "PREV_MONTH": "Previous Month",
@ -239,7 +239,7 @@
"ATTACHMENT": { "ATTACHMENT": {
"SECTION_NAME": "附件", "SECTION_NAME": "附件",
"TITLE": "{{ fileName }} 上傳於 {{ date }}", "TITLE": "{{ fileName }} 上傳於 {{ date }}",
"DESCIPTION": "輸入一段簡短敘述", "DESCRIPTION": "Type a short description",
"DEPRECATED_FILE": "棄用?", "DEPRECATED_FILE": "棄用?",
"ADD": "加入新附件 <%- maxFileSizeMsg %>", "ADD": "加入新附件 <%- maxFileSizeMsg %>",
"MAX_FILE_SIZE": "[Max. size: {{maxFileSize}}]", "MAX_FILE_SIZE": "[Max. size: {{maxFileSize}}]",