From 5b7cbb57535bf07ba3d5fc9498f2533300d93fd3 Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Fri, 1 Nov 2024 19:43:30 +0400 Subject: [PATCH] [platform] [ios] call static localizedStringFromDate instead of creating formatter every time Signed-off-by: Kiryl Kaveryn --- platform/localization.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/localization.mm b/platform/localization.mm index 6854418b0e..0b4881ffb8 100644 --- a/platform/localization.mm +++ b/platform/localization.mm @@ -39,10 +39,9 @@ std::string GetCurrencySymbol(std::string const & currencyCode) std::string GetLocalizedMyPositionBookmarkName() { - NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; - dateFormatter.dateStyle = NSDateFormatterLongStyle; - dateFormatter.timeStyle = NSDateFormatterShortStyle; NSDate * now = [NSDate date]; - return [dateFormatter stringFromDate:now].UTF8String; + return [NSDateFormatter localizedStringFromDate:now + dateStyle:NSDateFormatterLongStyle + timeStyle:NSDateFormatterShortStyle].UTF8String; } } // namespace platform