Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internalTitle localization in PhotosViewController #31

Closed
DarkwingXL opened this issue Feb 15, 2018 · 3 comments
Closed

internalTitle localization in PhotosViewController #31

DarkwingXL opened this issue Feb 15, 2018 · 3 comments

Comments

@DarkwingXL
Copy link

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
Copy link
Owner

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

@alexhillc
Copy link
Owner

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

@abdullahumer
Copy link

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";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants