mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-11-06 03:06:09 +08:00
Move i18n strings to be centralised
This commit is contained in:
@@ -39,10 +39,10 @@ limitations under the License.
|
||||
|
||||
<div class="navigation-buttons">
|
||||
<a v-if="previousTab !== false" class="button is-mini" @click="active = previousTab">
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.domain.back }}</span>
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.common.back }}</span>
|
||||
</a>
|
||||
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
|
||||
<span>{{ i18n.templates.domain.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
<span>{{ i18n.common.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,6 +50,7 @@ limitations under the License.
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '../i18n';
|
||||
import isChanged from '../util/is_changed';
|
||||
import Presets from './domain_sections/presets';
|
||||
import * as Sections from './domain_sections';
|
||||
@@ -75,6 +76,7 @@ limitations under the License.
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
i18n,
|
||||
active: tabs[0].key,
|
||||
tabs,
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
<div>
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">{{ i18n.templates.domainSections.https.https }}</label>
|
||||
<label class="label">{{ i18n.common.https }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
@@ -216,7 +216,7 @@ limitations under the License.
|
||||
certType: {
|
||||
default: 'letsEncrypt',
|
||||
options: {
|
||||
letsEncrypt: i18n.templates.domainSections.https.letsEncrypt,
|
||||
letsEncrypt: i18n.common.letsEncrypt,
|
||||
custom: i18n.templates.domainSections.https.customCertificate,
|
||||
},
|
||||
enabled: true,
|
||||
@@ -236,16 +236,16 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DomainHTTPS', // Component name
|
||||
display: i18n.templates.domainSections.https.https, // Display name for tab
|
||||
key: 'https', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
name: 'DomainHTTPS', // Component name
|
||||
display: i18n.common.https, // Display name for tab
|
||||
key: 'https', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
PrettyCheck,
|
||||
PrettyRadio,
|
||||
},
|
||||
props: {
|
||||
data: Object, // Data delegated back to us from parent
|
||||
data: Object, // Data delegated back to us from parent
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -253,7 +253,7 @@ limitations under the License.
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...computedFromDefaults(defaults, 'https'), // Getters & setters for the delegated data
|
||||
...computedFromDefaults(defaults, 'https'), // Getters & setters for the delegated data
|
||||
nginxDir() {
|
||||
return this.$parent.$parent.$data.global.nginx.nginxConfigDirectory.computed.replace(/\/+$/, '');
|
||||
},
|
||||
|
||||
@@ -72,15 +72,15 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DomainLogging', // Component name
|
||||
display: i18n.templates.domainSections.logging.logging, // Display name for tab
|
||||
key: 'logging', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
name: 'DomainLogging', // Component name
|
||||
display: i18n.common.logging, // Display name for tab
|
||||
key: 'logging', // 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 {
|
||||
|
||||
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
<div>
|
||||
<div v-if="!phpEnabled" class="field is-horizontal is-aligned-top">
|
||||
<div class="field-label">
|
||||
<label class="label">{{ i18n.templates.domainSections.php.php }}</label>
|
||||
<label class="label">{{ i18n.common.php }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
@@ -39,7 +39,7 @@ limitations under the License.
|
||||
|
||||
<div v-else class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">PHP</label>
|
||||
<label class="label">{{ i18n.common.php }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
@@ -138,7 +138,7 @@ limitations under the License.
|
||||
|
||||
export default {
|
||||
name: 'DomainPHP', // Component name
|
||||
display: i18n.templates.domainSections.php.php, // Display name for tab
|
||||
display: i18n.common.php, // Display name for tab
|
||||
key: 'php', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
@@ -152,7 +152,7 @@ limitations under the License.
|
||||
i18n,
|
||||
};
|
||||
},
|
||||
computed: computedFromDefaults(defaults, 'php'), // Getters & setters for the delegated data
|
||||
computed: computedFromDefaults(defaults, 'php'), // Getters & setters for the delegated data
|
||||
watch: {
|
||||
// If the Reverse proxy or Python is enabled, PHP will be forced off
|
||||
'$parent.$props.data': {
|
||||
|
||||
@@ -67,7 +67,7 @@ limitations under the License.
|
||||
},
|
||||
php: {
|
||||
default: true,
|
||||
display: i18n.templates.domainSections.presets.php,
|
||||
display: i18n.common.php,
|
||||
enabled: true,
|
||||
computedCheck (data) {
|
||||
return data.php.php.computed
|
||||
@@ -81,7 +81,7 @@ limitations under the License.
|
||||
},
|
||||
django: {
|
||||
default: false,
|
||||
display: i18n.templates.domainSections.presets.django,
|
||||
display: i18n.common.django,
|
||||
enabled: true,
|
||||
computedCheck (data) {
|
||||
return data.python.python.computed
|
||||
@@ -110,7 +110,7 @@ limitations under the License.
|
||||
},
|
||||
wordPress: {
|
||||
default: false,
|
||||
display: i18n.templates.domainSections.presets.wordPress,
|
||||
display: i18n.common.wordPress,
|
||||
enabled: true,
|
||||
computedCheck (data) {
|
||||
return data.routing.index.computed === 'index.php'
|
||||
@@ -123,7 +123,7 @@ limitations under the License.
|
||||
},
|
||||
drupal: {
|
||||
default: false,
|
||||
display: i18n.templates.domainSections.presets.drupal,
|
||||
display: i18n.common.drupal,
|
||||
enabled: true,
|
||||
computedCheck (data) {
|
||||
return data.routing.index.computed === 'index.php'
|
||||
@@ -136,7 +136,7 @@ limitations under the License.
|
||||
},
|
||||
magento: {
|
||||
default: false,
|
||||
display: i18n.templates.domainSections.presets.magento,
|
||||
display: i18n.common.magento,
|
||||
enabled: true,
|
||||
computedCheck (data) {
|
||||
return data.routing.index.computed === 'index.php'
|
||||
|
||||
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
<div>
|
||||
<div v-if="!pythonEnabled" class="field is-horizontal is-aligned-top">
|
||||
<div class="field-label">
|
||||
<label class="label">{{ i18n.templates.domainSections.python.python }}</label>
|
||||
<label class="label">{{ i18n.common.python }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
@@ -39,7 +39,7 @@ limitations under the License.
|
||||
|
||||
<div v-else class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<label class="label">{{ i18n.templates.domainSections.python.python }}</label>
|
||||
<label class="label">{{ i18n.common.python }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
@@ -93,15 +93,15 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DomainPython', // Component name
|
||||
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
|
||||
name: 'DomainPython', // Component name
|
||||
display: i18n.common.python, // Display name for tab
|
||||
key: 'python', // 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 {
|
||||
|
||||
@@ -26,7 +26,7 @@ limitations under the License.
|
||||
<div class="checkbox">
|
||||
<PrettyCheck v-model="root" class="p-default p-curve p-fill p-icon">
|
||||
<i slot="extra" class="icon fas fa-check"></i>
|
||||
{{ i18n.templates.domainSections.routing.enable }}
|
||||
{{ i18n.common.enable }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,16 +34,17 @@ limitations under the License.
|
||||
|
||||
<div class="navigation-buttons">
|
||||
<a v-if="previousTab !== false" class="button is-mini" @click="active = previousTab">
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.global.back }}</span>
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.common.back }}</span>
|
||||
</a>
|
||||
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
|
||||
<span>{{ i18n.templates.global.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
<span>{{ i18n.common.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import i18n from '../i18n';
|
||||
import isChanged from '../util/is_changed';
|
||||
import * as Sections from './global_sections';
|
||||
|
||||
@@ -61,6 +62,7 @@ limitations under the License.
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
i18n,
|
||||
active: tabs[0].key,
|
||||
tabs,
|
||||
};
|
||||
|
||||
@@ -144,23 +144,23 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'GlobalHTTPS', // Component name
|
||||
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
|
||||
name: 'GlobalHTTPS', // Component name
|
||||
display: i18n.common.https, // Display name for tab
|
||||
key: 'https', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
PrettyCheck,
|
||||
PrettyRadio,
|
||||
},
|
||||
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, 'https'), // Getters & setters for the delegated data
|
||||
computed: computedFromDefaults(defaults, 'https'), // Getters & setters for the delegated data
|
||||
watch: {
|
||||
// Check SSL profile is valid
|
||||
'$props.data.sslProfile': {
|
||||
|
||||
@@ -93,7 +93,7 @@ limitations under the License.
|
||||
|
||||
export default {
|
||||
name: 'GlobalLogging', // Component name
|
||||
display: i18n.templates.globalSections.logging.logging, // Display name for tab
|
||||
display: i18n.common.logging, // Display name for tab
|
||||
key: 'logging', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
|
||||
@@ -144,7 +144,7 @@ limitations under the License.
|
||||
|
||||
export default {
|
||||
name: 'GlobalNGINX', // Component name
|
||||
display: i18n.templates.globalSections.nginx.nginx, // Display name for tab
|
||||
display: i18n.common.nginx, // Display name for tab
|
||||
key: 'nginx', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
|
||||
@@ -100,15 +100,15 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'GlobalPHP', // Component name
|
||||
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
|
||||
name: 'GlobalPHP', // Component name
|
||||
display: i18n.common.php, // Display name for tab
|
||||
key: 'php', // Key for data in parent
|
||||
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
|
||||
components: {
|
||||
VueSelect,
|
||||
},
|
||||
props: {
|
||||
data: Object, // Data delegated back to us from parent
|
||||
data: Object, // Data delegated back to us from parent
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -116,7 +116,7 @@ limitations under the License.
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...computedFromDefaults(defaults, 'php'), // Getters & setters for the delegated data
|
||||
...computedFromDefaults(defaults, 'php'), // Getters & setters for the delegated data
|
||||
phpServerOptions() {
|
||||
return Object.entries(this.$props.data.phpServer.options)
|
||||
.map(([key, value]) => ({ label: value, value: key }));
|
||||
|
||||
@@ -63,19 +63,19 @@ limitations under the License.
|
||||
};
|
||||
|
||||
export default {
|
||||
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
|
||||
name: 'GlobalPython', // Component name
|
||||
display: i18n.common.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': {
|
||||
|
||||
@@ -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>
|
||||
{{ i18n.templates.globalSections.security.enable }}
|
||||
{{ i18n.common.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>
|
||||
{{ i18n.templates.globalSections.security.enable }}
|
||||
{{ i18n.common.enable }}
|
||||
</PrettyCheck>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,10 +35,10 @@ limitations under the License.
|
||||
|
||||
<div class="navigation-buttons">
|
||||
<a v-if="previousTab !== false" class="button is-mini" @click="active = previousTab">
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.setup.back }}</span>
|
||||
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.common.back }}</span>
|
||||
</a>
|
||||
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
|
||||
<span>{{ i18n.templates.setup.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
<span>{{ i18n.common.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,6 +55,7 @@ limitations under the License.
|
||||
import getStream from 'get-stream';
|
||||
import { gzip } from 'node-gzip';
|
||||
import copy from 'copy-to-clipboard';
|
||||
import i18n from '../i18n';
|
||||
import * as Sections from './setup_sections';
|
||||
|
||||
const tabs = Object.values(Sections);
|
||||
@@ -66,6 +67,7 @@ limitations under the License.
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
i18n,
|
||||
active: tabs[0].key,
|
||||
tabs,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user