Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/synx/xcodeproj_ext/project/object/abstract_object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ def work_pathname
@work_pathname ||= project.work_root_pathname
elsif parent.is_a?(Xcodeproj::Project::Object::PBXVariantGroup)
# Localized object, naming is handled differently.
@work_pathname ||= parent.work_pathname + "#{display_name}.lproj" + parent.display_name
# We need to grab the file extension from the path in order to prevent
# .xib and .strings files from being renamed to the .storyboard extension
# of their parent.
file_name = parent.display_name.slice(0..parent.display_name.rindex(".")-1)
file_ext = path.slice(path.rindex(".")..-1)
full_name = file_name + file_ext
@work_pathname ||= parent.work_pathname + "#{display_name}.lproj" + full_name
elsif is_a?(Xcodeproj::Project::Object::PBXVariantGroup)
# Localized container, has no path of its own.
@work_pathname ||= parent.work_pathname
Expand Down
36 changes: 23 additions & 13 deletions spec/dummy/dummy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
637E22771A5235CE00A08D6A /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
096523031D4DAF4600713E82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/View.xib; sourceTree = "<group>"; };
096523041D4DAF4600713E82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Storyboard.storyboard; sourceTree = "<group>"; };
096523061D4DAF5500713E82 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/View.strings; sourceTree = "<group>"; };
0965230A1D4DAF6B00713E82 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Storyboard.strings; sourceTree = "<group>"; };
8C2DEB7D191D3F5C003A1F44 /* ManyFiles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManyFiles.h; sourceTree = "<group>"; };
8C2DEB7E191D3F5C003A1F44 /* ManyFiles.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManyFiles.m; sourceTree = "<group>"; };
8C2DEB80191D3F68003A1F44 /* Wow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Wow.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -90,7 +93,6 @@
8C848C65190DB9B300E9727B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8C848C67190DB9B300E9727B /* dummyTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = dummyTests.m; sourceTree = "<group>"; };
8CADDD3A19354F120076033B /* image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image.png; sourceTree = "<group>"; };
8CD2ABF219558D7800341C58 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localizable.strings; sourceTree = "<group>"; };
8CDA046319374F35004435A1 /* data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = data.json; path = FolderWithGroupNotLinked/data.json; sourceTree = "<group>"; };
8CE2DA1D19220F7B00D06F5E /* dummyTests-prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "dummyTests-prefix.pch"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -133,8 +135,6 @@
8C2DEB83191D3F9E003A1F44 /* GroupThatDoubleReferencesFile */ = {
isa = PBXGroup;
children = (
8C2DEB7D191D3F5C003A1F44 /* ManyFiles.h */,
8C2DEB7E191D3F5C003A1F44 /* ManyFiles.m */,
);
name = GroupThatDoubleReferencesFile;
sourceTree = "<group>";
Expand Down Expand Up @@ -208,8 +208,9 @@
8C848C4E190DB9B300E9727B /* Supporting Files */ = {
isa = PBXGroup;
children = (
8CD2ABF119558D7800341C58 /* Localizable.strings */,
8C848C4F190DB9B300E9727B /* dummy-Prefix.pch */,
096522FE1D4DAF2D00713E82 /* View.xib */,
096523001D4DAF3100713E82 /* Storyboard.storyboard */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -311,6 +312,7 @@
knownRegions = (
en,
de,
Base,
);
mainGroup = 8C848C3F190DB9B300E9727B;
productRefGroup = 8C848C49190DB9B300E9727B /* Products */;
Expand Down Expand Up @@ -370,22 +372,30 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
8C848C64190DB9B300E9727B /* InfoPlist.strings */ = {
096522FE1D4DAF2D00713E82 /* View.xib */ = {
isa = PBXVariantGroup;
children = (
8C848C65190DB9B300E9727B /* en */,
096523031D4DAF4600713E82 /* Base */,
096523061D4DAF5500713E82 /* de */,
);
name = InfoPlist.strings;
name = View.xib;
sourceTree = "<group>";
};
8CD2ABF119558D7800341C58 /* Localizable.strings */ = {
096523001D4DAF3100713E82 /* Storyboard.storyboard */ = {
isa = PBXVariantGroup;
children = (
8CD2ABF219558D7800341C58 /* en */,
637E22771A5235CE00A08D6A /* de */,
096523041D4DAF4600713E82 /* Base */,
0965230A1D4DAF6B00713E82 /* de */,
);
name = Localizable.strings;
path = en.lproj;
name = Storyboard.storyboard;
sourceTree = "<group>";
};
8C848C64190DB9B300E9727B /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
8C848C65190DB9B300E9727B /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
Expand Down
7 changes: 7 additions & 0 deletions spec/dummy/dummy/Base.lproj/Storyboard.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes/>
</document>
15 changes: 15 additions & 0 deletions spec/dummy/dummy/Base.lproj/View.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</objects>
</document>
1 change: 1 addition & 0 deletions spec/dummy/dummy/de.lproj/Storyboard.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions spec/dummy/dummy/de.lproj/View.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 0 additions & 9 deletions spec/dummy/dummy/en.lproj/Localizable.strings

This file was deleted.

9 changes: 0 additions & 9 deletions spec/dummy/dummy/en.lproj/de.lproj/Localizable.strings

This file was deleted.

8 changes: 5 additions & 3 deletions spec/synx/expected_file_structure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ dummy:
ManyFiles.m:
Supporting Files:
dummy-Prefix.pch:
en.lproj:
Localizable.strings:
Base.lproj:
Storyboard.storyboard:
View.xib:
de.lproj:
Localizable.strings:
Storyboard.strings:
View.strings:
dummy.h:
dummy.m:
FileNotInXcodeProj.h:
Expand Down
7 changes: 6 additions & 1 deletion spec/synx/expected_group_structure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ dummy:
Wow.h:
Wow.m:
Supporting Files:
Localizable.strings:
Storyboard.storyboard:
Storyboard.storyboard:
Storyboard.strings:
View.xib:
View.xib:
View.strings:
dummy-Prefix.pch:
dummy.h:
dummy.m:
Expand Down