Move strings to i18n for logging & php

pull/111/head
MattIPv4 2020-05-29 15:55:18 +01:00
parent c331e2c79a
commit a90ecf416a
6 changed files with 71 additions and 19 deletions

View File

@ -15,5 +15,7 @@ limitations under the License.
*/ */
import https from './https'; import https from './https';
import logging from './logging';
import php from './php';
export default { https }; export default { https, logging, php };

View File

@ -0,0 +1,21 @@
/*
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 {
byDomain: 'by domain',
enableForThisDomain: 'enable for this domain',
logging: 'Logging',
};

View File

@ -0,0 +1,29 @@
/*
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 {
php: 'PHP',
phpIsDisabled: 'PHP is disabled.',
phpCannotBeEnabledWithReverseProxy: 'PHP cannot be enabled whilst the reverse proxy is enabled.',
phpCannotBeEnabledWithPython: 'PHP cannot be enabled whilst Python is enabled.',
enablePhp: 'enable PHP',
wordPressRules: 'WordPress rules',
enableWordPressRules: 'enable WordPress-specific rules',
drupalRules: 'Drupal rules',
enableDrupalRules: ' enable Drupal-specific rules',
magentoRules: 'Magento rules',
enableMagentoRules: ' enable Magento-specific rules',
};

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import * as en from './en'; import en from './en';
const lang = 'en'; const lang = 'en';
const packs = { en }; const packs = { en };

View File

@ -18,7 +18,7 @@ limitations under the License.
<div> <div>
<div class="field is-horizontal"> <div class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">access_log by domain</label> <label class="label">access_log {{ i18n.templates.domainSections.logging.byDomain }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -26,7 +26,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="accessLog" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="accessLog" 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 for this domain {{ i18n.templates.domainSections.logging.enableForThisDomain }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -36,7 +36,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">error_log by domain</label> <label class="label">error_log {{ i18n.templates.domainSections.logging.byDomain }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -44,7 +44,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="errorLog" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="errorLog" 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 for this domain {{ i18n.templates.domainSections.logging.enableForThisDomain }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -73,7 +73,7 @@ limitations under the License.
export default { export default {
name: 'DomainLogging', // Component name name: 'DomainLogging', // Component name
display: 'Logging', // Display name for tab display: i18n.templates.domainSections.logging.logging, // Display name for tab
key: 'logging', // Key for data in parent key: 'logging', // 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,18 +18,18 @@ limitations under the License.
<div> <div>
<div v-if="!phpEnabled" class="field is-horizontal is-aligned-top"> <div v-if="!phpEnabled" class="field is-horizontal is-aligned-top">
<div class="field-label"> <div class="field-label">
<label class="label">PHP</label> <label class="label">{{ i18n.templates.domainSections.php.php }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div class="control is-changed"> <div class="control is-changed">
<label class="text"> <label class="text">
PHP is disabled. {{ i18n.templates.domainSections.php.phpIsDisabled }}
<template v-if="$parent.$props.data.reverseProxy.reverseProxy.computed"> <template v-if="$parent.$props.data.reverseProxy.reverseProxy.computed">
<br />PHP cannot be enabled whilst the reverse proxy is enabled. <br />{{ i18n.templates.domainSections.php.phpCannotBeEnabledWithReverseProxy }}
</template> </template>
<template v-if="$parent.$props.data.python.python.computed"> <template v-if="$parent.$props.data.python.python.computed">
<br />PHP cannot be enabled whilst Python is enabled. <br />{{ i18n.templates.domainSections.php.phpCannotBeEnabledWithPython }}
</template> </template>
</label> </label>
</div> </div>
@ -47,7 +47,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="php" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="php" 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 PHP {{ i18n.templates.domainSections.php.enablePhp }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -57,7 +57,7 @@ limitations under the License.
<div v-if="wordPressRulesEnabled" class="field is-horizontal"> <div v-if="wordPressRulesEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">WordPress rules</label> <label class="label">{{ i18n.templates.domainSections.php.wordPressRules }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -65,7 +65,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="wordPressRules" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="wordPressRules" 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 WordPress-specific rules {{ i18n.templates.domainSections.php.enableWordPressRules }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -75,7 +75,7 @@ limitations under the License.
<div v-if="drupalRulesEnabled" class="field is-horizontal"> <div v-if="drupalRulesEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">Drupal rules</label> <label class="label">{{ i18n.templates.domainSections.php.drupalRules }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -83,7 +83,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="drupalRules" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="drupalRules" 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 Drupal-specific rules {{ i18n.templates.domainSections.php.enableDrupalRules }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -93,7 +93,7 @@ limitations under the License.
<div v-if="magentoRulesEnabled" class="field is-horizontal"> <div v-if="magentoRulesEnabled" class="field is-horizontal">
<div class="field-label"> <div class="field-label">
<label class="label">Magento rules</label> <label class="label">{{ i18n.templates.domainSections.php.magentoRules }}</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
@ -101,7 +101,7 @@ limitations under the License.
<div class="checkbox"> <div class="checkbox">
<PrettyCheck v-model="magentoRules" class="p-default p-curve p-fill p-icon"> <PrettyCheck v-model="magentoRules" 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 Magento-specific rules {{ i18n.templates.domainSections.php.enableMagentoRules }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -138,7 +138,7 @@ limitations under the License.
export default { export default {
name: 'DomainPHP', // Component name name: 'DomainPHP', // Component name
display: 'PHP', // Display name for tab display: i18n.templates.domainSections.php.php, // Display name for tab
key: 'php', // Key for data in parent key: 'php', // 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: {