Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 95c4e77

Browse files
author
jonaswinkler
committed
added many localization markers to the front end #123
1 parent b7c118a commit 95c4e77

27 files changed

+178
-210
lines changed

src-ui/src/app/components/app-frame/app-frame.component.html

+21-35
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<nav class="navbar navbar-dark sticky-top bg-primary flex-md-nowrap p-0 shadow">
22
<span class="navbar-brand col-md-3 col-lg-2 mr-0 px-3" href="#">
33
<img src="assets/logo-dark-notext.svg" height="18px" class="mr-2">
4-
Paperless-ng
4+
<ng-container i18n="app title">Paperless-ng</ng-container>
55
</span>
66
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-toggle="collapse"
77
data-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation"
88
(click)="isMenuCollapsed = !isMenuCollapsed">
99
<span class="navbar-toggler-icon"></span>
1010
</button>
1111
<form (ngSubmit)="search()" class="w-100 m-1">
12-
<input class="form-control form-control-dark" type="text" placeholder="Search" aria-label="Search"
13-
[formControl]="searchField" [ngbTypeahead]="searchAutoComplete" (selectItem)="itemSelected($event)">
12+
<input class="form-control form-control-dark" type="text" placeholder="Search for documents" aria-label="Search"
13+
[formControl]="searchField" [ngbTypeahead]="searchAutoComplete" (selectItem)="itemSelected($event)" i18n-placeholder>
1414
</form>
1515
</nav>
1616

@@ -28,136 +28,122 @@
2828
<a class="nav-link" routerLink="dashboard" routerLinkActive="active" (click)="closeMenu()">
2929
<svg class="sidebaricon" fill="currentColor">
3030
<use xlink:href="assets/bootstrap-icons.svg#house"/>
31-
</svg>
32-
Dashboard
31+
</svg>&nbsp;<ng-container i18n>Dashboard</ng-container>
3332
</a>
3433
</li>
3534
<li class="nav-item">
3635
<a class="nav-link" routerLink="documents" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}" (click)="closeMenu()">
3736
<svg class="sidebaricon" fill="currentColor">
3837
<use xlink:href="assets/bootstrap-icons.svg#files"/>
39-
</svg>
40-
Documents
38+
</svg>&nbsp;<ng-container i18n>Documents</ng-container>
4139
</a>
4240
</li>
4341
</ul>
4442

4543
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted" *ngIf='savedViewService.sidebarViews.length > 0'>
46-
<span>Saved views</span>
44+
<ng-container i18n>Saved views</ng-container>
4745
</h6>
4846
<ul class="nav flex-column mb-2">
4947
<li class="nav-item w-100" *ngFor="let view of savedViewService.sidebarViews">
5048
<a class="nav-link text-truncate" routerLink="view/{{view.id}}" routerLinkActive="active" (click)="closeMenu()">
5149
<svg class="sidebaricon" fill="currentColor">
5250
<use xlink:href="assets/bootstrap-icons.svg#funnel"/>
53-
</svg>
54-
{{view.name}}
51+
</svg>&nbsp;{{view.name}}
5552
</a>
5653
</li>
5754
</ul>
5855

5956
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted" *ngIf='openDocuments.length > 0'>
60-
<span>Open documents</span>
57+
<ng-container i18n>Open documents</ng-container>
6158
</h6>
6259
<ul class="nav flex-column mb-2">
6360
<li class="nav-item w-100" *ngFor='let d of openDocuments'>
6461
<a class="nav-link text-truncate" routerLink="documents/{{d.id}}" routerLinkActive="active" (click)="closeMenu()">
6562
<svg class="sidebaricon" fill="currentColor">
6663
<use xlink:href="assets/bootstrap-icons.svg#file-text"/>
67-
</svg>
68-
{{d.title | documentTitle}}
64+
</svg>&nbsp;{{d.title | documentTitle}}
6965
</a>
7066
</li>
7167
<li class="nav-item w-100" *ngIf="openDocuments.length > 1">
7268
<a class="nav-link text-truncate" [routerLink]="" (click)="closeAll()">
7369
<svg class="sidebaricon" fill="currentColor">
7470
<use xlink:href="assets/bootstrap-icons.svg#x"/>
75-
</svg>
76-
Close all
71+
</svg>&nbsp;<ng-container i18n>Close all</ng-container>
7772
</a>
7873
</li>
7974
</ul>
8075

8176
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
82-
<span>Manage</span>
77+
<ng-container i18n>Manage</ng-container>
8378
</h6>
8479
<ul class="nav flex-column mb-2">
8580
<li class="nav-item">
8681
<a class="nav-link" routerLink="correspondents" routerLinkActive="active" (click)="closeMenu()">
8782
<svg class="sidebaricon" fill="currentColor">
8883
<use xlink:href="assets/bootstrap-icons.svg#person"/>
89-
</svg>
90-
Correspondents
84+
</svg>&nbsp;<ng-container i18n>Correspondents</ng-container>
9185
</a>
9286
</li>
9387
<li class="nav-item">
9488
<a class="nav-link" routerLink="tags" routerLinkActive="active" (click)="closeMenu()">
9589
<svg class="sidebaricon" fill="currentColor">
9690
<use xlink:href="assets/bootstrap-icons.svg#tags"/>
97-
</svg>
98-
Tags
91+
</svg>&nbsp;<ng-container i18n>Tags</ng-container>
9992
</a>
10093
</li>
10194
<li class="nav-item">
10295
<a class="nav-link" routerLink="documenttypes" routerLinkActive="active" (click)="closeMenu()">
10396
<svg class="sidebaricon" fill="currentColor">
10497
<use xlink:href="assets/bootstrap-icons.svg#hash"/>
105-
</svg>
106-
Document types
98+
</svg>&nbsp;<ng-container i18n>Document types</ng-container>
10799
</a>
108100
</li>
109101
<li class="nav-item">
110102
<a class="nav-link" routerLink="logs" routerLinkActive="active" (click)="closeMenu()">
111103
<svg class="sidebaricon" fill="currentColor">
112104
<use xlink:href="assets/bootstrap-icons.svg#text-left"/>
113-
</svg>
114-
Logs
105+
</svg>&nbsp;<ng-container i18n>Logs</ng-container>
115106
</a>
116107
</li>
117108
<li class="nav-item">
118109
<a class="nav-link" routerLink="settings" routerLinkActive="active" (click)="closeMenu()">
119110
<svg class="sidebaricon" fill="currentColor">
120111
<use xlink:href="assets/bootstrap-icons.svg#gear"/>
121-
</svg>
122-
Settings
112+
</svg>&nbsp;<ng-container i18n>Settings</ng-container>
123113
</a>
124114
</li>
125115
<li class="nav-item">
126116
<a class="nav-link" href="admin/">
127117
<svg class="sidebaricon" fill="currentColor">
128118
<use xlink:href="assets/bootstrap-icons.svg#toggles"/>
129-
</svg>
130-
Admin
119+
</svg>&nbsp;<ng-container i18n>Admin</ng-container>
131120
</a>
132121
</li>
133122
</ul>
134123

135124
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
136-
<span>Misc</span>
125+
<ng-container i18n>Misc</ng-container>
137126
</h6>
138127
<ul class="nav flex-column mb-2">
139128
<li class="nav-item">
140129
<a class="nav-link" target="_blank" rel="noopener noreferrer" href="https://paperless-ng.readthedocs.io/en/latest/">
141130
<svg class="sidebaricon" fill="currentColor">
142131
<use xlink:href="assets/bootstrap-icons.svg#question-circle"/>
143-
</svg>
144-
Documentation
132+
</svg>&nbsp;<ng-container i18n>Documentation</ng-container>
145133
</a>
146134
</li>
147135
<li class="nav-item">
148136
<a class="nav-link" target="_blank" rel="noopener noreferrer" href="https://github.com/jonaswinkler/paperless-ng">
149137
<svg class="sidebaricon" fill="currentColor">
150138
<use xlink:href="assets/bootstrap-icons.svg#link"/>
151-
</svg>
152-
GitHub
139+
</svg>&nbsp;<ng-container i18n>GitHub</ng-container>
153140
</a>
154141
</li>
155142
<li class="nav-item">
156143
<a class="nav-link" href="accounts/logout/">
157144
<svg class="sidebaricon" fill="currentColor">
158145
<use xlink:href="assets/bootstrap-icons.svg#door-open"/>
159-
</svg>
160-
Logout
146+
</svg>&nbsp;<ng-container i18n>Logout</ng-container>
161147
</a>
162148
</li>
163149
</ul>

src-ui/src/app/components/dashboard/dashboard.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<app-page-header title="Dashboard" [subTitle]="subtitle">
1+
<app-page-header title="Dashboard" [subTitle]="subtitle" i18n-title>
22
<img src="assets/logo.svg" height="80" class="m-2 d-none d-md-block">
33
</app-page-header>
44

src-ui/src/app/components/dashboard/dashboard.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ export class DashboardComponent implements OnInit {
2424
} else if (tagUsername && tagUsername.content) {
2525
return tagUsername.content
2626
} else {
27-
return null
27+
return "null"
2828
}
2929
}
3030

3131
get subtitle() {
3232
if (this.displayName) {
33-
return `Hello ${this.displayName}, welcome to Paperless-ng!`
33+
return $localize`Hello ${this.displayName}, welcome to Paperless-ng!`
3434
} else {
35-
return `Welcome to Paperless-ng!`
35+
return $localize`Welcome to Paperless-ng!`
3636
}
3737
}
3838

src-ui/src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<app-widget-frame [title]="savedView.name">
22

3-
<a header-buttons [routerLink]="" (click)="showAll()">Show all</a>
3+
<a header-buttons [routerLink]="" (click)="showAll()" i18n>Show all</a>
44

55

66
<table content class="table table-sm table-hover table-borderless">
77
<thead>
88
<tr>
9-
<th>Created</th>
10-
<th scope="col">Title</th>
9+
<th i18n>Created</th>
10+
<th scope="col" i18n>Title</th>
1111
</tr>
1212
</thead>
1313
<tbody>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<app-widget-frame title="Statistics">
1+
<app-widget-frame title="Statistics" i18n-title>
22
<ng-container content>
3-
<p class="card-text">Documents in inbox: {{statistics.documents_inbox}}</p>
4-
<p class="card-text">Total documents: {{statistics.documents_total}}</p>
3+
<p class="card-text" i18n>Documents in inbox: {{statistics.documents_inbox}}</p>
4+
<p class="card-text" i18n>Total documents: {{statistics.documents_total}}</p>
55
</ng-container>
66
</app-widget-frame>

src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<app-widget-frame title="Upload new documents">
1+
<app-widget-frame title="Upload new documents" i18n-title>
22

33
<div content>
44
<form>
5-
<ngx-file-drop dropZoneLabel="Drop documents here or" (onFileDrop)="dropped($event)"
5+
<ngx-file-drop dropZoneLabel="Drop documents here or" browseBtnLabel="Browse files" (onFileDrop)="dropped($event)"
66
(onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)" dropZoneClassName="bg-light card"
77
multiple="true" contentClassName="justify-content-center d-flex align-items-center p-5" [showBrowseBtn]=true
8-
browseBtnClassName="btn btn-sm btn-outline-primary ml-2">
8+
browseBtnClassName="btn btn-sm btn-outline-primary ml-2" i18n-dropZoneLabel i18n-browseBtnLabel>
99

1010
</ngx-file-drop>
1111
</form>
1212
<div *ngIf="uploadVisible" class="mt-3">
13-
<p>Uploading {{uploadStatus.length}} file(s)</p>
13+
<p i18n>Uploading {{uploadStatus.length}} file(s)</p>
1414
<ngb-progressbar [value]="loadedSum" [max]="totalSum" [striped]="true" [animated]="uploadStatus.length > 0">
1515
</ngb-progressbar>
1616
</div>

src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ export class UploadFileWidgetComponent implements OnInit {
6060
} else if (event.type == HttpEventType.Response) {
6161
this.uploadStatus.splice(this.uploadStatus.indexOf(uploadStatusObject), 1)
6262
this.completedFiles += 1
63-
this.toastService.showToast(Toast.make("Information", "The document has been uploaded and will be processed by the consumer shortly."))
63+
this.toastService.showToast(Toast.make("Information", $localize`The document has been uploaded and will be processed by the consumer shortly.`))
6464
}
6565

6666
}, error => {
6767
this.uploadStatus.splice(this.uploadStatus.indexOf(uploadStatusObject), 1)
6868
this.completedFiles += 1
6969
switch (error.status) {
7070
case 400: {
71-
this.toastService.showToast(Toast.makeError(`There was an error while uploading the document: ${error.error.document}`))
71+
this.toastService.showToast(Toast.makeError($localize`There was an error while uploading the document: ${error.error.document}`))
7272
break;
7373
}
7474
default: {
75-
this.toastService.showToast(Toast.makeError("An error has occurred while uploading the document. Sorry!"))
75+
this.toastService.showToast(Toast.makeError($localize`An error has occurred while uploading the document. Sorry!`))
7676
break;
7777
}
7878
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<app-widget-frame title="First steps">
1+
<app-widget-frame title="First steps" i18n-title>
22

33
<ng-container content>
44
<img src="assets/save-filter.png" class="float-right">
5-
<p>Paperless is running! :)</p>
6-
<p>You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list.
5+
<p i18n>Paperless is running! :)</p>
6+
<p i18n>You can start uploading documents by dropping them in the file upload box to the right or by dropping them in the configured consumption folder and they'll start showing up in the documents list.
77
After you've added some metadata to your documents, use the filtering mechanisms of paperless to create custom views (such as 'Recently added', 'Tagged TODO') and have them displayed on the dashboard instead of this message.</p>
8-
<p>Paperless offers some more features that try to make your life easier, such as:</p>
8+
<p i18n>Paperless offers some more features that try to make your life easier, such as:</p>
99
<ul>
10-
<li>Once you've got a couple documents in paperless and added metadata to them, paperless can assign that metadata to new documents automatically.</li>
11-
<li>You can configure paperless to read your mails and add documents from attached files.</li>
10+
<li i18n>Once you've got a couple documents in paperless and added metadata to them, paperless can assign that metadata to new documents automatically.</li>
11+
<li i18n>You can configure paperless to read your mails and add documents from attached files.</li>
1212
</ul>
13-
<p>Consult the documentation on how to use these features. The section on basic usage also has some information on how to use paperless in general.</p>
13+
<p i18n>Consult the documentation on how to use these features. The section on basic usage also has some information on how to use paperless in general.</p>
1414
</ng-container>
1515

1616
</app-widget-frame>

0 commit comments

Comments
 (0)