Wordpress-ios: Wrong date format in Dutch Translation at Statistics

Created on 13 Jul 2016  Â·  10Comments  Â·  Source: wordpress-mobile/WordPress-iOS

Dates are shown as "Month. Daynumber" (for example "jul. 13".

In Dutch this should be: "13 jul" (daynumber month)

Can find it in the translations were it goes wrong. Or is the date format not in the translation?

Stats [Type] Bug

Most helpful comment

Pull request submitted to fix this. I'll most likely aim this fix at 6.4 which is in beta testing right now.

https://github.com/wordpress-mobile/WordPressCom-Stats-iOS/pull/420

All 10 comments

img_1425

Thank you for reporting this issue! I confirmed that dates in other languages (such as German and Spanish) have the same problem with word order/punctuation on this screen.

@astralbodies If I understand correctly we're using NSDateFormatter to localize the dates through iOS system settings rather than with translations in the app. Can we fix this issue by including the locale when we set the date on this screen, so the date is formatted according to the locale (i.e. the regional format for the date)?

@rachelmcr That is correct that we are using the localization system Apple provides to provide localized dates. However in this specific case I am using a string-based format with the NSDateFormatter. Apple says the string-based format _should_ get transformed magically into an appropriate format for the locale in question. That is apparently not working right.

Specifically: https://github.com/wordpress-mobile/WordPressCom-Stats-iOS/blob/develop/WordPressCom-Stats-iOS/Services/WPStatsServiceRemote.m#L1778

So I think we can open an issue in the WordPressCom-Stats-iOS repo, reference this one, and see what we can do to improve that date formatter. I'm sure there is a way we can fix it without having to expose that format string to GlotPress.

I just did a quick test on the code change to force the NSDateFormatter instance to "translate" the format strings and this is what I got for nl-nl:

2016-07-19_14-26-02

Looks correct, but without the dot. Normally we write 'jul' as abbreviation for July or the full month.

I did another experiment using Apple's built-in date formats (short, medium, and long). It appears in "short" it does abbreviate July as jul. as well. So it's not a bug with the format string being translated wrong but rather either a bug or a choice in Apple's localization code. I might file a bug with Apple to suggest removing the period.

In any case I'll open a bug in the GitHub repo for the stats module and link it back here.

Pull request submitted to fix this. I'll most likely aim this fix at 6.4 which is in beta testing right now.

https://github.com/wordpress-mobile/WordPressCom-Stats-iOS/pull/420

@chantalcoolsma The fix is in 6.4 which you can snag if you sign up for the TestFlight beta program. https://apps.wordpress.com/2016/04/21/wordpress-for-ios-call-for-beta-testers/

Done. Thanks.

@chantalcoolsma I'll add you to the program - looks like I haven't done a build to include this fix. That'll be coming in a couple of hours. 😄

Was this page helpful?
0 / 5 - 0 ratings