mac-cain13 / R.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects
MIT License
9.5k stars 763 forks source link

Add support for localised storyboards, nibs, and other resources #155

Closed ikovalisko closed 1 year ago

ikovalisko commented 8 years ago

At the moment generator skips resources with the same file name. But this limits us with localizing storyboards and nibs. Would be great if R.swift support them. What are the caveats?

mac-cain13 commented 8 years ago

Very good point, what we need to do this:

tomlokhorst commented 8 years ago

If a missing segue in one localisation leads to a runtime crash, we could not generate that segue and print a warning instead. Similar to how R.string now skips and warns about duplicate names.

mac-cain13 commented 8 years ago

I've looked a bit further into this issue and detecting localization variants seems quite easy, so we know what files are localized versions of each other.

I'm not completely sure if "just merging" is the way to go. I think often the optional return type will help us out, but not sure it will solve everything. I'll start out on a branch with merging all variants and then see what happens. :)

ikovalisko commented 8 years ago

Thanks for ipdate! Please, let me know when you need testing this feature.

justinmakaila commented 8 years ago

Is this fixed/merged? I recently added localization to my project and everything broke.

Not having this listed as a bug is a huge pain. I'm now going through my project and replacing 30+ errors with explicit UIStoryboard instantiations and casts because you don't have support for this. Not to mention the time I'm going to waste undoing all of this when it is supported.

acecilia commented 8 years ago

Happened to me the same, used Rswift all over the code and now that I am localizing I need to undo it.. :(

mac-cain13 commented 8 years ago

I'm very sorry to hear you ran into this while adding localization. I can see how that is a annoying thing to do. There is a local branch on my machine with this feature in it, but it still contains some bugs that I didn't had the time to look at it so no it is not yet merged/fixed.

On the flip side; It's a free and open source library, all development is done in the spare time of the maintainers without any payment received from any party. It's all love for the platform, community and library that drives us to build this. So while I appreciate that you make known to us that this is an important issue for you and other users it would also be nice not make it personal with phrases like "because you don't have support for this".

I can't promise any timeline, but you certainly made us aware that this is a big thing for quite some users and I'll see when I can make some time to pickup the last work on that branch again. It won't be on the next few weeks though since I'm on a holiday first.

IlyaOstashkov commented 7 years ago

I have the same annoying issue =(. There are 42 warnings like this: warning: [R.swift] Skipping 738 strings in 'WordsPackHard' (en) because no swift identifier can be generated for all of these keys:

semireg commented 6 years ago

Any progress on this? Any work-arounds?

dmitrysimkin commented 5 years ago

Hi! Still not implemented? please share some workarounds