Move strings to i18n for routing & server domain sections

This commit is contained in:
MattIPv4 2020-06-01 17:37:18 +01:00
parent 49406bfd46
commit d655801e36
5 changed files with 67 additions and 14 deletions

View file

@ -20,5 +20,7 @@ import php from './php';
import presets from './presets'; import presets from './presets';
import python from './python'; import python from './python';
import reverseProxy from './reverse_proxy'; import reverseProxy from './reverse_proxy';
import routing from './routing';
import server from './server';
export default { https, logging, php, presets, python, reverseProxy }; export default { https, logging, php, presets, python, reverseProxy, routing, server };

View file

@ -0,0 +1,25 @@
/*
Copyright 2020 DigitalOcean
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export default {
enable: 'enable',
fallbackRouting: 'Fallback routing',
fallbackRoutingPhpPath: 'Fallback routing PHP path',
legacyPhpRouting: 'Legacy PHP routing',
enableLegacyRouting: 'enable legacy routing',
path: 'Path',
routing: 'Routing',
};

View file

@ -0,0 +1,26 @@
/*
Copyright 2020 DigitalOcean
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export default {
domain: 'Domain',
path: 'Path',
documentRoot: 'Document root',
wwwSubdomain: 'www subdomain',
cdnSubdomain: 'CDN subdomain',
redirectSubdomains: 'Redirect subdomains',
routing: 'Routing',
server: 'Server',
};

View file

@ -26,7 +26,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="root" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="root" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i> <i slot="extra" class="icon fas fa-check"></i>
enable {{ i18n.templates.domainSections.routing.enable }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -56,7 +56,7 @@ limitations under the License.
<div v-if="fallbackHtmlEnabled || fallbackPhpEnabled" class="field is-horizontal is-aligned-top"> <div v-if="fallbackHtmlEnabled || fallbackPhpEnabled" class="field is-horizontal is-aligned-top">
<div class="field-label"> <div class="field-label">
<label class="label">Fallback routing</label> <label class="label">{{ i18n.templates.domainSections.routing.fallbackRouting }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -82,7 +82,7 @@ limitations under the License.
<div v-if="fallbackPhpPathEnabled" class="field is-horizontal"> <div v-if="fallbackPhpPathEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">Fallback routing PHP path</label> <label class="label">{{ i18n.templates.domainSections.routing.fallbackRoutingPhpPath }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div :class="`field${fallbackPhpPathChanged ? ' is-changed' : ''}`"> <div :class="`field${fallbackPhpPathChanged ? ' is-changed' : ''}`">
@ -99,7 +99,7 @@ limitations under the License.
<div v-if="legacyPhpRoutingEnabled" class="field is-horizontal"> <div v-if="legacyPhpRoutingEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">Legacy PHP routing</label> <label class="label">{{ i18n.templates.domainSections.routing.legacyPhpRouting }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -107,7 +107,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="legacyPhpRouting" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="legacyPhpRouting" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i> <i slot="extra" class="icon fas fa-check"></i>
enable legacy routing {{ i18n.templates.domainSections.routing.enableLegacyRouting }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -154,7 +154,7 @@ limitations under the License.
export default { export default {
name: 'DomainRouting', // Component name name: 'DomainRouting', // Component name
display: 'Routing', // Display name for tab display: i18n.templates.domainSections.routing.routing, // Display name for tab
key: 'routing', // Key for data in parent key: 'routing', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: { components: {

View file

@ -18,21 +18,21 @@ limitations under the License.
<div> <div>
<div class="field-row"> <div class="field-row">
<div class="field"> <div class="field">
<label class="label">Domain</label> <label class="label">{{ i18n.templates.domainSections.server.domain }}</label>
<div :class="`control${domainChanged ? ' is-changed' : ''}`"> <div :class="`control${domainChanged ? ' is-changed' : ''}`">
<input v-model="domain" class="input" type="text" :placeholder="domainDefault" /> <input v-model="domain" class="input" type="text" :placeholder="domainDefault" />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Path</label> <label class="label">{{ i18n.templates.domainSections.server.path }}</label>
<div :class="`control${pathChanged ? ' is-changed' : ''}`"> <div :class="`control${pathChanged ? ' is-changed' : ''}`">
<input v-model="path" class="input" type="text" :placeholder="`/var/www/${domain}`" /> <input v-model="path" class="input" type="text" :placeholder="`/var/www/${domain}`" />
</div> </div>
</div> </div>
<div class="field"> <div class="field">
<label class="label">Document root</label> <label class="label">{{ i18n.templates.domainSections.server.documentRoot }}</label>
<div :class="`control${documentRootChanged ? ' is-changed' : ''}`"> <div :class="`control${documentRootChanged ? ' is-changed' : ''}`">
<input v-model="documentRoot" class="input" type="text" :placeholder="documentRootDefault" /> <input v-model="documentRoot" class="input" type="text" :placeholder="documentRootDefault" />
</div> </div>
@ -41,7 +41,7 @@ limitations under the License.
<div class="field is-horizontal"> <div class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">www subdomain</label> <label class="label">{{ i18n.templates.domainSections.server.wwwSubdomain }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -59,7 +59,7 @@ limitations under the License.
<div v-if="cdnSubdomainEnabled" class="field is-horizontal"> <div v-if="cdnSubdomainEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">CDN subdomain</label> <label class="label">{{ i18n.templates.domainSections.server.cdnSubdomain }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -77,7 +77,7 @@ limitations under the License.
<div class="field is-horizontal"> <div class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">Redirect subdomains</label> <label class="label">{{ i18n.templates.domainSections.server.redirectSubdomains }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -168,7 +168,7 @@ limitations under the License.
export default { export default {
name: 'DomainServer', // Component name name: 'DomainServer', // Component name
display: 'Server', // Display name for tab display: i18n.templates.domainSections.server.server, // Display name for tab
key: 'server', // Key for data in parent key: 'server', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: { components: {