feat(i18n): add ui localization (#2279)

Co-authored-by: TheElixZammuto <6505622+TheElixZammuto@users.noreply.github.com>
This commit is contained in:
ReenigneArcher 2024-03-22 19:54:12 -04:00 committed by GitHub
commit 87774333f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 4446 additions and 719 deletions

View file

@ -5,16 +5,16 @@
<%- header %>
</head>
<body id="app">
<body id="app" v-cloak>
<Navbar></Navbar>
<div id="content" class="container">
<h1 class="my-4">Hello, Sunshine!</h1>
<p>Sunshine is a self-hosted game stream host for Moonlight.</p>
<h1 class="my-4">{{ $t('index.welcome') }}</h1>
<p>{{ $t('index.description') }}</p>
<div class="alert alert-danger" v-if="fancyLogs.find(x => x.level === 'Fatal')">
<div style="line-height: 32px;">
<i class="fas fa-circle-exclamation" style="font-size: 32px;margin-right: 0.25em;"></i>
<b>Attention!</b> Sunshine detected these errors during startup. We <b>STRONGLY RECOMMEND</b> fixing them
before streaming.<br>
<p v-html="$t('index.startup_errors')"></p>
<br>
</div>
<ul>
<li v-for="v in fancyLogs.filter(x => x.level === 'Fatal')">{{v.value}}</li>
@ -27,20 +27,22 @@
<h2>Version {{version}}</h2>
<br>
<div v-if="loading">
Loading Latest Release...
{{ $t('index.loading_latest') }}
</div>
<div class="alert alert-success" v-if="buildVersionIsDirty">
Thank you for helping to make Sunshine a better software! 🌇
{{ $t('index.version_dirty') }} 🌇
</div>
<div v-else-if="!nightlyBuildAvailable && !stableBuildAvailable && !buildVersionIsDirty">
<div class="alert alert-success">
You're running the latest version of Sunshine
{{ $t('index.version_latest') }}
</div>
</div>
<div v-if="nightlyBuildAvailable">
<div class="alert alert-warning">
<div class="d-flex justify-content-between">
<div class="my-2">A new <b>Nightly</b> Version is Available!</div>
<div class="my-2">
<p v-html="$t('index.new_nightly')"></p>
</div>
<a class="btn btn-success m-1" href="https://github.com/LizardByte/Sunshine/releases/nightly-dev"
target="_blank">Download</a>
</div>
@ -51,8 +53,10 @@
<div v-if="stableBuildAvailable">
<div class="alert alert-warning">
<div class="d-flex justify-content-between">
<div class="my-2">A new <b>Stable</b> Version is Available!</div>
<a class="btn btn-success m-1" :href="githubVersion.html_url" target="_blank">Download</a>
<div class="my-2">
<p v-html="$t('index.new_stable')"></p>
</div>
<a class="btn btn-success m-1" :href="githubVersion.html_url" target="_blank">{{ $t('index.download') }}</a>
</div>
<h3>{{githubVersion.name}}</h3>
<pre>{{githubVersion.body}}</pre>
@ -69,8 +73,10 @@
<script type="module">
import { createApp } from 'vue'
import i18n from './locale.js'
import Navbar from './Navbar.vue'
import ResourceCard from './ResourceCard.vue'
console.log("Hello, Sunshine!")
let app = createApp({
components: {
@ -154,5 +160,10 @@
}
}
});
app.mount('#app');
//Wait for locale initialization, then render
i18n().then(i18n => {
app.use(i18n);
app.mount('#app');
});
</script>