A tool, written in Swift, that parses iOS Localizable.strings
files.
It currently reads a file owowgenerate.json
. Example contents:
{
"stringsFiles": [
"MyProject/nl.lproj/Localizable.strings",
"MyProject/en.lproj/Localizable.strings"
],
"tasks": [
{
"type": "generateSwiftUIMapping",
"output": "MyProject/Assets/Strings-SwiftUI.swift"
},
{
"type": "generateNSLocalizedStringMapping",
"output": "MyProject/Assets/Strings-NSLocalizedString.swift"
},
{
"type": "rewriteTranslationFiles"
}
]
}
See Configuration.swift for details about the configuration options.
- Generate a SwiftUI
Text
extension for typesafe access to strings. Comments are also copied into theText
init and generated properties. - Generate other (
NSLocalizedString
) extensions for typesafe access to strings. Comments are also copied into theNSLocalizedString
call. - Rewrite secondary translation files, copying comments and general structure from the primary file.