Strings Utility
Swift utility written in Go which automates boring Swift strings tasks like:
- Feature 1: Constantify Strings Creates global constant variables from all .swift files to a constant file
- Feature 2: Localize Strings Transform all valid translatable strings as NSLocalizedString and copies them to all
Localizable.strings
files while avoiding duplicated strings
- Feature 3: Translate Strings Uses Google Cloud Translation to automatically translate all strings in all
Localizable.strings
, allowing iOS, MacOS, etc apps to support multiple languages in a few seconds
Live Demo
Why Use?
- Avoid unintended typos
- Have strings autocompleted
- Easily manage all your strings in one file
- Auto generate strings
Localizable.strings
and avoid duplicate strings
- Automatically translate all strings in
Localizable.strings
How to Use?
Download StringsUtility
$ git clone https://github.com/SamuelFolledo/StringsUtility
$ cd StringsUtility
- Make sure HomeBrew is updated
$ brew update
$ brew install golang
$ go get -u cloud.google.com/go/translate
For further details, tips, recommendations go to Tips and Requirements
Run StringsUtility
- Currently does not support multi line strings
- To avoid unnecessary translation, strings which contains substrings like file extensions, keywords, and symbols will not be translated. Edit strings and files to follow these standards.
"/", "\\", "{", "}", "_", "#", "%", ".swift", ".xib", ".storyboard", ".jpg", ".jpeg", ".png", ".mp4", ".mp3", ".wav", ".mov", ".gif", "http", "https", ".com", "identifier"
- Strings like url, identifiers, and more which contains substrings like the following will not be constantify.
"/", "\\", "{", "}", "http", "https", ".com", "#", "%", "identifier"
- Suported Languages
For more tips and requirements click here
Links
Lincense under MIT License