diff --git a/Limelight/Localization/Localizable.xcstrings b/Limelight/Localization/Localizable.xcstrings index 35ee01e2..5567159a 100644 --- a/Limelight/Localization/Localizable.xcstrings +++ b/Limelight/Localization/Localizable.xcstrings @@ -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" : { diff --git a/Limelight/Stream/StreamManager.m b/Limelight/Stream/StreamManager.m index e776feef..a1c39a22 100644 --- a/Limelight/Stream/StreamManager.m +++ b/Limelight/Stream/StreamManager.m @@ -16,6 +16,7 @@ #import "HttpResponse.h" #import "HttpRequest.h" #import "IdManager.h" +#import "LocalizationHelper.h" #include @@ -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,