Skip to content

owowagency/owowgenerate-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

owowgenerate-ios

🧐 Readme

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.

Features

  • Generate a SwiftUI Text extension for typesafe access to strings. Comments are also copied into the Text init and generated properties.
  • Generate other (NSLocalizedString) extensions for typesafe access to strings. Comments are also copied into the NSLocalizedString call.
  • Rewrite secondary translation files, copying comments and general structure from the primary file.