Tag Archives: sed

Countries of the World in an NSArray

Continuing our popular series of lists we’ve typed in so you don’t have to (although this one is thanks to sed). Caveats: scraped from a random source on the internet; may not be accurate; provided for entertainment/lorem ipsum purposes only. … Continue reading

Posted in Code | Tagged , , , , , , , | 1 Comment

Localizing Arbitrary Strings the Scripty Way

I bet you saw my post about localizing US states and said to yourself, “Ha! That little sed script won’t do much for arbitrary strings!” You’re a jerk, but yes, you’re right. Before I give it away, does anyone see … Continue reading

Posted in Code | Tagged , , | Leave a comment

Localizing your US States array

Suppose you have a whiny co-worker who insists that all user-facing strings be localized. That’s what scripting tools are for, right? Specifically sed, in this case. sed ‘s/@”[^”]*”/NSLocalizedString(&, nil)/g’ This little script will match NSStrings and replace them with a … Continue reading

Posted in Code | Tagged , , , , | Leave a comment