localize statsOverlay

This commit is contained in:
True Zhuanjia
2024-07-09 23:39:17 +08:00
parent b25f2d0916
commit d427270699
2 changed files with 56 additions and 3 deletions
@@ -1,6 +1,29 @@
{
"sourceLanguage" : "en",
"strings" : {
"\nHost processing latency min/max/avg: %.1f/%.1f/%.1f ms" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "\n处理延迟 最小/最大/平均: %.1f/%.1f/%.1f ms"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "\n处理延迟 最小/最大/平均: %.1f/%.1f/%.1f ms"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "\n处理延迟 最小/最大/平均: %.1f/%.1f/%.1f ms"
}
}
}
},
"!ML_TEST_RESULT_INCONCLUSIVE" : {
"extractionState" : "manual",
"localizations" : {
@@ -2148,6 +2171,35 @@
}
}
},
"Video stream: %dx%d %.2f FPS (Codec: %@)\nFrames dropped by your network connection: %.2f%%\nAverage network latency: %@%@" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Video stream: %dx%d %.2f FPS (Codec: %@)\nFrames dropped by your network connection: %.2f%%\nAverage network latency: %@%@"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "视频流: %dx%d %.2f FPS (编码格式: %@)\n网络造成的丢帧: %.2f%%\n平均网络延迟: %@%@"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "视频流: %dx%d %.2f FPS (编码格式: %@)\n网络造成的丢帧: %.2f%%\n平均网络延迟: %@%@"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "视频流: %dx%d %.2f FPS (编码格式: %@)\n网络造成的丢帧: %.2f%%\n平均网络延迟: %@%@"
}
}
}
},
"Video Width" : {
"extractionState" : "manual",
"localizations" : {
+4 -3
View File
@@ -16,6 +16,7 @@
#import "HttpResponse.h"
#import "HttpRequest.h"
#import "IdManager.h"
#import "LocalizationHelper.h"
#include <Limelight.h>
@@ -161,7 +162,7 @@
uint32_t rtt, variance;
NSString* latencyString;
if (LiGetEstimatedRttInfo(&rtt, &variance)) {
latencyString = [NSString stringWithFormat:@"%u ms (variance: %u ms)", rtt, variance];
latencyString = [LocalizationHelper localizedStringForKey:@"%u ms (variance: %u ms)", rtt, variance];
}
else {
latencyString = @"N/A";
@@ -169,7 +170,7 @@
NSString* hostProcessingString;
if (stats.framesWithHostProcessingLatency != 0) {
hostProcessingString = [NSString stringWithFormat:@"\nHost processing latency min/max/avg: %.1f/%.1f/%.1f ms",
hostProcessingString = [LocalizationHelper localizedStringForKey:@"\nHost processing latency min/max/avg: %.1f/%.1f/%.1f ms",
stats.minHostProcessingLatency / 10.f,
stats.maxHostProcessingLatency / 10.f,
(float)stats.totalHostProcessingLatency / stats.framesWithHostProcessingLatency / 10.f];
@@ -179,7 +180,7 @@
}
float interval = stats.endTime - stats.startTime;
return [NSString stringWithFormat:@"Video stream: %dx%d %.2f FPS (Codec: %@)\nFrames dropped by your network connection: %.2f%%\nAverage network latency: %@%@",
return [LocalizationHelper localizedStringForKey:@"Video stream: %dx%d %.2f FPS (Codec: %@)\nFrames dropped by your network connection: %.2f%%\nAverage network latency: %@%@",
_config.width,
_config.height,
stats.totalFrames / interval,