Add i18n.

This commit is contained in:
Paulo Reis 2018-06-05 10:14:16 +01:00
parent 6e7e76a3ce
commit f858786f2d
4 changed files with 20 additions and 16 deletions

View file

@ -53,18 +53,18 @@ aside.change-list(
div.description(ng-click="select()") div.description(ng-click="select()")
div.time {{ update.meta.end_ts | formatDate:'h:mm a' }} div.time {{ update.meta.end_ts | formatDate:'h:mm a' }}
div.action.action-edited(ng-if="history.isV2 && update.pathnames.length > 0") div.action.action-edited(ng-if="history.isV2 && update.pathnames.length > 0")
| Edited | #{translate("file-action-edited")}
div.docs(ng-repeat="pathname in update.pathnames") div.docs(ng-repeat="pathname in update.pathnames")
.doc {{ pathname }} .doc {{ pathname }}
div.docs(ng-repeat="project_op in update.project_ops") div.docs(ng-repeat="project_op in update.project_ops")
div(ng-if="project_op.rename") div(ng-if="project_op.rename")
.action Renamed .action #{translate("file-action-renamed")}
.doc {{ project_op.rename.pathname }} → {{ project_op.rename.newPathname }} .doc {{ project_op.rename.pathname }} → {{ project_op.rename.newPathname }}
div(ng-if="project_op.add") div(ng-if="project_op.add")
.action Created .action #{translate("file-action-created")}
.doc {{ project_op.add.pathname }} .doc {{ project_op.add.pathname }}
div(ng-if="project_op.remove") div(ng-if="project_op.remove")
.action Deleted .action #{translate("file-action-deleted")}
.doc {{ project_op.remove.pathname }} .doc {{ project_op.remove.pathname }}
div.users div.users
div.user(ng-repeat="update_user in update.meta.users") div.user(ng-repeat="update_user in update.meta.users")

View file

@ -67,18 +67,18 @@ aside.change-list(
div.description(ng-click="select()") div.description(ng-click="select()")
div.time {{ update.meta.end_ts | formatDate:'h:mm a' }} div.time {{ update.meta.end_ts | formatDate:'h:mm a' }}
div.action.action-edited(ng-if="history.isV2 && update.pathnames.length > 0") div.action.action-edited(ng-if="history.isV2 && update.pathnames.length > 0")
| Edited | #{translate("file-action-edited")}
div.docs(ng-repeat="pathname in update.pathnames") div.docs(ng-repeat="pathname in update.pathnames")
.doc {{ pathname }} .doc {{ pathname }}
div.docs(ng-repeat="project_op in update.project_ops") div.docs(ng-repeat="project_op in update.project_ops")
div(ng-if="project_op.rename") div(ng-if="project_op.rename")
.action Renamed .action #{translate("file-action-renamed")}
.doc {{ project_op.rename.pathname }} → {{ project_op.rename.newPathname }} .doc {{ project_op.rename.pathname }} → {{ project_op.rename.newPathname }}
div(ng-if="project_op.add") div(ng-if="project_op.add")
.action Created .action #{translate("file-action-created")}
.doc {{ project_op.add.pathname }} .doc {{ project_op.add.pathname }}
div(ng-if="project_op.remove") div(ng-if="project_op.remove")
.action Deleted .action #{translate("file-action-deleted")}
.doc {{ project_op.remove.pathname }} .doc {{ project_op.remove.pathname }}
div.users div.users
div.user(ng-repeat="update_user in update.meta.users") div.user(ng-repeat="update_user in update.meta.users")
@ -133,12 +133,20 @@ script(type="text/ng-template", id="historyEntryTpl")
li.history-entry-change( li.history-entry-change(
ng-repeat="pathname in ::$ctrl.entry.pathnames" ng-repeat="pathname in ::$ctrl.entry.pathnames"
) )
span.history-entry-change-action Edited span.history-entry-change-action #{translate("file-action-edited")}
span.history-entry-change-doc {{ ::pathname }} span.history-entry-change-doc {{ ::pathname }}
li.history-entry-change( li.history-entry-change(
ng-repeat="project_op in ::$ctrl.entry.project_ops" ng-repeat="project_op in ::$ctrl.entry.project_ops"
) )
span.history-entry-change-action {{ ::$ctrl.getProjectOpAction(project_op) }} span.history-entry-change-action(
ng-if="::project_op.rename"
) #{translate("file-action-renamed")}
span.history-entry-change-action(
ng-if="::project_op.add"
) #{translate("file-action-created")}
span.history-entry-change-action(
ng-if="::project_op.remove"
) #{translate("file-action-deleted")}
span.history-entry-change-doc {{ ::$ctrl.getProjectOpDoc(project_op) }} span.history-entry-change-doc {{ ::$ctrl.getProjectOpDoc(project_op) }}
.history-entry-metadata .history-entry-metadata
time.history-entry-metadata-time {{ ::$ctrl.entry.meta.end_ts | formatDate:'h:mm a' }} time.history-entry-metadata-time {{ ::$ctrl.entry.meta.end_ts | formatDate:'h:mm a' }}

View file

@ -4,10 +4,10 @@
span(ng-show="history.loadingFileTree") span(ng-show="history.loadingFileTree")
i.fa.fa-spin.fa-refresh i.fa.fa-spin.fa-refresh
|    #{translate("loading")}... |    #{translate("loading")}...
span(ng-show="!history.loadingFileTree") Browsing project as of  span(ng-show="!history.loadingFileTree") #{translate("browsing-project-as-of")} 
time.history-toolbar-time {{ history.selection.updates[0].meta.end_ts | formatDate:'Do MMM YYYY, h:mm a' }} time.history-toolbar-time {{ history.selection.updates[0].meta.end_ts | formatDate:'Do MMM YYYY, h:mm a' }}
.history-toolbar-btn( .history-toolbar-btn(
ng-click="toggleHistoryViewMode();" ng-click="toggleHistoryViewMode();"
) )
i.fa i.fa
| Compare project versions | #{translate("compare-project-versions")}

View file

@ -5,10 +5,6 @@ define [
historyEntryController = ($scope, $element, $attrs) -> historyEntryController = ($scope, $element, $attrs) ->
ctrl = @ ctrl = @
ctrl.displayName = displayNameForUser ctrl.displayName = displayNameForUser
ctrl.getProjectOpAction = (projectOp) ->
if projectOp.rename? then "Renamed"
else if projectOp.add? then "Created"
else if projectOp.remove? then "Deleted"
ctrl.getProjectOpDoc = (projectOp) -> ctrl.getProjectOpDoc = (projectOp) ->
if projectOp.rename? then "#{ projectOp.rename.pathname}#{ projectOp.rename.newPathname }" if projectOp.rename? then "#{ projectOp.rename.pathname}#{ projectOp.rename.newPathname }"
else if projectOp.add? then "#{ projectOp.add.pathname}" else if projectOp.add? then "#{ projectOp.add.pathname}"