{"id":28377175,"url":"https://github.com/kayak/swiftgenstrings","last_synced_at":"2025-06-26T18:31:51.197Z","repository":{"id":55990155,"uuid":"65734534","full_name":"kayak/SwiftGenStrings","owner":"kayak","description":"genstrings replacement for Swift that actually works","archived":false,"fork":false,"pushed_at":"2023-05-13T02:59:50.000Z","size":60,"stargazers_count":39,"open_issues_count":1,"forks_count":6,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-30T00:42:11.134Z","etag":null,"topics":["apple","genstrings","ios","localization","macos","nslocalizedstring","swift","tvos","watchos","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kayak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-15T13:32:40.000Z","updated_at":"2024-11-21T15:14:29.000Z","dependencies_parsed_at":"2022-08-15T11:00:19.774Z","dependency_job_id":null,"html_url":"https://github.com/kayak/SwiftGenStrings","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kayak/SwiftGenStrings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2FSwiftGenStrings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2FSwiftGenStrings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2FSwiftGenStrings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2FSwiftGenStrings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayak","download_url":"https://codeload.github.com/kayak/SwiftGenStrings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayak%2FSwiftGenStrings/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262122706,"owners_count":23262464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","genstrings","ios","localization","macos","nslocalizedstring","swift","tvos","watchos","xcode"],"created_at":"2025-05-30T00:40:00.139Z","updated_at":"2025-06-26T18:31:51.149Z","avatar_url":"https://github.com/kayak.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftGenStrings\n\nSwiftGenStrings 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\n\n```\nNSLocalizedString(\"DATE_RANGE\", value: \"%@ – %@\", comment: \"A range of dates\")\n```\n\nThe upstream issue is tracked [here](https://openradar.appspot.com/22133811).\n\n## Usage\n\n```\nUSAGE: SwiftGenStrings \u003cfiles\u003e ... [-s \u003cs\u003e] [-o \u003co\u003e] [--exclude-comments]\n\nARGUMENTS:\n  \u003cfiles\u003e                 List of files, that are used as source of\n                          Localizable.strings generation.\n\nOPTIONS:\n  -s \u003cs\u003e                  (Optional) Substitute for NSLocalizedString, useful when different macro is used.\n  -o \u003co\u003e                  (Optional) Specifies what directory Localizable.strings table is created in. Not specifying output directory will print script output\n                          content to standard output (console).\n  -e, --exclude-comments  (Optional) Formatted output does not include comments\n  --version               Show the version.\n  -h, --help              Show help information.\n```\n\nTo gather strings in current directory, run:\n```\n$ find . -name \"*.swift\" | xargs SwiftGenStrings\n```\n\nIf 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:\n```\n$ find . \\( -name \"*.swift\" ! -path \"./Carthage/*\" ! -path \"./Pods/*\" \\) | xargs SwiftGenStrings\n```\n\n## Installation\n\n### [Mint](https://github.com/yonaskolb/mint)\n\nThe quickest and easiest way to install SwiftGenStrings is via Mint\n```\n$ mint install kayak/SwiftGenStrings\n```\n\n### Prebuilt Binaries\n\nWe tag releases and upload prebuilt binaries to GitHub. Checkout the [releases](https://github.com/kayak/SwiftGenStrings/releases) tab or go straight to the [latest](https://github.com/kayak/SwiftGenStrings/releases/latest) release.\n\n### From Git\n\nThe project provides a `Makefile`. To export a binary run:\n\n```\n$ make release\n```\n\nThe 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`\n\n## Testing\n\nSince SwiftGenStrings is a SPM package, running tests is easy:\n```\n$ swift test\n```\n\n## Requirements\n\n- Xcode 12\n- Swift 5.3\n\n## Limitations\n\n- SwiftGenStrings currently doesn't support multiple tables, only the default one - `Localizable.strings`.\n- It is not possible to use `NSLocalizedString` in string interpolation e.g.: `let hello = \"--- \\(NSLocalizedString(\"Hello world!\", comment: \"\"))\"` will not pickup the localized string.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fswiftgenstrings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayak%2Fswiftgenstrings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayak%2Fswiftgenstrings/lists"}