host discovery Chinese localization. Cancel LAN restriction

This commit is contained in:
True Zhuanjia
2024-06-30 23:46:21 +08:00
parent 070fbc8b52
commit 34d9875ff3
2 changed files with 34 additions and 10 deletions
+29 -1
View File
@@ -349,6 +349,23 @@
}
}
},
"Manual_Add_Host_Fail" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Could not connect to host.\n\nIf you're hosting using GeForce Experience, make sure you've enabled the toggle on the SHIELD tab.\n\nIf you're hosting using Sunshine, ensure it is running properly. If you're using a non-default port, you will need to include that here."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "无法连接远程主机\n\n如果主机运行的是Geforce Experience, 确认SHIELD已启用.\n\n如果主机运行的是Sushine, 确认服务正常运行. 如果使用非默认端口, 请添加到地址中."
}
}
}
},
"ML_TEST_RESULT_INCONCLUSIVE" : {
"extractionState" : "manual",
"localizations" : {
@@ -366,6 +383,17 @@
}
}
},
"Moonlight-iOS/tvOS only supports adding PCs on your local network on %s." : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "Moonlight-iOS/tvOS仅支持添加局域网中的主机"
}
}
}
},
"Mouse Pointer Velocity: %d%%" : {
"extractionState" : "manual",
"localizations" : {
@@ -924,7 +952,7 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "调节靠右 %d%%屏幕区域的触点灵敏度"
"value" : "调节屏幕靠右 %d%%区域的触点灵敏度"
}
}
}
+5 -9
View File
@@ -14,6 +14,7 @@
#import "DiscoveryWorker.h"
#import "ServerInfoResponse.h"
#import "IdManager.h"
#import "LocalizationHelper.h"
#include <Limelight.h>
#include <arpa/inet.h>
@@ -110,7 +111,8 @@
return NO;
}
BOOL ret = ![DiscoveryManager isAddressLAN:((struct sockaddr_in*)result->ai_addr)->sin_addr.s_addr];
// BOOL ret = ![DiscoveryManager isAddressLAN:((struct sockaddr_in*)result->ai_addr)->sin_addr.s_addr];
BOOL ret = NO; // Cancel LAN restriction for personnal use.
freeaddrinfo(result);
return ret;
@@ -128,13 +130,7 @@
- (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback {
BOOL prohibitedAddress = [DiscoveryManager isProhibitedAddress:hostAddress];
NSString* prohibitedAddressMessage = [NSString stringWithFormat: @"Moonlight only supports adding PCs on your local network on %s.",
#if TARGET_OS_TV
"tvOS"
#else
"iOS"
#endif
];
NSString* prohibitedAddressMessage = [LocalizationHelper localizedStringForKey: @"Moonlight-iOS/tvOS only supports adding PCs on your local network on %s."];
ServerInfoResponse* serverInfoResponse = [self getServerInfoResponseForAddress:hostAddress];
TemporaryHost* host = nil;
@@ -202,7 +198,7 @@
callback(host, nil);
}
} else if (!prohibitedAddress) {
callback(nil, @"Could not connect to host.\n\nIf you're hosting using GeForce Experience, make sure you've enabled the toggle on the SHIELD tab.\n\nIf you're hosting using Sunshine, ensure it is running properly. If you're using a non-default port, you will need to include that here.");
callback(nil, [LocalizationHelper localizedStringForKey:@"Manual_Add_Host_Fail"]);
} else {
callback(nil, prohibitedAddressMessage);
}