Commit 636c640f authored by Aral Balkan's avatar Aral Balkan

Progress towards internationalising the setup process (#31).

parent 6eef4747
......@@ -42,6 +42,9 @@
A78DAE941A82320B009FDB15 /* SetupHandleTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = A78DAE931A82320B009FDB15 /* SetupHandleTextField.swift */; };
A7A14C631A82560000586EAD /* StepOneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A14C621A82560000586EAD /* StepOneView.swift */; };
A7A14C651A8277C300586EAD /* SetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7A14C641A8277C300586EAD /* SetupView.swift */; };
A7A14C691A83A9C100586EAD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A7A14C6B1A83A9C100586EAD /* InfoPlist.strings */; };
A7A14C6E1A83A9C200586EAD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A7A14C701A83A9C200586EAD /* InfoPlist.strings */; };
A7A14C731A83D7DC00586EAD /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A7A14C751A83D7DC00586EAD /* Localizable.strings */; };
A7CC1FFA1A6C8FEB00B49AA9 /* MASShortcut.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7CC1FF91A6C8FEB00B49AA9 /* MASShortcut.framework */; };
A7CC20071A6C992F00B49AA9 /* SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7CC20061A6C992F00B49AA9 /* SwiftyJSON.swift */; };
A7CD7F121A6FBB2400BE31D6 /* node.js in Resources */ = {isa = PBXBuildFile; fileRef = A7CD7F111A6FBB2400BE31D6 /* node.js */; };
......@@ -123,6 +126,10 @@
A78DAE931A82320B009FDB15 /* SetupHandleTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetupHandleTextField.swift; sourceTree = "<group>"; };
A7A14C621A82560000586EAD /* StepOneView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StepOneView.swift; sourceTree = "<group>"; };
A7A14C641A8277C300586EAD /* SetupView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetupView.swift; sourceTree = "<group>"; };
A7A14C661A83A43900586EAD /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Main.strings; sourceTree = "<group>"; };
A7A14C6A1A83A9C100586EAD /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A7A14C6F1A83A9C200586EAD /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A7A14C741A83D7DC00586EAD /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
A7CC1FF91A6C8FEB00B49AA9 /* MASShortcut.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MASShortcut.framework; path = "../../../../../Library/Developer/Xcode/DerivedData/Heartbeat-bwptofoniwaoqzcgkxzhjtbmtjak/Build/Products/Debug/MASShortcut.framework"; sourceTree = "<group>"; };
A7CC1FFB1A6C8FF700B49AA9 /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = ../../sandbox/SwiftyJSON/build/Debug/SwiftyJSON.framework; sourceTree = "<group>"; };
A7CC1FFD1A6C901400B49AA9 /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = ../../sandbox/SwiftyJSON/build/Debug/SwiftyJSON.framework; sourceTree = "<group>"; };
......@@ -297,6 +304,8 @@
A75AABC71A5ECFB000B105BA /* Supporting Files */ = {
isa = PBXGroup;
children = (
A7A14C751A83D7DC00586EAD /* Localizable.strings */,
A7A14C701A83A9C200586EAD /* InfoPlist.strings */,
A75AABC81A5ECFB000B105BA /* Info.plist */,
);
name = "Supporting Files";
......@@ -315,6 +324,7 @@
A75AABDA1A5ECFB000B105BA /* Supporting Files */ = {
isa = PBXGroup;
children = (
A7A14C6B1A83A9C100586EAD /* InfoPlist.strings */,
A75AABDB1A5ECFB000B105BA /* Info.plist */,
);
name = "Supporting Files";
......@@ -573,6 +583,7 @@
A70634AB1A630E6300A75BC0 /* Main.storyboard in Resources */,
A78DAE851A7FCADD009FDB15 /* aral-100-100.jpg in Resources */,
A78DAE741A7F9FE8009FDB15 /* debug-panel-background.png in Resources */,
A7A14C731A83D7DC00586EAD /* Localizable.strings in Resources */,
A7E7D7D11A616B3E003501C1 /* sidebar.png in Resources */,
A7E7D7CE1A616B3E003501C1 /* transparent.png in Resources */,
A7CD7F121A6FBB2400BE31D6 /* node.js in Resources */,
......@@ -583,6 +594,7 @@
A78DAE861A7FCADD009FDB15 /* laura-and-osky.jpg in Resources */,
A74C9EF11A6688EB0083B288 /* Images.xcassets in Resources */,
A7E7D7D01A616B3E003501C1 /* conversations.png in Resources */,
A7A14C6E1A83A9C200586EAD /* InfoPlist.strings in Resources */,
A7E7D7CD1A616B3E003501C1 /* content-white.png in Resources */,
A7E7D7CA1A616B3E003501C1 /* bottomRightCornerIndicatorTemplate@2x.png in Resources */,
A7E7D7C91A616B3E003501C1 /* bottomLeftCornerIndicatorTemplate@2x.png in Resources */,
......@@ -596,6 +608,7 @@
buildActionMask = 2147483647;
files = (
A7CD7F131A6FBB2400BE31D6 /* node.js in Resources */,
A7A14C691A83A9C100586EAD /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -663,10 +676,35 @@
isa = PBXVariantGroup;
children = (
A70634AE1A630E6F00A75BC0 /* Base */,
A7A14C661A83A43900586EAD /* tr */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
A7A14C6B1A83A9C100586EAD /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A7A14C6A1A83A9C100586EAD /* tr */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
A7A14C701A83A9C200586EAD /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
A7A14C6F1A83A9C200586EAD /* tr */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
A7A14C751A83D7DC00586EAD /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
A7A14C741A83D7DC00586EAD /* tr */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
......
......@@ -4,6 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Heartbeat-Turkish.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Heartbeat.xcscheme</key>
<dict>
<key>orderHint</key>
......
......@@ -11,11 +11,11 @@
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="SplitViewSpike" id="1Xt-HY-uBw">
<menuItem title="Heartbeat" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="SplitViewSpike" systemMenu="apple" id="uQy-DD-JDr">
<menu key="submenu" title="Heartbeat" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About SplitViewSpike" id="5kV-Vb-QxS">
<menuItem title="About Heartbeat" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
......@@ -33,7 +33,7 @@
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide SplitViewSpike" keyEquivalent="h" id="Olw-nP-bQN">
<menuItem title="Hide Heartbeat" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
......@@ -51,7 +51,7 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit SplitViewSpike" keyEquivalent="q" id="4sb-4s-VLi">
<menuItem title="Quit Heartbeat" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
......@@ -632,7 +632,7 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="SplitViewSpike Help" keyEquivalent="?" id="FKE-Sm-Kum">
<menuItem title="Heartbeat Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
</connections>
......@@ -1177,13 +1177,13 @@ DQ
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<accessibility description="Handle" help="Sets the account handle you want to use on Indie."/>
<accessibility description="Account Handle" help="Sets the account handle you want to use on Indie."/>
<connections>
<accessibilityConnection property="title" destination="UBx-uQ-GES" id="aCS-60-gxi"/>
<action selector="acceptHandle:" target="4K3-FT-bB9" id="ETj-Jn-qGf"/>
</connections>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="pwd-bE-SCo">
<textField hidden="YES" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="pwd-bE-SCo">
<rect key="frame" x="218" y="437" width="154" height="50"/>
<constraints>
<constraint firstAttribute="width" priority="250" constant="150" id="24j-SG-Len"/>
......
......@@ -22,13 +22,15 @@ func makeAccessibilityAnnouncement(message:String)
// Note: Documentation on NSAccessibilityAnnouncementRequestedNotification is wrong. Correct usage, via NSAccessibility.h: “This notification should be posted for the application element.”
// (Also see http://lists.apple.com/archives/accessibility-dev/2013/Jul/msg00027.html and rdar://14543376 )
//
NSAccessibilityPostNotificationWithUserInfo(NSApp.mainWindow, NSAccessibilityAnnouncementRequestedNotification, [NSAccessibilityAnnouncementKey: message])
NSAccessibilityPostNotificationWithUserInfo(NSApp.mainWindow, NSAccessibilityAnnouncementRequestedNotification, [NSAccessibilityAnnouncementKey: message, NSAccessibilityPriorityKey: NSAccessibilityPriorityLevel.High.rawValue])
}
//
// Other
//
func delay(delay:Double, closure:()->())
{
//
......@@ -44,6 +46,7 @@ func delay(delay:Double, closure:()->())
dispatch_get_main_queue(), closure)
}
//
// Allows graceful overriding of any NSResponder subclass’s initialisation
// using a common initialiser.
......
......@@ -66,9 +66,14 @@ class SetupMessageViewController: NSViewController
func show() {
// Make accessibility announcement.
var messageBodyToRead = messageBody.stringByReplacingOccurrencesOfString("-", replacement: "-dash-") // Help with pronunciation (TODO: localise)
messageBodyToRead = messageBodyToRead.stringByReplacingOccurrencesOfString("ind.ie", replacement: "i.n.d-dot-i.e") // (Question: will this make it harder for people with Braille?)
messageBodyToRead = messageBodyToRead.stringByReplacingOccurrencesOfString("/", replacement: "-forward-slash-") //
let localisedDash = NSLocalizedString("-dash-", comment:"Pronunciation hint for use when speaking out URLs in VoiceOver")
let localisedDot = NSLocalizedString("-dot-", comment:"Pronunciation hint for use when speaking out URLs in VoiceOver")
let localisedForwardSlash = NSLocalizedString("-forward-slash-", comment:"Pronunciation hint for use when speaking out URLs in VoiceOver")
var messageBodyToRead = messageBody.stringByReplacingOccurrencesOfString("-", replacement: localisedDash) // Help with pronunciation (TODO: localise)
messageBodyToRead = messageBodyToRead.stringByReplacingOccurrencesOfString("ind.ie", replacement: "i.n.d" + localisedDot + "i.e") // (Question: will this make it harder for people with Braille?)
messageBodyToRead = messageBodyToRead.stringByReplacingOccurrencesOfString("/", replacement: localisedForwardSlash) //
let messageToRead:String = "\(messageTitle) \(messageBodyToRead)"
makeAccessibilityAnnouncement(messageToRead)
......
......@@ -18,7 +18,7 @@ class SetupProgressIndicatorViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
message.stringValue = "Please wait, loading…"
message.stringValue = NSLocalizedString("Please wait, loading…", comment: "Default text for progress indicator. Mostly overriden.")
progressIndicator.stopAnimation(self)
}
......
......@@ -48,10 +48,17 @@ class StepOneViewController: SetupStepViewController
// Show tip to inform user of the purpose of this step
if viewIsBeingShownForTheFirstTime
{
// Accessibility
makeAccessibilityAnnouncement("Pick a handle to use on Indie, or enter your existing one.")
let message = NSLocalizedString("Pick a handle to use on Ind.ie, or enter your existing one.", comment: "First setup step instructions.")
// Make visual announcement
self.delegate?.showTip(message)
// Voiceover reads Ind.ie badly, so replace it with Indie (without the dot)
let messageWithSpeechHints = message.stringByReplacingOccurrencesOfString("Ind.ie", replacement: "Indie")
// Make accessibility announcment
makeAccessibilityAnnouncement(messageWithSpeechHints)
self.delegate?.showTip("Pick a handle to use on Ind.ie, or enter your existing one.")
viewIsBeingShownForTheFirstTime = false
}
}
......@@ -131,7 +138,7 @@ class StepOneViewController: SetupStepViewController
if countElements(nameText) > 0
{
// Show progress
self.delegate?.showProgress("Checking if account exists…")
self.delegate?.showProgress(NSLocalizedString("Checking if account exists…", comment:"Progress indicator text"))
//
// Fire off the check
......@@ -159,7 +166,10 @@ class StepOneViewController: SetupStepViewController
func showHandleIsAvailableMessage()
{
self.delegate?.showMessage("That handle is available!", body: "Would you like to sign up as ind.ie/\(self.nameTextField.stringValue)? Press enter for yes.", nextButtonTitle: "Yes")
let title = String.localizedStringWithFormat(NSLocalizedString("The handle %@ is available!", comment: "Title of message"), self.nameTextField.stringValue)
let body = String.localizedStringWithFormat(NSLocalizedString("Would you like to sign up as ind.ie/%@? Press enter for yes.", comment: "Body of message"), self.nameTextField.stringValue)
self.delegate?.showMessage(title, body: body, nextButtonTitle: NSLocalizedString("Yes", comment: "Button title"))
}
//
......
/* No Localized Strings */
\ No newline at end of file
/* Pronunciation hint for use when speaking out URLs in VoiceOver */
"-dash-" = "-tire-";
/* Pronunciation hint for use when speaking out URLs in VoiceOver */
"-dot-" = "-puan-";
/* Pronunciation hint for use when speaking out URLs in VoiceOver */
"-forward-slash-" = "-bölü-";
/* Progress indicator text */
"Checking if account exists…" = "Üye ismi var mı diye bakıyorum…";
/* First setup step instructions. */
"Pick a handle to use on Ind.ie, or enter your existing one." = "Ind.ie üye ismini seç veya daha onceden varsa gir.";
/* Default text for progress indicator. Mostly overriden. */
"Please wait, loading…" = "Lütfen bekleyin, yükleniyor…";
/* Title of message */
"The handle %@ is available!" = "Üye ismi %@ müsait!";
/* Body of message */
"Would you like to sign up as ind.ie/%@? Press enter for yes." = "ind.ie/%@ olarak üye olmak istiyormusun? Evet için enter’e bas.";
/* Button title */
"Yes" = "Evet";
This diff is collapsed.
/* No Localized Strings */
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment