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 support for localised storyboards, nibs, and other resources #155

Closed
ikovalisko opened this issue Jan 20, 2016 · 10 comments · Fixed by #766
Closed

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

ikovalisko opened this issue Jan 20, 2016 · 10 comments · Fixed by #766

Comments

@ikovalisko
Copy link

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

Very good point, what we need to do this:

  • Detect when something is a different version of a localized nib (not sure if the projectfile makes that clear)
  • Check if we can just take one or merge all storyboards, can you for example remove or add a certain segue in just one localization? (A missing segue or view controller could lead to generated code that crashes your app)

@tomlokhorst
Copy link
Collaborator

tomlokhorst commented Jan 21, 2016

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

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

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

@tomlokhorst tomlokhorst mentioned this issue Apr 27, 2016
11 tasks
@tomlokhorst tomlokhorst changed the title Add support for localised storyboards and nibs Add support for localised storyboards, nibs, and other resources Jul 6, 2016
@justinmakaila
Copy link

justinmakaila commented Jul 7, 2016

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

acecilia commented Jul 7, 2016

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

@mac-cain13
Copy link
Owner

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

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

semireg commented Mar 7, 2018

Any progress on this? Any work-arounds?

@dmitrysimkin
Copy link

Hi! Still not implemented? please share some workarounds

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

Successfully merging a pull request may close this issue.

8 participants