feat(ui/i18n): mark most of the yuzu-specific strings as translatable

This commit is contained in:
liushuyu 2021-10-14 23:03:21 -06:00
parent dde96db57c
commit 2d42189e5e
No known key found for this signature in database
GPG Key ID: 23D1CE4534419437
6 changed files with 56 additions and 45 deletions

View File

@ -25,7 +25,9 @@
"overwriting": "Overwriting",
"overwriting_warning": "Directory {path} already exists.<br>Are you sure you want to <b>overwrite</b> the contents inside?",
"nothing_picked": "Nothing selected",
"nothing_picked_warning": "Please select at least one package to install!"
"nothing_picked_warning": "Please select at least one package to install!",
"options": "Install Options",
"option_shortcut": "Create Desktop Shortcut"
},
"install_packages":{
"check_for_update":"Checking for updates...",
@ -44,7 +46,9 @@
"up_to_date":"{name} is already up to date!",
"updated":"{name} has been updated.",
"uninstalled":"{name} has been uninstalled.",
"where_to_find":"You can find your installed applications in your start menu."
"where_to_find":"You can find your installed applications in your start menu.",
"migration_where_to_find": "You can find your installed applications in your start menu - if you were in the middle of something, just reattempt.",
"migration_finished": "You have been moved to the new, single version of {name}."
},
"modify":{
"title":"Choose an option:",
@ -56,6 +60,14 @@
"prompt":"Are you sure you want to uninstall {name}?",
"prompt_confirm":"Uninstall {name}"
},
"auth":{
"paste": "Paste",
"token": "Token",
"verify": "Verify Token",
"page_header": "The <strong>Early Access</strong> release channel lets you try out the latest experimental features and fixes, before they are merged into yuzu. This channel includes all regular yuzu daily updates, plus these exclusive features.\n\nTo be an Early Access member, you must be a Patreon Early Access Subscriber.",
"page_opened": "Page opened! Check your default browser for the page, and follow the instructions there to link your patreon account.\nWhen you are done, enter the token below.",
"login_failed": "Login failed!\n\nDouble check that your token is correct and try again"
},
"back":"Back",
"exit":"Exit",
"yes":"Yes",

View File

@ -2,13 +2,10 @@
<div class="column has-padding">
<section>
<b-message type="is-info" :active.sync="browser_opened">
Page opened! Check your default browser for the page, and follow the instructions there to link your patreon account.
When you are done, enter the token below.
{{ $t('auth.page_opened') }}
</b-message>
<b-message type="is-info" :active.sync="show_header">
The <strong>Early Access</strong> release channel lets you try out the latest experimental features and fixes, before they are merged into yuzu. This channel includes all regular yuzu daily updates, plus these exclusive features.
To be an Early Access member, you must be a Patreon Early Access Subscriber.
{{ $t('auth.page_header') }}
</b-message>
<div>
If you are a subscriber, <a v-on:click="launch_browser('https://profile.yuzu-emu.org/')">click here to link your yuzu-emu.org account</a>
@ -20,11 +17,11 @@
<br>
<section>
<p>Token</p>
<p>{{ $t('auth.token') }}</p>
<b-field>
<b-input type="text" v-model="combined_token" placeholder="Token" id="token" style='width: 50em;'></b-input>
<p class="control">
<button class="button is-info" v-on:click="paste">Paste</button>
<button class="button is-info" v-on:click="paste">{{ $t('auth.paste') }}</button>
</p>
</b-field>
</section>
@ -34,13 +31,11 @@
<section>
<b-message type="is-danger" :active.sync="invalid_token">
Login failed!
Double check that your token is correct and try again
{{ $t('auth.login_failed') }}
</b-message>
<b-message type="is-danger" :active.sync="invalid_login">
Login failed!
Double check that your token is correct and try again
{{ $t('auth.login_failed') }}
</b-message>
<b-message type="is-danger" :active.sync="unlinked_patreon">
@ -61,13 +56,13 @@
<div class="is-left-floating is-bottom-floating">
<p class="control">
<a class="button is-medium" v-on:click="go_back">Back</a>
<a class="button is-medium" v-on:click="go_back">{{ $t('back') }}</a>
</p>
</div>
<div class="is-right-floating is-bottom-floating">
<p class="control">
<a class="button is-dark is-medium" v-on:click="verify_token">Verify Token</a>
<b-button type="is-link is-medium" :loading="loading" v-on:click="verify_token">{{ $t('auth.verify') }}</b-button>
</p>
</div>
</div>
@ -88,7 +83,8 @@ export default {
return {
browser_opened: false,
verification_opened: false,
invalid_token: false
invalid_token: false,
loading: false
}
},
computed: {
@ -148,6 +144,7 @@ export default {
}).catch(function () {})
},
verify_token: function () {
this.loading = true
this.browser_opened = false
this.$root.check_authentication(this.success, this.error)
},
@ -159,8 +156,10 @@ export default {
}
// They aren't currently eligible for the release, so display the error message
this.verification_opened = true
this.loading = false
},
error: function () {
this.loading = false
this.verification_opened = true
}
}

View File

@ -1,9 +1,9 @@
<template>
<div class="column has-padding">
<div v-if="was_migrate">
<h4 class="subtitle">You have been moved to the new, single version of {{ $root.$data.attrs.name }}.</h4>
<h4 class="subtitle">{{ $t('complete.migration_finished', {'name': $root.$data.attrs.name}) }}</h4>
<p>You can find your installed applications in your start menu - if you were in the middle of something, just reattempt.</p>
<p>{{ $t('complete.migration_where_to_find') }}</p>
<img src="../assets/how-to-open.png" alt="Where yuzu is installed"/>
</div>

View File

@ -25,33 +25,33 @@ export default {
},
created: function () {
// See if we need to migrate yuzu to mainline
var need_migrate = false;
for (var package_id in this.$root.metadata.database.packages) {
let need_migrate = false
for (const package_id in this.$root.metadata.database.packages) {
var name = this.$root.metadata.database.packages[package_id].name
if ((name.indexOf("Nightly") !== -1 || name.indexOf("Canary") !== -1)) {
console.log("Migration needed (found \"" + name + "\", move to mainline)")
if ((name.indexOf('Nightly') !== -1 || name.indexOf('Canary') !== -1)) {
console.log('Migration needed (found "' + name + '", move to mainline)')
// Migration step: deactivate this package
if ( this.$root.config.packages[package_id] !== undefined) {
this.$root.config.packages[package_id].default = false;
if (this.$root.config.packages[package_id] !== undefined) {
this.$root.config.packages[package_id].default = false
}
// Migration step: enable mainline
for (var sub_package_id in this.$root.config.packages) {
for (const sub_package_id in this.$root.config.packages) {
var name = this.$root.config.packages[sub_package_id].name
if (name === "yuzu") {
this.$root.config.packages[sub_package_id].default = true;
break;
if (name === 'yuzu') {
this.$root.config.packages[sub_package_id].default = true
break
}
}
need_migrate = true;
need_migrate = true
}
}
console.log("Next stop: " + JSON.stringify(this.next_stop));
console.log('Next stop: ' + JSON.stringify(this.next_stop))
if (need_migrate) {
this.next_stop = "/complete/false/true/true/[]"
this.next_stop = '/complete/false/true/true/[]'
this.install()
} else {
this.$router.replace(this.next_stop)
@ -59,37 +59,37 @@ export default {
},
methods: {
install: function () {
var that = this
var app = this.$root
const that = this
const app = this.$root
var results = {}
const results = {}
for (var package_index = 0; package_index < app.config.packages.length; package_index++) {
var current_package = app.config.packages[package_index]
for (let package_index = 0; package_index < app.config.packages.length; package_index++) {
const current_package = app.config.packages[package_index]
if (current_package.default != null) {
results[current_package.name] = current_package.default
}
}
console.log("Install results: " + JSON.stringify(results));
console.log('Install results: ' + JSON.stringify(results))
results['path'] = app.install_location
results.path = app.install_location
var targetUrl = '/api/start-install'
const targetUrl = '/api/start-install'
this.$root.stream_ajax(targetUrl, function (line) {
// On progress line received from server
if (line.hasOwnProperty('Status')) {
if (line.Status) {
that.progress_message = line.Status[0]
that.progress = line.Status[1] * 100
}
if (line.hasOwnProperty('PackageInstalled')) {
if (line.PackageInstalled) {
that.packages_installed += 1
}
if (line.hasOwnProperty('Error')) {
if (line.Error) {
that.failed_with_error = true
that.$router.replace({ name: 'showerr', params: { msg: line.Error } })
}

View File

@ -12,7 +12,7 @@
<div class="is-left-floating is-bottom-floating">
<p class="control">
<a class="button is-medium" v-on:click="go_packages">Back</a>
<a class="button is-medium" v-on:click="go_packages">{{ $t('back') }}</a>
</p>
</div>

View File

@ -29,9 +29,9 @@
</div>
</div>
<div class="tile is-child is-6 box clickable-box" v-if="!$root.$data.metadata.preexisting_install" v-on:click.capture.stop="installDesktopShortcut = !installDesktopShortcut">
<h4>Install Options</h4>
<h4>{{ $t('select_packages.options') }}</h4>
<b-checkbox v-model="installDesktopShortcut">
Create Desktop Shortcut
{{ $t('select_packages.option_shortcut') }}
</b-checkbox>
</div>