Check localizable files for Swift
- Checking the localizable file from masterLanguageCode and find missing keys in other localizable files
- Searching potentially untranslated keys from localizable files
- Checking duplicate keys from localizable files
- Checking unused keys from localizable files
- Support .strings, .stringsdict and new .xcstrings formats
- Support any use notation: classic, l10n, localized, SwiftGen, SwiftUI, and custom Regex
- You can ignore system keys
- Any settings for generation errors or warnings at YAML settings file
- Support for multi-module projects.
From 2.0 version we support SPM plugin.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Localinter supports its use on supported platforms as plugin tool.
Once you have your Swift package set up, adding Localinter as a dependency is as easy as adding it to the dependencies value of your Package.swift. Then you need call from your target plugin like this:
dependencies: [
.Package(url: "https://github.com/ByteriX/Localinter.git", majorVersion: 2)
],
targets: [
.target(
name: "YourTarget",
plugins: [
.plugin(name: "LocalinterPlugin", package: "Localinter"),
]
)
]
- Just copy Localinter.swift to project.
- Exclude from "Build Phases" -> "Compile Sources"
- Add to "Build Phases" run script:
${SRCROOT}/Localinter.swiftYou need to add a settings file named imagelinter.yaml or/and imagelinter.yml to a target or/and the root of the library dir of the package.
imagesPath and sourcePath are calculated from dir of this package.
Supports more settings files with rewrite properties with priority: first a target then the root of library dir, first imagelinter.yamlthenimagelinter.yml`.
isEnabled: true
masterLanguageCode: en
relativeLocalizablePath: /Sources
relativeSourcePath: /Sources
usingTypes:
- case: standart
- case: swiftUI
- case: l10n
- case: localized
- case: swiftGen
enumName: Localizable
- case: custom
pattern: "(.*)".localized
ignoredUnusedKeys:
- CFBundleDisplayName
- NSCameraUsageDescription
ignoredUntranslatedKeys:
- Special.Untranslated
sourcesExtensions:
- swift
- cpp
isThrowingErrorForUntranslated: true
isThrowingErrorForUnused: true
isClearWhitespasesInLocalizableFiles: false
isOnlyOneLanguage: false
isCleaningFiles: true
