From f7929476f7d772101474d7a7072a2610ac955bdc Mon Sep 17 00:00:00 2001 From: wutschel Date: Sun, 19 Jan 2025 17:47:44 +0100 Subject: [PATCH] Rework logic to identify "resume" in actionSheetHandler Instead of comparing two separately translated strings (which is faulty for Turkish, and in general not robust), use the same string as base to identify the "Resume from" pattern for all languages This also allows to remove the string "Resume from" completely as we already have "Resume from %@". --- XBMC Remote/ShowInfoViewController.m | 3 ++- XBMC Remote/en.lproj/Localizable.strings | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XBMC Remote/ShowInfoViewController.m b/XBMC Remote/ShowInfoViewController.m index ea02af96e..d2a56b621 100644 --- a/XBMC Remote/ShowInfoViewController.m +++ b/XBMC Remote/ShowInfoViewController.m @@ -388,6 +388,7 @@ - (void)showActionSheet { } - (void)actionSheetHandler:(NSString*)actiontitle { + NSString *resumeKey = [LOCALIZED_STR(@"Resume from %@") stringByReplacingOccurrencesOfString:@"%@" withString:@""]; if ([actiontitle isEqualToString:LOCALIZED_STR(@"Queue after current")]) { [self addQueueAfterCurrent:YES]; } @@ -401,7 +402,7 @@ - (void)actionSheetHandler:(NSString*)actiontitle { [actiontitle isEqualToString:LOCALIZED_STR(@"Stop Recording")]) { [self recordChannel]; } - else if ([actiontitle rangeOfString:LOCALIZED_STR(@"Resume from")].location != NSNotFound) { + else if ([actiontitle rangeOfString:resumeKey].location != NSNotFound) { [self resumePlayback]; } else if ([actiontitle isEqualToString:LOCALIZED_STR(@"Play Trailer")]) { diff --git a/XBMC Remote/en.lproj/Localizable.strings b/XBMC Remote/en.lproj/Localizable.strings index 7a85c90d4..4bbc53b7e 100644 --- a/XBMC Remote/en.lproj/Localizable.strings +++ b/XBMC Remote/en.lproj/Localizable.strings @@ -98,7 +98,6 @@ "OK" = "OK"; "Cancel" = "Cancel"; "Resume from %@" = "Resume from %@"; -"Resume from" = "Resume from"; "First aired on %@" = "First aired on %@"; "Episodes: %@" = "Episodes: %@"; "1 result" = "1 result";