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

Fixed improper localization file renaming. (.xib, .strings -> .storyboard) #104

Closed
wants to merge 3 commits into from
Closed

Fixed improper localization file renaming. (.xib, .strings -> .storyboard) #104

wants to merge 3 commits into from

Conversation

SpencerMichaels
Copy link

In issue #68 it's been noted that with XCode 5's new method of handling localization, synx will rename .strings and .xib files to the .storyboard extension of their parent. Someone attempted a fix (see #77) but seemingly didn't account for some edge cases since other folders were absent after running that version. This is my attempt at fixing both issues — for PBXVariantGroups, it takes only the file extension from the original path, and constructs the rest of the new path in the same way as before. This certainly fixes #68, and I believe it doesn't interfere with anything else as #77 did.

(By the way, I'm not familiar with Ruby's standard libraries, so there is probably a more concise way to do the string manipulation that I did here — if there's a better way I'd be glad to update my code.)

@marklarr marklarr mentioned this pull request May 13, 2016
@marklarr
Copy link
Member

marklarr commented May 13, 2016

Could you add a test case for this? You can use the https://github.com/venmo/synx/tree/master/spec/dummy/dummy.xcodeproj to add the case where this breaks, then add to https://github.com/venmo/synx/blob/master/spec/synx/expected_file_structure.yml and https://github.com/venmo/synx/blob/master/spec/synx/expected_group_structure.yml. Ultimately, these tests will end up making your assertion by using those yml files https://github.com/venmo/synx/blob/master/spec/synx/project_spec.rb#L103-L109

I tried, but I don't know a lot about localization files or how to reproduce this, sadly.

@SpencerMichaels
Copy link
Author

Sorry for taking so long! I just updated this PR with what should be a working test. Unfortunately I think there's an unrelated error in Travis relating to activesupport, since the build throws the error

Gem::InstallError: activesupport requires Ruby version >= 2.2.2.

Is this a problem on your end?

@marklarr
Copy link
Member

I pulled your commits over here and tried upgrading the ruby version from 2.1.1 to 2.2.5 on travis... let's see how that goes :)

#113

@marklarr marklarr closed this Jul 31, 2016
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.

Renames .strings files into .xib and .storyboard for projects with Base localization
2 participants