Skip to content

Commit 291cb96

Browse files
author
Jamie Curnow
committed
More i18n
1 parent 50dd227 commit 291cb96

File tree

12 files changed

+56
-40
lines changed

12 files changed

+56
-40
lines changed

src/frontend/js/app/nginx/proxy/delete.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<form>
88
<div class="row">
99
<div class="col-sm-12 col-md-12">
10+
<%= i18n('proxy-hosts', 'delete-confirm', {domains: domain_names.join(', ')}) %>
1011
Are you sure you want to delete the Proxy host for: <strong><%- domain_names.join(', ') %></strong>?
1112
<% if (ssl_enabled) { %>
1213
<br><br>
13-
The SSL certificates attached will be removed, this action cannot be recovered.
14+
<%- i18n('proxy-hosts', 'delete-ssl') %>
1415
<% } %>
1516
</div>
1617
</div>

src/frontend/js/app/nginx/proxy/form.ejs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form>
88
<ul class="nav nav-tabs" role="tablist">
99
<li role="presentation" class="nav-item"><a href="#details" aria-controls="tab1" role="tab" data-toggle="tab" class="nav-link active"><i class="fe fe-zap"></i> <%- i18n('all-hosts', 'details') %></a></li>
10-
<li role="presentation" class="nav-item"><a href="#ssl-options" aria-controls="tab2" role="tab" data-toggle="tab" class="nav-link"><i class="fe fe-shield"></i> <%- i18n('all-hosts', 'SSL') %></a></li>
10+
<li role="presentation" class="nav-item"><a href="#ssl-options" aria-controls="tab2" role="tab" data-toggle="tab" class="nav-link"><i class="fe fe-shield"></i> <%- i18n('str', 'ssl') %></a></li>
1111
</ul>
1212
<div class="tab-content">
1313
<!-- Details -->
@@ -62,11 +62,11 @@
6262
<div class="selectgroup w-100">
6363
<label class="selectgroup-item">
6464
<input type="radio" name="ssl_provider" value="letsencrypt" class="selectgroup-input"<%- ssl_provider !== 'other' ? ' checked' : '' %>>
65-
<span class="selectgroup-button"><%- i18n('all-hosts', 'letsencrypt') %></span>
65+
<span class="selectgroup-button"><%- i18n('ssl', 'letsencrypt') %></span>
6666
</label>
6767
<label class="selectgroup-item">
6868
<input type="radio" name="ssl_provider" value="other" class="selectgroup-input"<%- ssl_provider === 'other' ? ' checked' : '' %>>
69-
<span class="selectgroup-button"><%- i18n('all-hosts', 'other-ssl') %></span>
69+
<span class="selectgroup-button"><%- i18n('ssl', 'other') %></span>
7070
</label>
7171
</div>
7272
</div>
@@ -75,7 +75,7 @@
7575
<!-- Lets encrypt -->
7676
<div class="col-sm-12 col-md-12 letsencrypt-ssl">
7777
<div class="form-group">
78-
<label class="form-label"><%- i18n('all-hosts', 'letsencrypt-email') %> <span class="form-required">*</span></label>
78+
<label class="form-label"><%- i18n('ssl', 'letsencrypt-email') %> <span class="form-required">*</span></label>
7979
<input name="meta[letsencrypt_email]" type="email" class="form-control" placeholder="" value="<%- getLetsencryptEmail() %>" required>
8080
</div>
8181
</div>
@@ -84,7 +84,7 @@
8484
<label class="custom-switch">
8585
<input type="checkbox" class="custom-switch-input" name="meta[letsencrypt_agree]" value="1" required<%- getLetsencryptAgree() ? ' checked' : '' %>>
8686
<span class="custom-switch-indicator"></span>
87-
<span class="custom-switch-description"><%= i18n('all-hosts', 'letsencrypt-agree', {url: 'https://letsencrypt.org/repository/'}) %> <span class="form-required">*</span></span>
87+
<span class="custom-switch-description"><%= i18n('ssl', 'letsencrypt-agree', {url: 'https://letsencrypt.org/repository/'}) %> <span class="form-required">*</span></span>
8888
</label>
8989
</div>
9090
</div>

src/frontend/js/app/nginx/proxy/list/item.ejs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
%>
1414
</div>
1515
<div class="small text-muted">
16-
Created: <%- formatDbDate(created_on, 'Do MMMM YYYY') %>
16+
<%- i18n('str', 'created-on', {date: formatDbDate(created_on, 'Do MMMM YYYY')}) %>
1717
</div>
1818
</td>
1919
<td>
2020
<div class="text-monospace"><%- forward_ip %>:<%- forward_port %></div>
2121
</td>
2222
<td>
23-
<div><%- ssl_enabled && ssl_provider ? ssl_provider : 'HTTP only' %></div>
23+
<div><%- ssl_enabled && ssl_provider ? i18n('ssl', ssl_provider) : i18n('ssl', 'none') %></div>
2424
</td>
2525
<td>
26-
<div><%- access_list_id ? access_list.name : 'Public' %></div>
26+
<div><%- access_list_id ? access_list.name : i18n('str', 'public') %></div>
2727
</td>
2828
<% if (canManage) { %>
2929
<td class="text-center">
3030
<div class="item-action dropdown">
3131
<a href="#" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
3232
<div class="dropdown-menu dropdown-menu-right">
33-
<a href="#" class="edit dropdown-item"><i class="dropdown-icon fe fe-edit"></i> Edit</a>
34-
<a href="#" class="logs dropdown-item"><i class="dropdown-icon fe fe-book"></i> Logs</a>
33+
<a href="#" class="edit dropdown-item"><i class="dropdown-icon fe fe-edit"></i> <%- i18n('str', 'edit') %></a>
34+
<a href="#" class="logs dropdown-item"><i class="dropdown-icon fe fe-book"></i> <%- i18n('str', 'logs') %></a>
3535
<div class="dropdown-divider"></div>
36-
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> Delete</a>
36+
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> <%- i18n('str', 'delete') %></a>
3737
</div>
3838
</div>
3939
</td>

src/frontend/js/app/nginx/proxy/list/item.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
'use strict';
22

3-
const Mn = require('backbone.marionette');
4-
const Controller = require('../../../controller');
5-
const Api = require('../../../api');
6-
const Cache = require('../../../cache');
7-
const template = require('./item.ejs');
3+
const Mn = require('backbone.marionette');
4+
const App = require('../../../main');
5+
const template = require('./item.ejs');
86

97
module.exports = Mn.View.extend({
108
template: template,
@@ -18,17 +16,17 @@ module.exports = Mn.View.extend({
1816
events: {
1917
'click @ui.edit': function (e) {
2018
e.preventDefault();
21-
Controller.showNginxProxyForm(this.model);
19+
App.Controller.showNginxProxyForm(this.model);
2220
},
2321

2422
'click @ui.delete': function (e) {
2523
e.preventDefault();
26-
Controller.showNginxProxyDeleteConfirm(this.model);
24+
App.Controller.showNginxProxyDeleteConfirm(this.model);
2725
}
2826
},
2927

3028
templateContext: {
31-
canManage: Cache.User.canManage('proxy_hosts')
29+
canManage: App.Cache.User.canManage('proxy_hosts')
3230
},
3331

3432
initialize: function () {

src/frontend/js/app/nginx/proxy/list/main.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<thead>
22
<th width="30">&nbsp;</th>
3-
<th>Source</th>
4-
<th>Destination</th>
5-
<th>SSL</th>
6-
<th>Access</th>
3+
<th><%- i18n('str', 'source') %></th>
4+
<th><%- i18n('str', 'destination') %></th>
5+
<th><%- i18n('str', 'ssl') %></th>
6+
<th><%- i18n('str', 'access') %></th>
77
<% if (canManage) { %>
88
<th>&nbsp;</th>
99
<% } %>

src/frontend/js/app/nginx/proxy/list/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

33
const Mn = require('backbone.marionette');
4+
const App = require('../../../main');
45
const ItemView = require('./item');
56
const template = require('./main.ejs');
6-
const Cache = require('../../../cache');
77

88
const TableBody = Mn.CollectionView.extend({
99
tagName: 'tbody',
@@ -23,7 +23,7 @@ module.exports = Mn.View.extend({
2323
},
2424

2525
templateContext: {
26-
canManage: Cache.User.canManage('proxy_hosts')
26+
canManage: App.Cache.User.canManage('proxy_hosts')
2727
},
2828

2929
onRender: function () {

src/frontend/js/i18n/messages.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
"cancel": "Cancel",
1515
"sure": "Yes I'm Sure",
1616
"disabled": "Disabled",
17-
"choose-file": "Choose file"
17+
"choose-file": "Choose file",
18+
"source": "Source",
19+
"destination": "Destination",
20+
"ssl": "SSL",
21+
"access": "Access",
22+
"public": "Public",
23+
"edit": "Edit",
24+
"delete": "Delete",
25+
"logs": "Logs"
1826
},
1927
"login": {
2028
"title": "Login to your account"
@@ -48,26 +56,30 @@
4856
"all-hosts": {
4957
"empty-subtitle": "{manage, select, true{Why don't you create one?} other{And you don't have permission to create one.}}",
5058
"details": "Details",
51-
"ssl": "SSL",
5259
"enable-ssl": "Enable SSL",
5360
"force-ssl": "Force SSL",
5461
"___domain-names": "Domain Names",
5562
"cert-provider": "Certificate Provider",
56-
"other-ssl": "Other",
57-
"letsencrypt": "Let's Encrypt",
58-
"letsencrypt-email": "Email Address for Let's Encrypt",
59-
"letsencrypt-agree": "I Agree to the <a href=\"{url}\" target=\"_blank\">Let's Encrypt Terms of Service</a>",
6063
"other-certificate": "Certificate",
6164
"other-certificate-key": "Certificate Key"
6265
},
66+
"ssl": {
67+
"letsencrypt": "Let's Encrypt",
68+
"other": "Other",
69+
"none": "HTTP only",
70+
"letsencrypt-email": "Email Address for Let's Encrypt",
71+
"letsencrypt-agree": "I Agree to the <a href=\"{url}\" target=\"_blank\">Let's Encrypt Terms of Service</a>"
72+
},
6373
"proxy-hosts": {
6474
"title": "Proxy Hosts",
6575
"empty": "There are no Proxy Hosts",
6676
"add": "Add Proxy Host",
6777
"form-title": "{id, select, undefined{New} other{Edit}} Proxy Host",
6878
"forward-ip": "Forward IP",
6979
"forward-port": "Forward Port",
70-
"delete": "Delete Proxy Host"
80+
"delete": "Delete Proxy Host",
81+
"delete-confirm": "Are you sure you want to delete the Proxy host for: <strong>{domains}</strong>?",
82+
"delete-ssl": "The SSL certificates attached will be removed, this action cannot be recovered."
7183
},
7284
"redirection-hosts": {
7385
"title": "Redirection Hosts"

src/frontend/js/models/dead-host.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ const model = Backbone.Model.extend({
77

88
defaults: function () {
99
return {
10-
created_on: null,
11-
modified_on: null,
12-
owner: null,
13-
domain_name: '',
14-
ssl_enabled: false,
15-
ssl_provider: false,
16-
meta: []
10+
id: 0,
11+
created_on: null,
12+
modified_on: null,
13+
owner: null,
14+
domain_name: '',
15+
ssl_enabled: false,
16+
ssl_provider: false,
17+
meta: []
1718
};
1819
}
1920
});

src/frontend/js/models/proxy-host.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const model = Backbone.Model.extend({
77

88
defaults: function () {
99
return {
10+
id: 0,
1011
created_on: null,
1112
modified_on: null,
1213
domain_names: [],

src/frontend/js/models/redirection-host.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const model = Backbone.Model.extend({
77

88
defaults: function () {
99
return {
10+
id: 0,
1011
created_on: null,
1112
modified_on: null,
1213
owner: null,

0 commit comments

Comments
 (0)