Allow language selection (#191)

* Add dropdown for language

* Use vue-i18n to translate strings

* Tweak header styling

* Add Chinese languages in

* Typo

* Get language from browser (#193)

* adaptive system language

* Modify the adaptive system language

* Remove dead code

* Delete lang default values

* Move browser language detection to util

* Remove todos

* Fix global PHP dropdown

Co-authored-by: 墨娘 <61287199+moniang@users.noreply.github.com>
This commit is contained in:
Matt (IPv4) Cowley
2020-12-11 16:54:12 +00:00
committed by GitHub
parent 7d3290d850
commit ff88e2f322
53 changed files with 539 additions and 434 deletions

View File

@@ -28,7 +28,7 @@ THE SOFTWARE.
<div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">{{ i18n.common.docker }}</label>
<label class="label">{{ $t('common.docker') }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -36,7 +36,7 @@ THE SOFTWARE.
<div class="checkbox">
<PrettyCheck v-model="dockerfile" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
{{ i18n.templates.globalSections.docker.dockerfile }}
{{ $t('templates.globalSections.docker.dockerfile') }}
</PrettyCheck>
</div>
</div>
@@ -45,7 +45,7 @@ THE SOFTWARE.
</div>
<div v-if="dockerfile" class="field is-horizontal">
<div class="field-label">
<label class="label">{{ i18n.common.dockerCompose }}</label>
<label class="label">{{ $t('common.dockerCompose') }}</label>
</div>
<div class="field-body">
<div class="field">
@@ -53,7 +53,7 @@ THE SOFTWARE.
<div class="checkbox">
<PrettyCheck v-model="dockerCompose" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
{{ i18n.templates.globalSections.docker.dockerCompose }}
{{ $t('templates.globalSections.docker.dockerCompose') }}
</PrettyCheck>
</div>
</div>
@@ -64,10 +64,9 @@ THE SOFTWARE.
</template>
<script>
import i18n from '../../i18n';
import PrettyCheck from 'pretty-checkbox-vue/check';
import delegatedFromDefaults from '../../util/delegated_from_defaults';
import computedFromDefaults from '../../util/computed_from_defaults';
import PrettyCheck from 'pretty-checkbox-vue/check';
const defaults = {
dockerfile: {
@@ -82,7 +81,7 @@ THE SOFTWARE.
export default {
name: 'GlobalDocker', // Component name
display: i18n.common.docker, // Display name for tab
display: 'common.docker', // Display name for tab (i18n key)
key: 'docker', // Key for data in parent
delegated: delegatedFromDefaults(defaults), // Data the parent will present here
components: {
@@ -91,11 +90,6 @@ THE SOFTWARE.
props: {
data: Object, // Data delegated back to us from parent
},
data () {
return {
i18n,
};
},
computed: computedFromDefaults(defaults, 'docker'), // Getters & setters for the delegated data
watch: {
// Disable docker-compose if dockerfile is disabled