This article is written with XCode & Swift in mind. With that being said, notions & ideas explored below can be applied to any programming language / IDE. I leave that part as an exercise to the reader ;)
guard let templateString = NSLocalizedString("hello", tableName: "Greetings", comment: "") else { print("Missing localization"); return }
Sounds familiar ?
Let’s face it: Localization sucks. It’s all String-based. It’s messy. And even with the best effort put into arranging your .strings
files, you always end-up forgetting which key to use, or with duplicates all over the place.
Not only that, but it’s also nearly impossible to keep track of changes made over time, since XCode won’t help you in the slightest if some key were to disappear or are otherwise renamed. …