Move all global section strings to i18n

This commit is contained in:
MattIPv4
2020-06-01 20:39:46 +01:00
parent d655801e36
commit 84f3a296d8
19 changed files with 313 additions and 79 deletions

View File

@@ -18,13 +18,13 @@ limitations under the License.
<div>
<div v-if="!sslProfileEnabled" class="field is-horizontal is-aligned-top">
<div class="field-label">
<label class="label">SSL profile</label>
<label class="label">{{ i18n.templates.globalSections.https.sslProfile }}</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<label class="text">
HTTPS must be enabled on at least one site to configure global HTTPS settings.
{{ i18n.templates.globalSections.https.httpsMustBeEnabledOnOneSite }}
</label>
</div>
</div>
@@ -34,7 +34,7 @@ limitations under the License.
<template v-else>
<div class="field is-horizontal is-aligned-top">
<div class="field-label">
<label class="label">SSL profile</label>
<label class="label">{{ i18n.templates.globalSections.https.sslProfile }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -56,7 +56,7 @@ limitations under the License.
<div class="field is-horizontal is-aligned-top">
<div class="field-label">
<label class="label">OCSP DNS Resolvers</label>
<label class="label">{{ i18n.templates.globalSections.https.ocspDnsResolvers }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -64,7 +64,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="ocspCloudflare" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
Cloudflare Resolver
{{ i18n.templates.globalSections.https.cloudflareResolver }}
</PrettyCheck>
</div>
</div>
@@ -72,7 +72,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="ocspGoogle" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
Google Public DNS
{{ i18n.templates.globalSections.https.googlePublicDns }}
</PrettyCheck>
</div>
</div>
@@ -80,7 +80,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="ocspOpenDns" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
OpenDNS
{{ i18n.templates.globalSections.https.openDns }}
</PrettyCheck>
</div>
</div>
@@ -90,7 +90,7 @@ limitations under the License.
<div v-if="letsEncryptRootEnabled" class="field is-horizontal">
<div class="field-label">
<label class="label">Let's Encrypt webroot</label>
<label class="label">{{ i18n.templates.globalSections.https.letsEncryptWebroot }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -119,9 +119,9 @@ limitations under the License.
sslProfile: {
default: 'intermediate',
options: {
modern: 'Mozilla Modern',
intermediate: 'Mozilla Intermediate',
old: 'Mozilla Old',
modern: i18n.templates.globalSections.https.mozillaModern,
intermediate: i18n.templates.globalSections.https.mozillaIntermediate,
old: i18n.templates.globalSections.https.mozillaOld,
},
enabled: true,
},
@@ -145,7 +145,7 @@ limitations under the License.
export default {
name: 'GlobalHTTPS', // Component name
display: 'HTTPS', // Display name for tab
display: i18n.templates.globalSections.https.https, // Display name for tab
key: 'https', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {

View File

@@ -60,7 +60,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="logNotFound" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable file not found error logging in error_log
{{ i18n.templates.globalSections.logging.enableFileNotFoundErrorLogging }} error_log
</PrettyCheck>
</div>
</div>
@@ -93,7 +93,7 @@ limitations under the License.
export default {
name: 'GlobalLogging', // Component name
display: 'Logging', // Display name for tab
display: i18n.templates.globalSections.logging.logging, // Display name for tab
key: 'logging', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {

View File

@@ -18,7 +18,7 @@ limitations under the License.
<div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">NGINX config directory</label>
<label class="label">{{ i18n.templates.globalSections.nginx.nginxConfigDirectory }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -100,7 +100,7 @@ limitations under the License.
</div>
<div class="control">
<a class="button is-static">
MB
{{ i18n.templates.globalSections.nginx.mb }}
</a>
</div>
</div>
@@ -144,7 +144,7 @@ limitations under the License.
export default {
name: 'GlobalNGINX', // Component name
display: 'NGINX', // Display name for tab
display: i18n.templates.globalSections.nginx.nginx, // Display name for tab
key: 'nginx', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {

View File

@@ -18,7 +18,7 @@ limitations under the License.
<div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Gzip compression</label>
<label class="label">{{ i18n.templates.globalSections.performance.gzipCompression }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -26,7 +26,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="gzipCompression" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable gzip compression
{{ i18n.templates.globalSections.performance.enableGzipCompression }}
</PrettyCheck>
</div>
</div>
@@ -36,7 +36,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Brotli compression</label>
<label class="label">{{ i18n.templates.globalSections.performance.brotliCompression }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -44,7 +44,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="brotliCompression" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable brotli compression
{{ i18n.templates.globalSections.performance.enableBrotliCompression }}
</PrettyCheck>
</div>
</div>
@@ -54,7 +54,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Expiration for assets</label>
<label class="label">{{ i18n.templates.globalSections.performance.expirationForAssets }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -71,7 +71,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Expiration for media</label>
<label class="label">{{ i18n.templates.globalSections.performance.expirationForMedia }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -88,7 +88,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Expiration for SVGs</label>
<label class="label">{{ i18n.templates.globalSections.performance.expirationForSvgs }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -105,7 +105,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Expiration for fonts</label>
<label class="label">{{ i18n.templates.globalSections.performance.expirationForFonts }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -156,21 +156,21 @@ limitations under the License.
};
export default {
name: 'GlobalPerformance', // Component name
display: 'Performance', // Display name for tab
key: 'performance', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
name: 'GlobalPerformance', // Component name
display: i18n.templates.globalSections.performance.performance, // Display name for tab
key: 'performance', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {
PrettyCheck,
},
props: {
data: Object, // Data delegated back to us from parent
data: Object, // Data delegated back to us from parent
},
data () {
return {
i18n,
};
},
computed: computedFromDefaults(defaults, 'performance'), // Getters & setters for the delegated data
computed: computedFromDefaults(defaults, 'performance'), // Getters & setters for the delegated data
};
</script>

View File

@@ -18,13 +18,13 @@ limitations under the License.
<div>
<div v-if="!phpServerEnabled" class="field is-horizontal is-aligned-top">
<div class="field-label">
<label class="label">PHP server</label>
<label class="label">{{ i18n.templates.globalSections.php.phpServer }}</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<label class="text">
PHP must be enabled on at least one site to configure global PHP settings.
{{ i18n.templates.globalSections.php.phpMustBeEnabledOnOneSite }}
</label>
</div>
</div>
@@ -34,7 +34,7 @@ limitations under the License.
<template v-else>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">PHP server</label>
<label class="label">{{ i18n.templates.globalSections.php.phpServer }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -51,7 +51,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">PHP backup server</label>
<label class="label">{{ i18n.templates.globalSections.php.phpBackupServer }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -76,14 +76,14 @@ limitations under the License.
import computedFromDefaults from '../../util/computed_from_defaults';
const serverOptions = {
'127.0.0.1:9000': 'TCP: 127.0.0.1:9000',
'/var/run/hhvm/sock': 'HHVM socket: /var/run/hhvm/sock',
'/var/run/hhvm/hhvm.sock': 'HHVM socket: /var/run/hhvm/hhvm.sock',
'/var/run/php5-fpm.sock': '5.x socket: /var/run/php5-fpm.sock',
'/var/run/php/php7.0-fpm.sock': '7.0 socket: /var/run/php/php7.0-fpm.sock',
'/var/run/php/php7.1-fpm.sock': '7.1 socket: /var/run/php/php7.1-fpm.sock',
'/var/run/php/php7.2-fpm.sock': '7.2 socket: /var/run/php/php7.2-fpm.sock',
'/var/run/php/php7.3-fpm.sock': '7.3 socket: /var/run/php/php7.3-fpm.sock',
'127.0.0.1:9000': `${i18n.templates.globalSections.php.tcp}: 127.0.0.1:9000`,
'/var/run/hhvm/sock': `${i18n.templates.globalSections.php.hhvmSocket}: /var/run/hhvm/sock`,
'/var/run/hhvm/hhvm.sock': `${i18n.templates.globalSections.php.hhvmSocket}: /var/run/hhvm/hhvm.sock`,
'/var/run/php5-fpm.sock': `${i18n.templates.globalSections.php.php5Socket}: /var/run/php5-fpm.sock`,
'/var/run/php/php7.1-fpm.sock': `${i18n.templates.globalSections.php.php71Socket}: /var/run/php/php7.1-fpm.sock`,
'/var/run/php/php7.2-fpm.sock': `${i18n.templates.globalSections.php.php72Socket}: /var/run/php/php7.2-fpm.sock`,
'/var/run/php/php7.0-fpm.sock': `${i18n.templates.globalSections.php.php70Socket}: /var/run/php/php7.0-fpm.sock`,
'/var/run/php/php7.3-fpm.sock': `${i18n.templates.globalSections.php.php73Socket}: /var/run/php/php7.3-fpm.sock`,
};
const defaults = {
@@ -94,14 +94,14 @@ limitations under the License.
},
phpBackupServer: {
default: '',
options: { '': 'Disabled', ...serverOptions },
options: { '': i18n.templates.globalSections.php.disabled, ...serverOptions },
enabled: true,
},
};
export default {
name: 'GlobalPHP', // Component name
display: 'PHP', // Display name for tab
display: i18n.templates.globalSections.php.php, // Display name for tab
key: 'php', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {

View File

@@ -18,13 +18,13 @@ limitations under the License.
<div>
<div v-if="!pythonServerEnabled" class="field is-horizontal is-aligned-top">
<div class="field-label">
<label class="label">Python server</label>
<label class="label">{{ i18n.templates.globalSections.python.pythonServer }}</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<label class="text">
Python must be enabled on at least one site to configure global Python settings.
{{ i18n.templates.globalSections.python.pythonMustBeEnabledOnOneSite }}
</label>
</div>
</div>
@@ -33,7 +33,7 @@ limitations under the License.
<div v-else class="field is-horizontal">
<div class="field-label">
<label class="label">Python server</label>
<label class="label">{{ i18n.templates.globalSections.python.pythonServer }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -63,19 +63,19 @@ limitations under the License.
};
export default {
name: 'GlobalPython', // Component name
display: 'Python', // Display name for tab
key: 'python', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
name: 'GlobalPython', // Component name
display: i18n.templates.globalSections.python.python, // Display name for tab
key: 'python', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
props: {
data: Object, // Data delegated back to us from parent
data: Object, // Data delegated back to us from parent
},
data () {
return {
i18n,
};
},
computed: computedFromDefaults(defaults, 'python'), // Getters & setters for the delegated data
computed: computedFromDefaults(defaults, 'python'), // Getters & setters for the delegated data
watch: {
// Enable Python server settings if any site uses Python
'$parent.$parent.$data.domains': {

View File

@@ -59,7 +59,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="serverTokens" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable
{{ i18n.templates.globalSections.security.enable }}
</PrettyCheck>
</div>
</div>
@@ -77,7 +77,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="limitReq" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable
{{ i18n.templates.globalSections.security.enable }}
</PrettyCheck>
</div>
</div>
@@ -125,7 +125,7 @@ limitations under the License.
export default {
name: 'GlobalSecurity', // Component name
display: 'Security', // Display name for tab
display: i18n.templates.globalSections.security.security, // Display name for tab
key: 'security', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {

View File

@@ -18,7 +18,7 @@ limitations under the License.
<div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Modularized structure</label>
<label class="label">{{ i18n.templates.globalSections.tools.modularizedStructure }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -26,7 +26,7 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="modularizedStructure" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable modularized config files
{{ i18n.templates.globalSections.tools.enableModularizedConfigFiles }}
</PrettyCheck>
</div>
</div>
@@ -36,7 +36,7 @@ limitations under the License.
<div v-if="symlinkVhostEnabled" class="field is-horizontal">
<div class="field-label">
<label class="label">Symlink vhost</label>
<label class="label"></label>
</div>
<div class="field-body">
<div class="field">
@@ -44,7 +44,8 @@ limitations under the License.
<div class="checkbox">
<PrettyCheck v-model="symlinkVhost" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
enable symlinks from sites-available/ to sites-enabled/
{{ i18n.templates.globalSections.tools.enableSymLinksFrom }} sites-available/
{{ i18n.templates.globalSections.tools.to }} sites-enabled/
</PrettyCheck>
</div>
</div>
@@ -54,7 +55,7 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Share configuration</label>
<label class="label">{{ i18n.templates.globalSections.tools.shareConfiguration }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -72,23 +73,23 @@ limitations under the License.
<div class="field is-horizontal">
<div class="field-label">
<label class="label">Reset configuration</label>
<label class="label">{{ i18n.templates.globalSections.tools.resetConfiguration }}</label>
</div>
<div class="field-body">
<div class="field is-grouped">
<div class="control">
<a class="button is-danger is-outline is-mini" @click="resetGlobal">
Reset global config
{{ i18n.templates.globalSections.tools.resetGlobalConfig }}
</a>
</div>
<div v-if="hasDomain" class="control">
<a class="button is-danger is-outline is-mini" @click="resetDomains">
Reset all domains
{{ i18n.templates.globalSections.tools.resetAllDomains }}
</a>
</div>
<div v-if="hasDomain" class="control">
<a class="button is-danger is-outline is-mini" @click="removeDomains">
Remove all domains
{{ i18n.templates.globalSections.tools.removeAllDomains }}
</a>
</div>
</div>
@@ -107,12 +108,12 @@ limitations under the License.
<div class="field is-grouped">
<div class="control">
<a class="button is-danger is-outline is-mini" @click="resetDomain(domainData[1])">
Reset domain config
{{ i18n.templates.globalSections.tools.resetDomainConfig }}
</a>
</div>
<div class="control">
<a class="button is-danger is-outline is-mini" @click="removeDomain(domainData[1])">
Remove domain
{{ i18n.templates.globalSections.tools.removeDomain }}
</a>
</div>
</div>
@@ -123,8 +124,12 @@ limitations under the License.
<Modal ref="confirmModal" :title="confirmTitle">
<p>{{ confirmBody }}</p>
<a class="button is-danger is-outline" @click="doConfirmAction">Yes, I'm sure</a>
<a class="button is-outline" @click="$refs.confirmModal.close()">No, cancel</a>
<a class="button is-danger is-outline" @click="doConfirmAction">
{{ i18n.templates.globalSections.tools.yesImSure }}
</a>
<a class="button is-outline" @click="$refs.confirmModal.close()">
{{ i18n.templates.globalSections.tools.noCancel }}
</a>
</Modal>
</div>
</template>
@@ -150,28 +155,27 @@ limitations under the License.
};
export default {
name: 'GlobalTools', // Component name
display: 'Tools', // Display name for tab
key: 'tools', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
name: 'GlobalTools', // Component name
display: i18n.templates.globalSections.tools.tools, // Display name for tab
key: 'tools', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {
PrettyCheck,
Modal,
},
props: {
data: Object, // Data delegated back to us from parent
data: Object, // Data delegated back to us from parent
},
data() {
return {
i18n,
confirmTitle: '',
confirmBody: '',
confirmAction: () => {
},
confirmAction: () => {},
};
},
computed: {
...computedFromDefaults(defaults, 'tools'), // Getters & setters for the delegated data
...computedFromDefaults(defaults, 'tools'), // Getters & setters for the delegated data
hasDomain() {
return this.$parent.$parent.activeDomains.length > 0;
},