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

Add best practices for dealing with localisation #24

Open
elland opened this issue May 3, 2016 · 9 comments
Open

Add best practices for dealing with localisation #24

elland opened this issue May 3, 2016 · 9 comments
Assignees

Comments

@elland
Copy link
Contributor

elland commented May 3, 2016

Needs some research as well, on possible methods to deal with it. NSLocalizedString() is subpar.

@3lvis 3lvis changed the title Add best practices for dealing with localisation. Add best practices for dealing with localisation May 3, 2016
@3lvis
Copy link
Contributor

3lvis commented May 3, 2016

I mentioned not using a wrapper for NSLocalizedString because it breaks genstrings usage.

http://nshipster.com/nslocalizedstring/

@3lvis
Copy link
Contributor

3lvis commented May 3, 2016

What do you have in mind?

@onmyway133
Copy link

I like the JSON approach https://github.com/tomkowz/Swifternalization

@elland
Copy link
Contributor Author

elland commented Jun 2, 2016

This seems interesting. Will take a closer look tomorrow if time allows. 👍

@3lvis
Copy link
Contributor

3lvis commented Sep 5, 2016

This was suggested as well.

import Foundation

extension String {
    func localized() -> String {
        return self.localizedWithComment("")
    }

    func localizedWithComment(comment:String) -> String {
        return NSLocalizedString(self, tableName: nil, bundle: NSBundle.mainBundle(), value: "", comment: comment)
    }
}

@3lvis
Copy link
Contributor

3lvis commented Sep 5, 2016

So far I would go for having a tool that would generate static keys for every key in a localization file.

@elland
Copy link
Contributor Author

elland commented Sep 5, 2016

I'd like that. No issues with typos.

@3lvis
Copy link
Contributor

3lvis commented Dec 14, 2016

@3lvis 3lvis self-assigned this Dec 22, 2016
@3lvis 3lvis removed their assignment Jan 3, 2017
@designatednerd designatednerd self-assigned this May 3, 2018
@designatednerd
Copy link
Contributor

This is addressed in the updated style guide in #118

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

No branches or pull requests

4 participants