Localizing String Literals

What about the places in your application where you programmatically determine what text is displayed to the user, such as with a string literal or a Swift string interpolation? In Document.swift, you have the following line of code:

l​e​t​ ​a​l​e​r​t​ ​=​ ​N​S​A​l​e​r​t​(​)​
a​l​e​r​t​.​m​e​s​s​a​g​e​T​e​x​t​ ​=​ ​"​D​o​ ​y​o​u​ ​r​e​a​l​l​y​ ​w​a​n​t​ ​t​o​ ​r​e​m​o​v​e​ ​t​h​e​s​e​ ​p​e​o​p​l​e​?​"​
a​l​e​r​t​.​i​n​f​o​r​m​a​t​i​v​e​T​e​x​t​ ​=​ ​"​\​(​s​e​l​e​c​t​e​d​P​e​o​p​l​e​.​c​o​u​n​t​)​ ​p​e​o​p​l​e​ ​w​i​l​l​ ​b​e​ ​r​e​m​o​v​e​d​.​"​
a​l​e​r​t​.​a​d​d​B​u​t​t​o​n​W​i​t​h​T​i​t​l​e​(​"​R​e​m​o​v​e​"​)​
a​l​e​r​t​.​a​d​d​B​u​t​t​o​n​W​i​t​h​T​i​t​l​e​(​"​C​a​n​c​e​l​"​)​

That alert sheet is not ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.