Skip to content

Instantly share code, notes, and snippets.

View Lutzifer's full-sized avatar

Wolfgang Lutz Lutzifer

View GitHub Profile
@Lutzifer
Lutzifer / replaceNSlocalized.sh
Last active September 18, 2018 15:13
Automatically replace NSLocalizedString(...) in Swift with corresponding tr(...) calls for https://github.com/AliSoftware/SwiftGen. Copy both into the project and call 'sh replaceNSlocalized.sh'
#/bin/sh
# Run this inside the project to replace NSLocalizedString calls with swiftgen calls in all .swift files.
# Do not forget to make a backup before.
find . -type f | grep ".swift" > swiftindex.temp
while IFS= read -r filename
do
grep -o "NSLocalizedString(\"[^\")]*\", comment:\s*\"\")" "$filename" > strings.temp