Skip to content

Commit b660379

Browse files
committed
(TEMP?) transport error translations
1 parent 7949431 commit b660379

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

QSB/Localization/Translation.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using Mirror;
2+
using System.Collections.Generic;
23

34
namespace QSB.Localization;
45

@@ -28,6 +29,7 @@ public class Translation
2829
public string OK;
2930
public string ServerRefusedConnection;
3031
public string ClientDisconnectWithError;
32+
public Dictionary<TransportError, string> TransportErrors;
3133
public string QSBVersionMismatch;
3234
public string OWVersionMismatch;
3335
public string DLCMismatch;

QSB/Menus/MenuManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ private void OnDisconnected(TransportError error, string reason)
736736
}
737737
};
738738

739-
OpenInfoPopup(string.Format(QSBLocalization.Current.ClientDisconnectWithError, reason), QSBLocalization.Current.OK);
739+
OpenInfoPopup(string.Format(QSBLocalization.Current.ClientDisconnectWithError, QSBLocalization.Current.TransportErrors[error], reason), QSBLocalization.Current.OK);
740740
}
741741

742742
SetButtonActive(DisconnectButton, false);

QSB/Translations/en.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@
2222
"Connecting": "CONNECTING...",
2323
"OK": "OK",
2424
"ServerRefusedConnection": "Server refused connection.\n{0}",
25-
"ClientDisconnectWithError": "Client disconnected with error!\n{0}",
25+
"ClientDisconnectWithError": "Client disconnected with error!\n{0}\nMore info: {1}",
26+
"TransportErrors": {
27+
"DnsResolve": "Failed to resolve host name.",
28+
"Refused": "Connection refused.",
29+
"Timeout": "Connection timed out.",
30+
"Congestion": "Congestion on transport.",
31+
"InvalidReceive": "Error receiving message.",
32+
"InvalidSend": "Error sending message.",
33+
"ConnectionClosed": "Connection closed.",
34+
"Unexpected": "Unexpected error."
35+
},
2636
"QSBVersionMismatch": "QSB version does not match. (Client:{0}, Server:{1})",
2737
"OWVersionMismatch": "Outer Wilds version does not match. (Client:{0}, Server:{1})",
2838
"DLCMismatch": "DLC installation state does not match. (Client:{0}, Server:{1})",

0 commit comments

Comments
 (0)