alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
646 stars 119 forks source link

internalTitle localization in PhotosViewController #31

Closed DarkwingXL closed 6 years ago

DarkwingXL commented 6 years ago

Hi, There is a small fix in fileprivate func updateOverlay(for photoIndex: Int)

517 self.overlayView.internalTitle = NSLocalizedString("(photoIndex + 1) of (self.dataSource.numberOfPhotos)", comment: "")

It must be somelike ...

self.overlayView.internalTitle = "(photoIndex + 1) " + NSLocalizedString("of", comment:"") + " (self.dataSource.numberOfPhotos)"

... to get easy localized version. Or you can use String.localizedStringWithFormat to cover some difficult cases like Arabic language and so on.

alexhillc commented 6 years ago

Hey @DarkwingXL, thanks for the report -- I'll have this fixed in the next release

alexhillc commented 6 years ago

This is fixed in the latest commit, closing out this issue.

abdullahumer commented 5 years ago

I was facing the same issue.

The line String.localizedStringWithFormat("%d of %d", photoIndex + 1, self.dataSource.numberOfPhotos) was not working.

I changed it to String.localizedStringWithFormat(NSLocalizedString("%d of %d", comment: ""), photoIndex + 1, self.dataSource.numberOfPhotos) and it worked.

I have this in my Localized.strings file "%d of %d" = "%d من %d";