Skip to content

Conversation

@L1cardo
Copy link
Contributor

@L1cardo L1cardo commented Jul 5, 2019

I have localized all localizable strings, but there are also some that are not.

截屏2019-07-05下午1 59 11

截屏2019-07-05下午1 59 25

截屏2019-07-05下午2 00 17

@pigigaldi
Copy link
Collaborator

You need to localize the project first and then use NSLocalizedString.
You can find a helpful article here, written by @MarcoSantarossa, that can give you some excellent tips on how to handle localization with Swift.

@L1cardo
Copy link
Contributor Author

L1cardo commented Jul 6, 2019

You need to localize the project first and then use NSLocalizedString.
You can find a helpful article here, written by @MarcoSantarossa, that can give you some excellent tips on how to handle localization with Swift.

I made changes based on your suggestions. Now it works perfect !

截屏2019-07-06下午9 05 17

截屏2019-07-06下午9 05 28

截屏2019-07-06下午9 05 56

@L1cardo
Copy link
Contributor Author

L1cardo commented Jul 6, 2019

Another issue is that I don't know what these strings below stands for, and I haven't met them yet , so it is not localized.

截屏2019-07-06下午9 34 20

@pigigaldi
Copy link
Collaborator

pigigaldi commented Jul 6, 2019

Hey @L1cardo, I want to merge your PR into Pock because I know how better it could be if more localizations will be added.
Sadly, I have to ask you to refactor your code in a way that, if Apple changed NSLocalizedString structure, we'd not need to mess around the project to fix all cases.

What do you think about something like this?

extension String {
    var localized: String {
        return NSLocalizedString(self, comment: self)
    }
}

Waiting for your refactor, will be merged in the next release! 🎉

@L1cardo
Copy link
Contributor Author

L1cardo commented Jul 7, 2019 via email

@L1cardo
Copy link
Contributor Author

L1cardo commented Jul 7, 2019

How about now ? This is the best I can do .

@pigigaldi pigigaldi merged commit 92bb245 into pock:master Aug 4, 2019
pigigaldi added a commit that referenced this pull request Aug 4, 2019
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

Successfully merging this pull request may close these issues.

2 participants