All Projects → kayak → SwiftGenStrings

kayak / SwiftGenStrings

Licence: Apache-2.0 License
genstrings replacement for Swift that actually works

Programming Languages

swift
15916 projects
Makefile
30231 projects

Projects that are alternatives of or similar to SwiftGenStrings

Swiftui Grid
🚀 SwiftUI Grid layout with custom styles
Stars: ✭ 872 (+2906.9%)
Mutual labels:  apple, tvos, watchos
Swiftui Shapes
🚀 Collection of SwiftUI shapes
Stars: ✭ 137 (+372.41%)
Mutual labels:  apple, tvos, watchos
Conbini
Publishers, operators, and subscribers to supplement Combine.
Stars: ✭ 109 (+275.86%)
Mutual labels:  apple, tvos, watchos
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+99300%)
Mutual labels:  apple, tvos, watchos
Human Interface Guidelines Extras
Community additions to Apple's Human Interface Guidelines
Stars: ✭ 225 (+675.86%)
Mutual labels:  apple, tvos, watchos
Rome
Carthage cache for S3, Minio, Ceph, Google Storage, Artifactory and many others
Stars: ✭ 724 (+2396.55%)
Mutual labels:  apple, tvos, watchos
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (+175.86%)
Mutual labels:  apple, tvos, watchos
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+510.34%)
Mutual labels:  localization, tvos, watchos
Objc Sdk
LeanCloud Objective-C SDK
Stars: ✭ 186 (+541.38%)
Mutual labels:  apple, tvos, watchos
Wwdc Notes
WWDCNotes.com content ✨
Stars: ✭ 183 (+531.03%)
Mutual labels:  apple, tvos, watchos
Flint
The Flint framework for building apps on Apple platforms using Feature Driven Development
Stars: ✭ 636 (+2093.1%)
Mutual labels:  apple, tvos, watchos
Swiftui Sliders
🚀 SwiftUI Sliders with custom styles
Stars: ✭ 241 (+731.03%)
Mutual labels:  apple, tvos, watchos
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (+913.79%)
Mutual labels:  apple, tvos, watchos
Swiftui
A collaborative list of awesome SwiftUI resources. Feel free to contribute!
Stars: ✭ 774 (+2568.97%)
Mutual labels:  apple, tvos, watchos
Swiftui Charts
🚀 SwiftUI Charts with custom styles
Stars: ✭ 272 (+837.93%)
Mutual labels:  apple, tvos, watchos
Swift Sdk
LeanCloud Swift SDK
Stars: ✭ 110 (+279.31%)
Mutual labels:  apple, tvos, watchos
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (+1417.24%)
Mutual labels:  localization, tvos, watchos
Apple Runtime Headers
Objective-C runtime headers for Apple's iOS, macOS, tvOS and watchOS frameworks
Stars: ✭ 174 (+500%)
Mutual labels:  apple, tvos, watchos
Wwdc
You don't have the time to watch all the WWDC session videos yourself? No problem me and many contributors extracted the gist for you 🥳
Stars: ✭ 2,561 (+8731.03%)
Mutual labels:  apple, tvos, watchos
Wells
A lightweight diagnostics report submission system
Stars: ✭ 26 (-10.34%)
Mutual labels:  apple, tvos, watchos

SwiftGenStrings

SwiftGenStrings is a command line application that can be used as a drop-in replacement for the standard genstrings command for Swift sources. The latter only supports the short form of the NSLocalizedString function but breaks as soon as you use any parameters other than key and comment as in

NSLocalizedString("DATE_RANGE", value: "%@ – %@", comment: "A range of dates")

The upstream issue is tracked here.

Usage

SwiftGenStrings [<files> ...] [-s <substitute>] [-o <output-directory>]

ARGUMENTS:
  <files>                 List of files, that are used as source of Localizable.strings generation.

OPTIONS:
  -s <substitute>         (Optional) Substitute for NSLocalizedString, useful when different macro is used.
  -o <output-directory>   (Optional) Specifies what directory Localizable.strings table is created in. Not specifying output directory will print script output content
                          to standard output (console).
  --version               Show the version.
  -h, --help              Show help information.

To gather strings in current directory, run:

$ find . -name "*.swift" | xargs SwiftGenStrings

If you have any 3rd party code like CocoaPods or Carthage in your project directory, you might want to exclude it from localization. To do that, run the following:

$ find . \( -name "*.swift" ! -path "./Carthage/*" ! -path "./Pods/*" \) | xargs SwiftGenStrings

Installation

Mint

The quickest and easiest way to install SwiftGenStrings is via Mint

$ mint install kayak/SwiftGenStrings

Prebuilt Binaries

We tag releases and upload prebuilt binaries to GitHub. Checkout the releases tab or go straight to the latest release.

From Git

The project provides a Makefile. To export a binary run:

$ make release

The exported binary can be found under Products/SwiftGenStrings. Alternatively you can use make install to install the compiled library directly into /usr/local/bin/SwiftGenStrings

Testing

Since SwiftGenStrings is a SPM package, running tests is easy:

$ swift test

Requirements

  • Xcode 12
  • Swift 5.3

Limitations

  • SwiftGenStrings currently doesn't support multiple tables, only the default one - Localizable.strings.
  • It is not possible to use NSLocalizedString in string interpolation e.g.: let hello = "--- \(NSLocalizedString("Hello world!", comment: ""))" will not pickup the localized string.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].