Skip to content

Commit

Permalink
Add a test for double quote in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ataka committed Nov 5, 2016
1 parent f8258eb commit a0e1372
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 23 deletions.
28 changes: 19 additions & 9 deletions DemoApp/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7515.2" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7512"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -13,24 +15,31 @@
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="hello" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xUH-o8-DGc">
<rect key="frame" x="248" y="201" width="104" height="62"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="hello" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xUH-o8-DGc">
<frame key="frameInset" minX="248" minY="201" width="104" height="62"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="52"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uZj-A7-ihc">
<rect key="frame" x="255" y="326" width="90" height="36"/>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uZj-A7-ihc">
<frame key="frameInset" minX="255" minY="326" width="90" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="getstarted">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="quoted" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zjA-Rl-7jE">
<frame key="frameInset" minX="206" minY="411" width="189" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="xUH-o8-DGc" secondAttribute="centerX" id="MZ5-6t-29C"/>
<constraint firstAttribute="centerY" secondItem="uZj-A7-ihc" secondAttribute="centerY" constant="-44" id="bKg-nA-8Ie"/>
Expand All @@ -41,6 +50,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-122.40000000000001" y="138.98050974512745"/>
</scene>
</scenes>
</document>
6 changes: 1 addition & 5 deletions DemoApp/en.lproj/LaunchScreen.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@

/* Class = "UILabel"; text = " Copyright (c) 2015 Yosuke Ishikawa. All rights reserved."; ObjectID = "8ie-xW-0ye"; */
"8ie-xW-0ye.text" = " Copyright (c) 2015 Yosuke Ishikawa. All rights reserved.";

/* Class = "UILabel"; text = "DemoApp"; ObjectID = "kId-c2-rCX"; */
"kId-c2-rCX.text" = "DemoApp";
"8ie-xW-0ye.text" = " Copyright (c) 2015 Yosuke Ishikawa. All rights reserved.";
1 change: 1 addition & 0 deletions DemoApp/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"hello" = "Hello";
"getstarted" = "Get started";
"quoted" = "This is a \"quoted\" text.";
9 changes: 3 additions & 6 deletions DemoApp/en.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

/* Class = "UIButton"; normalTitle = "getstarted"; ObjectID = "uZj-A7-ihc"; */
"uZj-A7-ihc.normalTitle" = "getstarted";

/* Class = "UILabel"; text = "hello"; ObjectID = "xUH-o8-DGc"; */
"xUH-o8-DGc.text" = "hello";
"xUH-o8-DGc.text" = "Hello";
"zjA-Rl-7jE.text" = "This is a \"quoted\" text.";
"uZj-A7-ihc.normalTitle" = "Get started";
2 changes: 1 addition & 1 deletion DemoApp/ja.lproj/LaunchScreen.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"8ie-xW-0ye.text" = " Copyright (c) 2015 Yosuke Ishikawa. All rights reserved.";
"kId-c2-rCX.text" = "DemoApp";
"8ie-xW-0ye.text" = " Copyright (c) 2015 Yosuke Ishikawa. All rights reserved.";
1 change: 1 addition & 0 deletions DemoApp/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"hello" = "こんにちは";
"getstarted" = "はじめよう";
"quoted" = "これは\"引用\"です。";
5 changes: 3 additions & 2 deletions DemoApp/ja.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"uZj-A7-ihc.normalTitle" = "getstarted";
"xUH-o8-DGc.text" = "hello";
"xUH-o8-DGc.text" = "こんにちは";
"zjA-Rl-7jE.text" = "これは\"引用\"です。";
"uZj-A7-ihc.normalTitle" = "はじめよう";
1 change: 1 addition & 0 deletions UnitTests/StringsFileTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ class StringsFileTests: XCTestCase {

XCTAssertEqual(xibStringsFile.dictionary["xUH-o8-DGc.text"]!, "Hello")
XCTAssertEqual(xibStringsFile.dictionary["uZj-A7-ihc.normalTitle"]!, "Get started")
XCTAssertEqual(xibStringsFile.dictionary["zjA-Rl-7jE.text"]!, "This is a \"quoted\" text.")
}
}

0 comments on commit a0e1372

Please sign in to comment.