Translation updates and refactoring

This commit is contained in:
Cameron Gutman
2020-11-21 13:15:54 -06:00
parent 2c987d2912
commit 6e7a42065c
21 changed files with 919 additions and 661 deletions

View File

@@ -268,7 +268,7 @@ CenteredGridView {
property bool segueToStream : false
property string nextAppName: ""
property int nextAppIndex: 0
text:qsTr("Are you sure you want to quit " + appName +"? Any unsaved progress will be lost.")
text:qsTr("Are you sure you want to quit %1? Any unsaved progress will be lost.").arg(appName)
standardButtons: Dialog.Yes | Dialog.No
function quitApp() {

View File

@@ -78,7 +78,7 @@ Item {
NavigableMessageDialog {
id: quitAppDialog
text:qsTr("Are you sure you want to quit " + appName +"? Any unsaved progress will be lost.")
text:qsTr("Are you sure you want to quit %1? Any unsaved progress will be lost.").arg(appName)
standardButtons: Dialog.Yes | Dialog.No
property string appName : ""

View File

@@ -1,5 +1,5 @@
import QtQuick 2.0
Item {
objectName: "Gamepad Mapping"
objectName: qsTr("Gamepad Mapping")
}

View File

@@ -67,7 +67,7 @@ CenteredGridView {
errorDialog.text = qsTr("Unable to connect to the specified PC.")
if (detectedPortBlocking) {
errorDialog.text += qsTr("\n\nThis PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
errorDialog.text += "\n\n" + qsTr("This PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
}
else {
errorDialog.helpText = qsTr("Click the Help button for possible solutions.")
@@ -293,7 +293,7 @@ CenteredGridView {
// don't allow edits to the rest of the window while open
property string pin : "0000"
text:qsTr("Please enter " + pin + " on your GameStream PC. This dialog will close when pairing is completed.")
text:qsTr("Please enter %1 on your GameStream PC. This dialog will close when pairing is completed.").arg(pin)
standardButtons: Dialog.Cancel
onRejected: {
// FIXME: We should interrupt pairing here
@@ -321,7 +321,7 @@ CenteredGridView {
standardButtons: Dialog.Ok
onAboutToShow: {
testConnectionDialog.text = qsTr("Moonlight is testing your network connection to determine if NVIDIA GameStream is blocked.\n\nThis may take a few seconds…")
testConnectionDialog.text = qsTr("Moonlight is testing your network connection to determine if NVIDIA GameStream is blocked.") + "\n\n" + qsTr("This may take a few seconds…")
showSpinner = true
}
@@ -332,11 +332,11 @@ CenteredGridView {
imageSrc = "qrc:/res/baseline-warning-24px.svg"
}
else if (result === 0) {
text = qsTr("This network does not appear to be blocking Moonlight. If you still have trouble connecting, check your PC's firewall settings.\n\nIf you are trying to stream over the Internet, install the Moonlight Internet Hosting Tool on your gaming PC and run the included Internet Streaming Tester to check your gaming PC's Internet connection.")
text = qsTr("This network does not appear to be blocking Moonlight. If you still have trouble connecting, check your PC's firewall settings.") + "\n\n" + qsTr("If you are trying to stream over the Internet, install the Moonlight Internet Hosting Tool on your gaming PC and run the included Internet Streaming Tester to check your gaming PC's Internet connection.")
imageSrc = "qrc:/res/baseline-check_circle_outline-24px.svg"
}
else {
text = qsTr("Your PC's current network connection seems to be blocking Moonlight. Streaming over the Internet may not work while connected to this network.\n\nThe following network ports were blocked:\n")
text = qsTr("Your PC's current network connection seems to be blocking Moonlight. Streaming over the Internet may not work while connected to this network.") + "\n\n" + qsTr("The following network ports were blocked:") + "\n"
text += blockedPorts
imageSrc = "qrc:/res/baseline-error_outline-24px.svg"
}

View File

@@ -9,7 +9,7 @@ Item {
property Session nextSession : null
property string nextAppName : ""
property string stageText : qsTr("Quitting " + appName + "...")
property string stageText : qsTr("Quitting %1...").arg(appName)
function quitAppCompleted(error)
{

View File

@@ -50,7 +50,7 @@ Flickable {
id: basicSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">Basic Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("Basic Settings") + "</font>"
font.pointSize: 12
Column {
@@ -170,22 +170,22 @@ Flickable {
// Other elements may be added at runtime
// based on attached display resolution
ListElement {
text: "720p"
text: qsTr("720p")
video_width: "1280"
video_height: "720"
}
ListElement {
text: "1080p"
text: qsTr("1080p")
video_width: "1920"
video_height: "1080"
}
ListElement {
text: "1440p"
text: qsTr("1440p")
video_width: "2560"
video_height: "1440"
}
ListElement {
text: "4K"
text: qsTr("4K")
video_width: "3840"
video_height: "2160"
}
@@ -215,16 +215,16 @@ Flickable {
var max_fps = SystemProperties.maximumStreamingFrameRate
// Default entries
fpsListModel.append({"text": qsTr("30 FPS"), "video_fps": "30"})
fpsListModel.append({"text": qsTr("60 FPS"), "video_fps": "60"})
fpsListModel.append({"text": qsTr("%1 FPS").arg("30"), "video_fps": "30"})
fpsListModel.append({"text": qsTr("%1 FPS").arg("60"), "video_fps": "60"})
// Add unsupported FPS values that come before the display max FPS
if (StreamingPreferences.unsupportedFps) {
if (max_fps > 90) {
fpsListModel.append({"text": qsTr("90 FPS (Unsupported)"), "video_fps": "90"})
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg("90"), "video_fps": "90"})
}
if (max_fps > 120) {
fpsListModel.append({"text": qsTr("120 FPS (Unsupported)"), "video_fps": "120"})
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg("120"), "video_fps": "120"})
}
}
@@ -233,23 +233,23 @@ Flickable {
if (max_fps > 64) {
// Mark any FPS value greater than 120 as unsupported
if (StreamingPreferences.unsupportedFps && max_fps > 120) {
fpsListModel.append({"text": max_fps+qsTr(" FPS (Unsupported)"), "video_fps": ""+max_fps})
fpsListModel.append({"text": qsTr("%1 FPS (Unsupported)").arg(max_fps), "video_fps": ""+max_fps})
}
else if (max_fps > 120) {
fpsListModel.append({"text": "120 FPS", "video_fps": "120"})
fpsListModel.append({"text": qsTr("%1 FPS").arg("120"), "video_fps": "120"})
}
else {
fpsListModel.append({"text": max_fps+" FPS", "video_fps": ""+max_fps})
fpsListModel.append({"text": qsTr("%1 FPS").arg(max_fps), "video_fps": ""+max_fps})
}
}
// Add unsupported FPS values that come after the display max FPS
if (StreamingPreferences.unsupportedFps) {
if (max_fps < 90) {
fpsListModel.append({"text":qsTr( "90 FPS (Unsupported)"), "video_fps": "90"})
fpsListModel.append({"text":qsTr("%1 FPS (Unsupported)").arg("90"), "video_fps": "90"})
}
if (max_fps < 120) {
fpsListModel.append({"text":qsTr( "120 FPS (Unsupported)"), "video_fps": "120"})
fpsListModel.append({"text":qsTr("%1 FPS (Unsupported)").arg("120"), "video_fps": "120"})
}
}
@@ -302,7 +302,7 @@ Flickable {
Label {
width: parent.width
id: bitrateTitle
text: qsTr("Video bitrate: ")
text: qsTr("Video bitrate:")
font.pointSize: 12
wrapMode: Text.Wrap
}
@@ -328,7 +328,7 @@ Flickable {
width: Math.min(bitrateDesc.implicitWidth, parent.width)
onValueChanged: {
bitrateTitle.text = qsTr("Video bitrate: " + (value / 1000.0) + " Mbps")
bitrateTitle.text = qsTr("Video bitrate: %1 Mbps").arg(value / 1000.0)
StreamingPreferences.bitrateKbps = value
}
}
@@ -403,7 +403,7 @@ Flickable {
id: vsyncCheck
width: parent.width
hoverEnabled: true
text: "V-Sync"
text: qsTr("V-Sync")
font.pointSize: 12
checked: StreamingPreferences.enableVsync
onCheckedChanged: {
@@ -440,7 +440,7 @@ Flickable {
id: audioSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">Audio Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("Audio Settings") + "</font>"
font.pointSize: 12
Column {
@@ -475,15 +475,15 @@ Flickable {
model: ListModel {
id: audioListModel
ListElement {
text: "Stereo"
text: qsTr("Stereo")
val: StreamingPreferences.AC_STEREO
}
ListElement {
text: "5.1 surround sound"
text: qsTr("5.1 surround sound")
val: StreamingPreferences.AC_51_SURROUND
}
ListElement {
text: "7.1 surround sound"
text: qsTr("7.1 surround sound")
val: StreamingPreferences.AC_71_SURROUND
}
}
@@ -500,7 +500,7 @@ Flickable {
id: uiSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">UI Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("UI Settings") + "</font>"
font.pointSize: 12
Column {
@@ -562,7 +562,7 @@ Flickable {
id: gamepadSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">Input Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("Input Settings") + "</font>"
font.pointSize: 12
Column {
@@ -582,7 +582,7 @@ Flickable {
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered
ToolTip.text: qsTr("Forces a single gamepad to always stay connected to the host, even if no gamepads are actually connected to this PC.\n") +
ToolTip.text: qsTr("Forces a single gamepad to always stay connected to the host, even if no gamepads are actually connected to this PC.") + "\n" +
qsTr("Only enable this option when streaming a game that doesn't support gamepads being connected after startup.")
}
@@ -601,8 +601,8 @@ Flickable {
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: hovered
ToolTip.text: qsTr("This enables mouse control without capturing the client's mouse cursor. It will not work in most games.\n
You can toggle this while streaming using Ctrl+Alt+Shift+M.")
ToolTip.text: qsTr("This enables mouse control without capturing the client's mouse cursor. It will not work in most games.") + "\n" +
qsTr("You can toggle this while streaming using Ctrl+Alt+Shift+M.")
}
CheckBox {
@@ -662,7 +662,7 @@ Flickable {
id: hostSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">Host Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("Host Settings") + "</font>"
font.pointSize: 12
Column {
@@ -713,7 +713,7 @@ Flickable {
id: advancedSettingsGroupBox
width: (parent.width - (parent.leftPadding + parent.rightPadding))
padding: 12
title: qsTr("<font color=\"skyblue\">Advanced Settings</font>")
title: "<font color=\"skyblue\">" + qsTr("Advanced Settings") + "</font>"
font.pointSize: 12
Column {
@@ -798,15 +798,15 @@ Flickable {
val: StreamingPreferences.VCC_AUTO
}
ListElement {
text: "H.264"
text: qsTr("H.264")
val: StreamingPreferences.VCC_FORCE_H264
}
ListElement {
text: "HEVC (H.265)"
text: qsTr("HEVC (H.265)")
val: StreamingPreferences.VCC_FORCE_HEVC
}
/*ListElement {
text: "HEVC HDR (Experimental)"
text: qsTr("HEVC HDR (Experimental)")
val: StreamingPreferences.VCC_FORCE_HEVC_HDR
}*/
}

View File

@@ -8,19 +8,19 @@ import Session 1.0
Item {
property Session session
property string appName
property string stageText : qsTr("Starting " + appName + "...")
property string stageText : qsTr("Starting %1...").arg(appName)
property bool quitAfter : false
function stageStarting(stage)
{
// Update the spinner text
stageText = qsTr("Starting " + stage + "...")
stageText = qsTr("Starting %1...").arg(stage)
}
function stageFailed(stage, errorCode)
{
// Display the error dialog after Session::exec() returns
streamSegueErrorDialog.text = qsTr("Starting " + stage + " failed: Error " + errorCode)
streamSegueErrorDialog.text = qsTr("Starting %1 failed: Error %2").arg(stage).arg(errorCode)
}
function connectionStarted()
@@ -65,7 +65,7 @@ Item {
function sessionFinished(portTestResult)
{
if (portTestResult !== 0 && portTestResult !== -1 && streamSegueErrorDialog.text) {
streamSegueErrorDialog.text += qsTr("\n\nThis PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
streamSegueErrorDialog.text += "\n\n" + qsTr("This PC's Internet connection is blocking Moonlight. Streaming over the Internet may not work while connected to this network.")
}
// Enable GUI gamepad usage now
@@ -147,9 +147,8 @@ Item {
// in the hintText control itself to synchronize
// with Session.exec() which requires no concurrent
// gamepad usage.
hintText.text = SdlGamepadKeyNavigation.getConnectedGamepads() > 0 ?
qsTr("Tip: Press Start+Select+L1+R1 to disconnect your session") :
qsTr("Tip: Press Ctrl+Alt+Shift+Q to disconnect your session")
hintText.text = qsTr("Tip:") + " " + qsTr("Press %1 to disconnect your session").arg(SdlGamepadKeyNavigation.getConnectedGamepads() > 0 ?
qsTr("Start+Select+L1+R1") : qsTr("Ctrl+Alt+Shift+Q"))
// Stop GUI gamepad usage now
SdlGamepadKeyNavigation.disable()

View File

@@ -224,7 +224,7 @@ ApplicationWindow {
Label {
id: versionLabel
visible: stackView.currentItem.objectName === qsTr("Settings")
text: "Version " + SystemProperties.versionString
text: qsTr("Version %1").arg(SystemProperties.versionString)
font.pointSize: 12
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter
@@ -299,7 +299,7 @@ ApplicationWindow {
function updateAvailable(version, url)
{
ToolTip.text = qsTr("Update available for Moonlight: Version ") + version
ToolTip.text = qsTr("Update available for Moonlight: Version %1").arg(version)
updateButton.browserUrl = url
updateButton.visible = true
}
@@ -346,11 +346,11 @@ ApplicationWindow {
ToolTip.delay: 1000
ToolTip.timeout: 3000
ToolTip.visible: hovered
ToolTip.text: "Gamepad Mapper"
ToolTip.text: qsTr("Gamepad Mapper")
iconSource: "qrc:/res/ic_videogame_asset_white_48px.svg"
onClicked: navigateTo("qrc:/gui/GamepadMapper.qml", "Gamepad Mapping")
onClicked: navigateTo("qrc:/gui/GamepadMapper.qml", qsTr("Gamepad Mapping"))
Keys.onDownPressed: {
stackView.currentItem.forceActiveFocus(Qt.TabFocus)
@@ -384,16 +384,16 @@ ApplicationWindow {
ErrorMessageDialog {
id: noHwDecoderDialog
text: qsTr("No functioning hardware accelerated H.264 video decoder was detected by Moonlight. ") +
qsTr("Your streaming performance may be severely degraded in this configuration.")
text: qsTr("No functioning hardware accelerated H.264 video decoder was detected by Moonlight. " +
"Your streaming performance may be severely degraded in this configuration.")
helpText: qsTr("Click the Help button for more information on solving this problem.")
helpUrl: "https://github.com/moonlight-stream/moonlight-docs/wiki/Fixing-Hardware-Decoding-Problems"
}
ErrorMessageDialog {
id: xWaylandDialog
text: qsTr("Hardware acceleration doesn't work on XWayland. Continuing on XWayland may result in poor streaming performance. ") +
qsTr("Try running with QT_QPA_PLATFORM=wayland or switch to X11.")
text: qsTr("Hardware acceleration doesn't work on XWayland. Continuing on XWayland may result in poor streaming performance. " +
"Try running with QT_QPA_PLATFORM=wayland or switch to X11.")
helpText: qsTr("Click the Help button for more information.")
helpUrl: "https://github.com/moonlight-stream/moonlight-docs/wiki/Fixing-Hardware-Decoding-Problems"
}
@@ -410,7 +410,7 @@ ApplicationWindow {
ErrorMessageDialog {
id: unmappedGamepadDialog
property string unmappedGamepads : ""
text: qsTr("Moonlight detected gamepads without a mapping:\n") + unmappedGamepads
text: qsTr("Moonlight detected gamepads without a mapping:") + "\n" + unmappedGamepads
helpTextSeparator: "\n\n"
helpText: qsTr("Click the Help button for information on how to map your gamepads.")
helpUrl: "https://github.com/moonlight-stream/moonlight-docs/wiki/Gamepad-Mapping"