[foundation/usernotifications] Use NSString to preserve localization (#4697)
- Fixes #4694: NSString.GetLocalizedUserNotificationString not working with .stringsdict files (https://github.com/xamarin/xamarin-macios/issues/4694) - Updated `UNNotificationCategory.FromIdentifier`'s iOS 12 overload to take a `NSString` category format to preserve localization. - Change `GetLocalizedUserNotificationString` to only use NSString to preserve localization (similar fix to https://github.com/xamarin/xamarin-macios/pull/3266).
This commit is contained in:
Родитель
e51c2af9f8
Коммит
f6c7a506f9
|
@ -105,5 +105,12 @@ namespace Foundation {
|
|||
return _characterAtIndex (idx);
|
||||
}
|
||||
}
|
||||
|
||||
#if !XAMCORE_4_0 && !MONOMAC
|
||||
[Obsolete ("Use 'GetLocalizedUserNotificationString' that takes 'NSString' to preserve localization.")]
|
||||
public static string GetLocalizedUserNotificationString (string key, params NSObject[] arguments) {
|
||||
return GetLocalizedUserNotificationString ((NSString) key, arguments);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8151,7 +8151,7 @@ namespace Foundation
|
|||
[iOS (10,0), Watch (3,0), NoTV, Mac (10,14, onlyOn64: true)]
|
||||
[Static]
|
||||
[Export ("localizedUserNotificationStringForKey:arguments:")]
|
||||
string GetLocalizedUserNotificationString (string key, [Params] [NullAllowed] NSObject [] arguments);
|
||||
NSString GetLocalizedUserNotificationString (NSString key, [Params] [NullAllowed] NSObject [] arguments);
|
||||
|
||||
[Export ("getParagraphStart:end:contentsEnd:forRange:")]
|
||||
void GetParagraphPositions (out nuint paragraphStartPosition, out nuint paragraphEndPosition, out nuint contentsEndPosition, NSRange range);
|
||||
|
|
|
@ -309,7 +309,7 @@ namespace UserNotifications {
|
|||
[NoWatch, iOS (12,0)]
|
||||
[Static]
|
||||
[Export ("categoryWithIdentifier:actions:intentIdentifiers:hiddenPreviewsBodyPlaceholder:categorySummaryFormat:options:")]
|
||||
UNNotificationCategory FromIdentifier (string identifier, UNNotificationAction[] actions, string[] intentIdentifiers, [NullAllowed] string hiddenPreviewsBodyPlaceholder, [NullAllowed] string categorySummaryFormat, UNNotificationCategoryOptions options);
|
||||
UNNotificationCategory FromIdentifier (string identifier, UNNotificationAction[] actions, string[] intentIdentifiers, [NullAllowed] string hiddenPreviewsBodyPlaceholder, [NullAllowed] NSString categorySummaryFormat, UNNotificationCategoryOptions options);
|
||||
|
||||
[NoWatch, iOS (12, 0)]
|
||||
[Export ("categorySummaryFormat")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче