Move top level template strings to i18n

This commit is contained in:
MattIPv4 2020-06-02 16:12:05 +01:00
parent 85ba7422d9
commit 85910e7794
9 changed files with 89 additions and 17 deletions

View file

@ -17,5 +17,12 @@ limitations under the License.
export default {
title: 'NGINXConfig',
description: 'The easiest way to configure a performant, secure, and stable NGINX server.',
oss: 'This tool is {link|open-source on GitHub|https://github.com/do-community/nginxconfig-vue} under the {link|Apache-2.0|https://github.com/do-community/nginxconfig-vue/blob/master/LICENSE} license! We welcome feedback and contributions.',
singleColumnMode: 'Single column mode',
splitColumnMode: 'Split column mode',
perWebsiteConfig: 'Per-website config',
addSite: 'Add site',
globalConfig: 'Global config',
setup: 'Setup',
configFiles: 'Config files',
oss: 'This tool is {link|open-source on GitHub|https://github.com/digitalocean/nginxconfig.io} under the {link|Apache-2.0|https://github.com/digitalocean/nginxconfig.io/blob/master/LICENSE} license! We welcome feedback and contributions.',
};

View file

@ -0,0 +1,20 @@
/*
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 {
back: 'Back',
next: 'Next',
};

View file

@ -0,0 +1,20 @@
/*
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 {
back: 'Back',
next: 'Next',
};

View file

@ -15,8 +15,11 @@ limitations under the License.
*/
import app from './app';
import domain from './domain';
import global from './global';
import setup from './setup';
import domainSections from './domain_sections';
import globalSections from './global_sections';
import setupSections from './setup_sections';
export default { app, domainSections, globalSections, setupSections };
export default { app, domain, global, setup, domainSections, globalSections, setupSections };

View file

@ -0,0 +1,22 @@
/*
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 {
back: 'Back',
next: 'Next',
downloadConfig: 'Download Config',
copyBase64: 'Copy Base64',
};

View file

@ -24,10 +24,10 @@ limitations under the License.
</template>
<template v-slot:buttons>
<a v-if="splitColumn" class="button is-primary is-outline" @click="splitColumn = false">
Single column mode
{{ i18n.templates.app.singleColumnMode }}
</a>
<a v-else class="button is-primary" @click="splitColumn = true">
Split column mode
{{ i18n.templates.app.splitColumnMode }}
</a>
</template>
</Header>
@ -35,7 +35,7 @@ limitations under the License.
<div class="main container" :style="{ display: ready ? undefined : 'none' }">
<div class="columns is-multiline">
<div :class="`column ${splitColumn ? 'is-half' : 'is-full'} is-full-mobile is-full-tablet`">
<h2>Per-website config</h2>
<h2>{{ i18n.templates.app.perWebsiteConfig }}</h2>
<div class="tabs">
<ul>
@ -48,7 +48,7 @@ limitations under the License.
</a>
</li>
<li>
<a @click="add"><i class="fas fa-plus"></i> Add site</a>
<a @click="add"><i class="fas fa-plus"></i> {{ i18n.templates.app.addSite }}</a>
</li>
</ul>
</div>
@ -60,15 +60,15 @@ limitations under the License.
></Domain>
</template>
<h2>Global config</h2>
<h2>{{ i18n.templates.app.globalConfig }}</h2>
<Global :data="global"></Global>
<h2>Setup</h2>
<h2>{{ i18n.templates.app.setup }}</h2>
<Setup :data="{ domains: domains.filter(d => d !== null), global, confFiles }"></Setup>
</div>
<div :class="`column ${splitColumn ? 'is-half' : 'is-full'} is-full-mobile is-full-tablet`">
<h2>Config files</h2>
<h2>{{ i18n.templates.app.configFiles }}</h2>
<div ref="files" class="columns is-multiline">
<NginxPrism v-for="conf in confFilesOutput"
:key="`${conf[0]}-${hash(conf[1])}`"

View file

@ -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>Back</span>
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.domain.back }}</span>
</a>
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
<span>Next</span> <i class="fas fa-long-arrow-alt-right"></i>
<span>{{ i18n.templates.domain.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
</a>
</div>
</div>

View file

@ -34,10 +34,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>Back</span>
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.global.back }}</span>
</a>
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
<span>Next</span> <i class="fas fa-long-arrow-alt-right"></i>
<span>{{ i18n.templates.global.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
</a>
</div>
</div>

View file

@ -35,17 +35,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>Back</span>
<i class="fas fa-long-arrow-alt-left"></i> <span>{{ i18n.templates.setup.back }}</span>
</a>
<a v-if="nextTab !== false" class="button is-primary is-mini" @click="active = nextTab">
<span>Next</span> <i class="fas fa-long-arrow-alt-right"></i>
<span>{{ i18n.templates.setup.next }}</span> <i class="fas fa-long-arrow-alt-right"></i>
</a>
</div>
</div>
<div class="buttons is-centered">
<a class="button is-success" @click="downloadTar">Download Config</a>
<a class="button is-primary" @click="copyTar">Copy Base64</a>
<a class="button is-success" @click="downloadTar">{{ i18n.templates.setup.downloadConfig }}</a>
<a class="button is-primary" @click="copyTar">{{ i18n.templates.setup.copyBase64 }}</a>
</div>
</div>
</template>