Xcode 8 Source Editor Extension to quickly wrap strings into NSLocalizedString()
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Localizer.xcodeproj First commit Jun 28, 2016
Localizer First commit Jun 28, 2016
.gitignore Ignoring the Build folder Jun 28, 2016
LICENSE Initial commit Jun 28, 2016
README.md Added README explaining the project Jun 28, 2016



Localizer is a pretty simple and naive string localizer Xcode Source Editor Extension.

It was developed more like a learning exercise rather that to be used in the real world.

What does it do?

It expects a selection (e.g. you can't call the command unless you selected some text).

It then breaks apart any String declarations it founds by splitting the selection based off " and then wrap the resulting String inside NSLocalizedString.


let _ = "This is a string"

If we select the above line (or only the string including the ") and run Localizer we'll get the following output:

let _ = NSLocalizedString("This is a string", comment: "This is a string")


  • Add an option to «localize» a whole document
  • Make it smart enough to detect Strings already wrapped in NSLocalizedString and avoid touching them
  • Improve the String detection (tried with RegularExpression but it did not work, most likely my fault and a lack of regular-expression-fu).


Esteban Torres


Localizer is available under the MIT license. See the LICENSE file for more info.