From 49406bfd46b223c0afbd7fc991271a8a64ac3655 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Mon, 1 Jun 2020 17:04:55 +0100 Subject: [PATCH] Move strings to i18n for python & reverse proxy domain sections --- .../en/templates/domain_sections/index.js | 4 ++- .../en/templates/domain_sections/python.js | 25 ++++++++++++++++++ .../domain_sections/reverse_proxy.js | 24 +++++++++++++++++ .../templates/domain_sections/presets.vue | 2 +- .../templates/domain_sections/python.vue | 18 ++++++------- .../domain_sections/reverse_proxy.vue | 26 +++++++++---------- 6 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 src/nginxconfig/i18n/en/templates/domain_sections/python.js create mode 100644 src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/index.js b/src/nginxconfig/i18n/en/templates/domain_sections/index.js index 144bbe8..d1e2956 100644 --- a/src/nginxconfig/i18n/en/templates/domain_sections/index.js +++ b/src/nginxconfig/i18n/en/templates/domain_sections/index.js @@ -18,5 +18,7 @@ import https from './https'; import logging from './logging'; import php from './php'; import presets from './presets'; +import python from './python'; +import reverseProxy from './reverse_proxy'; -export default { https, logging, php, presets }; +export default { https, logging, php, presets, python, reverseProxy }; diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/python.js b/src/nginxconfig/i18n/en/templates/domain_sections/python.js new file mode 100644 index 0000000..c6c5e6a --- /dev/null +++ b/src/nginxconfig/i18n/en/templates/domain_sections/python.js @@ -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 { + python: 'Python', + pythonIsDisabled: 'Python is disabled.', + pythonCannotBeEnabledWithReverseProxy: 'Python cannot be enabled whilst the reverse proxy is enabled.', + pythonCannotBeEnabledWithPhp: 'Python cannot be enabled whilst PHP is enabled.', + enablePython: 'enable Python', + djangoRules: 'Django rules', + enableDjangoRules: 'enable Django-specific rules', +}; diff --git a/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js b/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js new file mode 100644 index 0000000..b10c514 --- /dev/null +++ b/src/nginxconfig/i18n/en/templates/domain_sections/reverse_proxy.js @@ -0,0 +1,24 @@ +/* +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 { + reverseProxy: 'Reverse proxy', + reverseProxyIsDisabled: 'Reverse proxy is disabled.', + reverseProxyCannotBeEnabledWithPhp: 'Reverse proxy cannot be enabled whilst PHP is enabled.', + reverseProxyCannotBeEnabledWithPython: 'Reverse proxy cannot be enabled whilst Python is enabled.', + enableReverseProxy: 'enable reverse proxy', + path: 'Path', +}; diff --git a/src/nginxconfig/templates/domain_sections/presets.vue b/src/nginxconfig/templates/domain_sections/presets.vue index e3444c5..aefda02 100644 --- a/src/nginxconfig/templates/domain_sections/presets.vue +++ b/src/nginxconfig/templates/domain_sections/presets.vue @@ -100,7 +100,7 @@ limitations under the License. }, singlePageApplication: { default: false, - display: i18n.templates.domainSections.presets.singePageApplication, + display: i18n.templates.domainSections.presets.singlePageApplication, enabled: true, computedCheck (data) { return data.php.php.computed diff --git a/src/nginxconfig/templates/domain_sections/python.vue b/src/nginxconfig/templates/domain_sections/python.vue index b61cfe4..70a99a3 100644 --- a/src/nginxconfig/templates/domain_sections/python.vue +++ b/src/nginxconfig/templates/domain_sections/python.vue @@ -18,18 +18,18 @@ limitations under the License.
- +
@@ -39,7 +39,7 @@ limitations under the License.
- +
@@ -47,7 +47,7 @@ limitations under the License.
- enable Python + {{ i18n.templates.domainSections.python.enablePython }}
@@ -57,7 +57,7 @@ limitations under the License.
- +
@@ -65,7 +65,7 @@ limitations under the License.
- enable Django-specific rules + {{ i18n.templates.domainSections.python.enableDjangoRules }}
@@ -94,7 +94,7 @@ limitations under the License. export default { name: 'DomainPython', // Component name - display: 'Python', // Display name for tab + display: i18n.templates.domainSections.python.python, // Display name for tab key: 'python', // Key for data in parent delegated: delegatedFromDefaults(defaults), // Data the parent will present here components: { diff --git a/src/nginxconfig/templates/domain_sections/reverse_proxy.vue b/src/nginxconfig/templates/domain_sections/reverse_proxy.vue index 16ef08b..dfe2f86 100644 --- a/src/nginxconfig/templates/domain_sections/reverse_proxy.vue +++ b/src/nginxconfig/templates/domain_sections/reverse_proxy.vue @@ -18,18 +18,18 @@ limitations under the License.
- +
@@ -39,7 +39,7 @@ limitations under the License.
- +
@@ -47,7 +47,7 @@ limitations under the License.
- enable reverse proxy + {{ i18n.templates.domainSections.reverseProxy.enableReverseProxy }}
@@ -57,7 +57,7 @@ limitations under the License.
- +
@@ -113,22 +113,22 @@ limitations under the License. }; export default { - name: 'DomainReverseProxy', // Component name - display: 'Reverse proxy', // Display name for tab - key: 'reverseProxy', // Key for data in parent - delegated: delegatedFromDefaults(defaults), // Data the parent will present here + name: 'DomainReverseProxy', // Component name + display: i18n.templates.domainSections.reverseProxy.reverseProxy, // Display name for tab + key: 'reverseProxy', // 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, 'reverseProxy'), // Getters & setters for the delegated data + computed: computedFromDefaults(defaults, 'reverseProxy'), // Getters & setters for the delegated data watch: { // If the PHP or Python is enabled, the Reverse proxy will be forced off '$parent.$props.data': {