Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Generate ids for localizable strings and images #50

Open
Shulepov opened this issue Jul 7, 2015 · 5 comments
Open

Generate ids for localizable strings and images #50

Shulepov opened this issue Jul 7, 2015 · 5 comments

Comments

@Shulepov
Copy link
Contributor

Shulepov commented Jul 7, 2015

I'm not sure that this functionality should be placed directly inside Natalie, may be should be created a different tool.

Generating identifiers for storyboards stuff definitely is a good step :) But there are also quite a lot of magic strings in the project - for localizable strings (NSLocalizedString("Hello", ...)) or for images UIImage(named: "Logo"), and other files in the bundle.

So, may be also can be generated analogue of R file on android. So, for strings and images can be generated something like:

struct Strings {
     static let Hello = "Hello"
}
struct Images {
    static let Logo = "Logo"
}

And for convenience:

struct LocalizedString {
     static var Hello = { return NSLocalizedString(Strings.hello, ...) }
}
@CallumOz
Copy link
Contributor

CallumOz commented Jul 7, 2015

Apple did a great talk on this at WWDC 2015 called Swift in practise.

@krzyzanowskim
Copy link
Owner

Thanks, this is valid feature request, I'd like to have it. I'll work on that after transition to Swift 2.0

@krzyzanowskim
Copy link
Owner

@CallumOz As seen on tv ;-)

@a1cooke
Copy link

a1cooke commented Jan 5, 2017

@krzyzanowskim was thinking of starting to look at help out on some of this, looking at the binary invocation, do you have thoughts on what it might look like in terms of invoking the API

@krzyzanowskim
Copy link
Owner

hey, great! I don't have any preferences in that regard. Feel free to propose something. I'm looking forward to merge it!

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

No branches or pull requests

4 participants