EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Notification localization arguments fail on iOS due to strings files using %s instead of %@ #20

Closed spstratis closed 6 years ago

spstratis commented 6 years ago

When sending a localization key with localization arguments from APNS the localized arguments fail to display in the notification. This is due to the localizable strings file using %s instead %@ for formatting.

If I open up the Project in Xcode, and replace the format tokens with %@, build and run, everything works fine. Is there a known work around for this?

Unfortunately, putting the correct token in the JSON files would cause issues in Android one everything builds.

lfabreges commented 6 years ago

What is the error encountered when building Android ?

spstratis commented 6 years ago

If you use the %@ as a formatting token in Android it causes the application to crash when a push notification is received.

The error message is: java.util.unknownFormatConversionException: Conversion = '@'

lfabreges commented 6 years ago

Thanks, I'll look into it

lfabreges commented 6 years ago

I just published v2.2.0, let me know if it works

spstratis commented 6 years ago

Looks like it's working great so far, thanks!