Skip to content

Commit e0e20b3

Browse files
committed
Misc localization
1 parent 52210cc commit e0e20b3

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

src/Skybrud.Umbraco.Redirects/wwwroot/Elements/destination.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ export class RedirectsDestinationElement extends UmbElementMixin(LitElement) {
205205
return html`
206206
<div>
207207
${when(!this.value, () => html`
208-
<uui-button class="add-btn" look="placeholder" color="default" label="Add" @click=${this.edit}>Add</uui-button>
208+
<uui-button class="add-btn" look="placeholder" color="default" label="${this.localize.term("general_add")}" @click=${this.edit}>
209+
${this.localize.term("general_add")}
210+
</uui-button>
209211
`)}
210212
${when(this.value, () => html`
211213
<uui-ref-node name="${this.value.name}" detail="${this.value.url}${this.value.query}${this.value.fragment}" selectable="false" selectOnly="true">

src/Skybrud.Umbraco.Redirects/wwwroot/Localization/da-DK.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
redirects: {
33
save: "Gem",
44
addRedirect: "Tilføj redirect",
5+
addRedirectTitle: "Tilføj nyt redirect",
6+
editRedirectTitle: "Rediger redirect",
57
reload: "Genindlæs",
68
enabled: "Aktiveret",
79
disabled: "Deaktiveret",

src/Skybrud.Umbraco.Redirects/wwwroot/Localization/en-US.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
redirects: {
33
save: "Save",
44
addRedirect: "Add redirect",
5+
addRedirectTitle: "Add new redirect",
6+
editRedirectTitle: "Edit redirect",
57
reload: "Reload",
68
enabled: "Enabled",
79
disabled: "Disabled",

src/Skybrud.Umbraco.Redirects/wwwroot/Modals/add-redirect.element.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ export class AddRedirectModelElement extends UmbModalBaseElement {
121121
}
122122

123123
render() {
124+
const self = this;
125+
function term(key) { return self.localize.term("redirects_" + key); }
126+
function label(key) { return self.localize.term("redirectsLabels_" + key); }
127+
function property(key) { return self.localize.term("redirectsProperties_" + key); }
124128
return html`
125-
<umb-body-layout headline="Add new redirect">
129+
<umb-body-layout headline="${term("addRedirectTitle")}">
126130
<uui-box>
127131
<div class="property">
128132
<div>
@@ -139,55 +143,55 @@ export class AddRedirectModelElement extends UmbModalBaseElement {
139143
</div>
140144
<div class="property">
141145
<div>
142-
<strong>Original URL<span style="color: red;">*</span></strong><br />
143-
<small>Specify the original URL to match from which the user should be redirected to the destination.</small>
146+
<strong>${property("originalUrl")}<span style="color: red;">*</span></strong><br />
147+
<small>${property("originalUrlDescription")}</small>
144148
</div>
145149
<div>
146-
<uui-input id="originalUrl" label="Original URL"></uui-input>
150+
<uui-input id="originalUrl" label="${property("originalUrl")}"></uui-input>
147151
</div>
148152
</div>
149153
<div class="property">
150154
<div>
151-
<strong>Destination<span style="color: red;">*</span></strong><br />
152-
<small>Select the page or URL the user should be redirected to.</small>
155+
<strong>${property("destination")}<span style="color: red;">*</span></strong><br />
156+
<small>${property("destinationDescription")}</small>
153157
</div>
154158
<div>
155159
<redirects-destination id="destination"></redirects-destination>
156160
</div>
157161
</div>
158-
<h4>Advanced Options</h4>
162+
<h4>${label("advancedOptions")}</h4>
159163
<div class="property">
160164
<div>
161-
<strong>Redirect type</strong><br />
162-
<small>Select the type of the redirect. Notice that browsers will remember permanent redirects.</small>
165+
<strong>${property("redirectType")}</strong><br />
166+
<small>${property("redirectTypeDescription")}</small>
163167
</div>
164168
<div>
165169
<uui-radio-group name="redirectType">
166-
<uui-radio id="redirectTypePermanent" value="permanent" label="Permanent" checked="checked"></uui-radio>
167-
<uui-radio id="redirectTypeTemporary" value="temporary" label="Temporary"></uui-radio>
170+
<uui-radio id="redirectTypePermanent" value="permanent" label="${term("permanent")}" checked="checked"></uui-radio>
171+
<uui-radio id="redirectTypeTemporary" value="temporary" label="${term("temporary")}"></uui-radio>
168172
</uui-radio-group>
169173
</div>
170174
</div>
171175
<div class="property">
172176
<div>
173-
<strong>Forward query string</strong><br />
174-
<small>When enabled, the query string of the original request is forwarded to the redirect location (pass through).</small>
177+
<strong>${property("forwardQueryString")}</strong><br />
178+
<small>${property("forwardQueryStringDescription")}</small>
175179
</div>
176180
<div>
177181
<uui-radio-group name="forward">
178-
<uui-radio id="forwardEnabled" value="enabled" label="Enabled"></uui-radio>
179-
<uui-radio id="forwardDisabled" value="disabled" label="Disabled" checked="true"></uui-radio>
182+
<uui-radio id="forwardEnabled" value="enabled" label="${term("enabled")}"></uui-radio>
183+
<uui-radio id="forwardDisabled" value="disabled" label="${term("disabled")}" checked="true"></uui-radio>
180184
</uui-radio-group>
181185
</div>
182186
</div>
183187
</uui-box>
184188
<div slot="actions">
185-
<uui-button id="cancel" label="Cancel" @click="${this.handleCancel}">Cancel</uui-button>
189+
<uui-button id="cancel" label="${this.localize.term("general_cancel")}" @click="${this.handleCancel}">${this.localize.term("general_cancel")}</uui-button>
186190
<uui-button
187191
id="submit"
188192
color='positive'
189193
look="primary"
190-
label="Submit"
194+
label="${term("save")}"
191195
state="${this.submitButtonState}"
192196
@click="${this.handleConfirm}"></uui-button>
193197
</div>

src/Skybrud.Umbraco.Redirects/wwwroot/Modals/edit-redirect.element.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class EditRedirectModalElement extends UmbModalBaseElement {
6565

6666
// Update the component value
6767
this.updateValue({
68-
title: redirect?.key ? "Edit redirect" : "Add new redirect",
68+
title: redirect?.key ? self.localize.term("redirects_editRedirectTitle") : self.localize.term("redirects_addRedirectTitle"),
6969
redirect: redirect
7070
});
7171

0 commit comments

Comments
 (0)