Move strings to i18n for presets

This commit is contained in:
MattIPv4 2020-05-29 17:32:57 +01:00
parent a90ecf416a
commit 242ff5b80e
4 changed files with 43 additions and 15 deletions

View file

@ -17,5 +17,6 @@ limitations under the License.
import https from './https';
import logging from './logging';
import php from './php';
import presets from './presets';
export default { https, logging, php };
export default { https, logging, php, presets };

View file

@ -23,7 +23,7 @@ export default {
wordPressRules: 'WordPress rules',
enableWordPressRules: 'enable WordPress-specific rules',
drupalRules: 'Drupal rules',
enableDrupalRules: ' enable Drupal-specific rules',
enableDrupalRules: 'enable Drupal-specific rules',
magentoRules: 'Magento rules',
enableMagentoRules: ' enable Magento-specific rules',
enableMagentoRules: 'enable Magento-specific rules',
};

View file

@ -0,0 +1,28 @@
/*
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 {
presets: 'Presets',
itLooksLikeYouCustomisedTheConfig: 'It looks like you\'ve customised the configuration for this domain. Choosing a new preset may reset or change some of the settings that you\'ve customised.',
frontend: 'Frontend',
php: 'PHP',
django: 'Django',
nodeJs: 'Node.js',
singlePageApplication: 'Single-page application',
wordPress: 'WordPress',
drupal: 'Drupal',
magento: 'Magento',
};

View file

@ -17,7 +17,7 @@ limitations under the License.
<template>
<div class="container">
<div class="header-group">
<h3>Presets</h3>
<h3>{{ i18n.templates.domainSections.presets.presets }}</h3>
<template v-if="$parent.$props.data.hasUserInteraction">
<a v-if="expanded" class="button is-tiny" @click="expanded = false">
<i class="fas fa-angle-up"></i>
@ -31,8 +31,7 @@ limitations under the License.
<template v-if="!$parent.$props.data.hasUserInteraction || expanded">
<div v-if="$parent.$props.data.hasUserInteraction" class="message is-warning">
<div class="message-body">
It looks like you've customised the configuration for this domain.
Choosing a new preset may reset or change some of the settings that you've customised.
{{ i18n.templates.domainSections.presets.itLooksLikeYouCustomisedTheConfig }}
</div>
</div>
@ -56,7 +55,7 @@ limitations under the License.
const defaults = {
frontend: {
default: false,
display: 'Frontend',
display: i18n.templates.domainSections.presets.frontend,
enabled: true,
computedCheck (data) {
return !data.php.php.computed
@ -68,7 +67,7 @@ limitations under the License.
},
php: {
default: true,
display: 'PHP',
display: i18n.templates.domainSections.presets.php,
enabled: true,
computedCheck (data) {
return data.php.php.computed
@ -82,7 +81,7 @@ limitations under the License.
},
django: {
default: false,
display: 'Django',
display: i18n.templates.domainSections.presets.django,
enabled: true,
computedCheck (data) {
return data.python.python.computed
@ -92,7 +91,7 @@ limitations under the License.
},
nodejs: {
default: false,
display: 'Node.js',
display: i18n.templates.domainSections.presets.nodeJs,
enabled: true,
computedCheck (data) {
return data.reverseProxy.reverseProxy.computed
@ -101,7 +100,7 @@ limitations under the License.
},
singlePageApplication: {
default: false,
display: 'Single-page application',
display: i18n.templates.domainSections.presets.singePageApplication,
enabled: true,
computedCheck (data) {
return data.php.php.computed
@ -111,7 +110,7 @@ limitations under the License.
},
wordPress: {
default: false,
display: 'WordPress',
display: i18n.templates.domainSections.presets.wordPress,
enabled: true,
computedCheck (data) {
return data.routing.index.computed === 'index.php'
@ -124,7 +123,7 @@ limitations under the License.
},
drupal: {
default: false,
display: 'Drupal',
display: i18n.templates.domainSections.presets.drupal,
enabled: true,
computedCheck (data) {
return data.routing.index.computed === 'index.php'
@ -137,7 +136,7 @@ limitations under the License.
},
magento: {
default: false,
display: 'Magento',
display: i18n.templates.domainSections.presets.magento,
enabled: true,
computedCheck (data) {
return data.routing.index.computed === 'index.php'
@ -152,7 +151,7 @@ limitations under the License.
export default {
name: 'DomainPresets', // Component name
display: 'Presets', // Display name for tab
display: i18n.templates.domainSections.presets.presets, // Display name for tab
key: 'presets', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
props: {