Behind the scenes • Installation • Author • License
AutoLocalized scans your project and search for your localization files and project files containing localized keys. By using Rules and Validation methods ensuring your keys and files are organized, clean, and always up to date with your work.
For every localization file found the following is executed:
For every project file found the following is executed:
AutoLocalized is available through SPM (Swift Package Manager). To install it, simply follow the next steps.
SDKROOT=macosx
cd ~/Library/Developer/Xcode/DerivedData/${PROJECT_NAME}-*/SourcePackages/checkouts/AutoLocalized
swift run -c release AutoLocalized ${PROJECT_DIR}/${PROJECT_NAME}
Configure AutoLocalized by adding a .autolocalized.yml file in your project file or building the project once, the framework can create a file when non is found. The following parameters can be configured:
fileExtensions:
excluded: what directories to ignore
disabledRules: what rules to ignore
fileExtensions: # extensions to support (.swift, .xib...).
- extension: swift
regex: "(case|return|static let).*?\"([a-z|_]*?)\""
match_index: 2
- extension: xib
regex: "(text|title|value|placeholder)=\"([a-z|_]*?)\""
match_index: 2
- extension: storyboard
regex: "(text|title|value|placeholder)=\"([a-z|_]*?)\""
match_index: 2
excluded: # paths to ignore.
- Attribution/
- Operations/
- Localization/LocalizableProtocol
disabledRules: # ignore rules by specefing their names
- duplicateValue
If you only want to exclude a part of your code use
// autolocalized:disable
{your code }
// autolocalized:enable
In your "Build report" in Xcode, you will see all the files that were found using your .autolocalized.yml configuration, separated by file type. In addition, you will see the number of keys in that files and the keys.
AlexPinhasov, [email protected]
AutoLocalized is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 4 |
Last commit: 1 year ago |
Change duplicateValue rule from error -> warning
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics