Fix localization

This commit is contained in:
Ali 2021-07-27 11:33:40 +02:00
parent 4e6579d5b6
commit 6cec47b5f7
2 changed files with 9 additions and 3 deletions

View File

@ -100,7 +100,7 @@
"PUSH_MESSAGE_ROUND" = "%1$@|sent you a video message";
"PUSH_MESSAGE" = "%1$@|sent you a message";
"PUSH_MESSAGES_TEXT_1" = "sent you a message";
"PUSH_MESSAGES_TEXT_any" = "sent you %2$d messages";
"PUSH_MESSAGES_TEXT_any" = "sent you %d messages";
"PUSH_ALBUM" = "%1$@|sent you an album";
"PUSH_MESSAGE_FILES_TEXT_1" = "sent you a file";
"PUSH_MESSAGE_FILES_TEXT_any" = "sent you %d files";

View File

@ -402,9 +402,15 @@ static _FormattedString * _Nonnull formatWithArgumentRanges(
[result appendString:[string substringWithRange:
NSMakeRange(currentLocation, range.range.location - currentLocation)]];
}
NSString *argument = nil;
if (range.index >= 0 && range.index < arguments.count) {
argument = arguments[range.index];
} else {
argument = @"?";
}
[resultingRanges addObject:[[_FormattedStringRange alloc] initWithIndex:range.index
range:NSMakeRange(result.length, arguments[range.index].length)]];
[result appendString:arguments[range.index]];
range:NSMakeRange(result.length, argument.length)]];
[result appendString:argument];
currentLocation = range.range.location + range.range.length;
}