{"id":24756744,"url":"https://github.com/telemtobi/swift-localization","last_synced_at":"2026-04-16T11:01:44.524Z","repository":{"id":271978930,"uuid":"915160830","full_name":"TelemTobi/swift-localization","owner":"TelemTobi","description":"Localization made simple using Swift macros for efficient string handling and seamless integration ✨","archived":false,"fork":false,"pushed_at":"2025-02-01T13:19:15.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-02T23:58:05.894Z","etag":null,"topics":["ios-development","localization","localization-tool","swift","swiftmacros"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TelemTobi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-11T05:56:41.000Z","updated_at":"2025-07-27T13:25:07.000Z","dependencies_parsed_at":"2025-10-26T07:34:34.174Z","dependency_job_id":"87f5a87b-7bda-4623-8928-c6f385068cbe","html_url":"https://github.com/TelemTobi/swift-localization","commit_stats":null,"previous_names":["telemtobi/swift-localization"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/TelemTobi/swift-localization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelemTobi%2Fswift-localization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelemTobi%2Fswift-localization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelemTobi%2Fswift-localization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelemTobi%2Fswift-localization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TelemTobi","download_url":"https://codeload.github.com/TelemTobi/swift-localization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TelemTobi%2Fswift-localization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ios-development","localization","localization-tool","swift","swiftmacros"],"created_at":"2025-01-28T14:20:21.883Z","updated_at":"2026-04-16T11:01:44.517Z","avatar_url":"https://github.com/TelemTobi.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Localization\n\nA Swift macro-powered package that simplifies string localization in your iOS, macOS, and other Apple platform applications. It provides a type-safe, maintainable, and elegant way to handle localizations using Swift enums.\n\n[![Swift](https://img.shields.io/badge/Swift-5.9+-orange.svg)](https://swift.org)\n[![SPM](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)](https://swift.org/package-manager)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Features\n\n- ✨ Type-safe localization using Swift enums\n- 🔧 Customizable key formatting (camelCase, snake_case, or UPPER_SNAKE_CASE)\n- 💪 Compile-time validation\n- 🎯 Support for string interpolation with associated values\n\n## Quick Start\n\n1. Create an enum and annotate it with `@Localizable`:\n\n```swift\nimport Localization\n\n@Localizable\nenum Strings {\n    case welcome(name: String)\n    case itemCount(count: Int)\n    case totalPrice(amount: Double)\n}\n```\n\n2. Use it in your code:\n\n```swift\nlet welcomeText = Strings.welcome(name: \"John\").localized\nlet itemCountText = Strings.itemCount(count: 5).localized\nlet priceText = Strings.totalPrice(amount: 99.99).localized\n```\n\n3. Add corresponding keys to your `Localizable.strings` file:\n\n```\n\"welcome\" = \"Welcome, %@!\";\n\"itemCount\" = \"You have %d items\";\n\"totalPrice\" = \"Total: $%.2f\";\n```\n\n## Installation\n\n### Swift Package Manager\n\nAdd **Localization** to your project via Swift Package Manager:  \n1. In Xcode, go to **File \u003e Swift Packages \u003e Add Package Dependency**.  \n2. Enter the repository URL:\n\n   ```\n   https://github.com/telemtobi/swift-localization.git\n   ```\n\n3. Select your preferred version and finish.\n\n## Usage\n\n### Key Formatting\n\nYou can customize how the enum cases are converted to localization keys using the `keyFormat` parameter:\n\n```swift\n@Localizable(keyFormat: .camelCase)\nenum Strings { // Default: welcomeMessage -\u003e \"welcomeMessage\"\n    case welcomeMessage\n}\n\n@Localizable(keyFormat: .lowerSnakeCase)\nenum Strings { // welcomeMessage -\u003e \"welcome_message\"\n    case welcomeMessage\n}\n\n@Localizable(keyFormat: .upperSnakeCase)\nenum Strings { // welcomeMessage -\u003e \"WELCOME_MESSAGE\"\n    case welcomeMessage\n}\n```\n\n### Using Associated Values\n\nAssociated values in enum cases are automatically mapped to format arguments in your localized strings:\n\n```swift\n@Localizable\nenum Alerts {\n    case deleteConfirmation(itemName: String)\n    case syncProgress(completed: Int, total: Int)\n}\n\n// Localizable.strings\n\"deleteConfirmation\" = \"Are you sure you want to delete %@?\";\n\"syncProgress\" = \"Synced %d out of %d items\";\n\n// Usage\nlet alert = Alerts.deleteConfirmation(itemName: \"Document\").localized\nlet progress = Alerts.syncProgress(completed: 5, total: 10).localized\n```\n\n### String Extensions\n\nTo make your localized strings even more convenient to use, you can add extensions to `String` and `LocalizedStringKey`. This allows for a more natural and SwiftUI-friendly syntax:\n\n```swift\nextension String {\n    static func localized(_ string: Strings) -\u003e Self {\n        string.localized\n    }\n}\n\nextension LocalizedStringKey {\n    static func localized(_ string: Strings) -\u003e Self {\n        .init(string.localized)\n    }\n}\n```\n\nNow you can use your localizations in an even more elegant way:\n\n```swift\nlabel.text = .localized(.welcome(name: \"John\"))\n\nText(.localized(.welcome(name: \"John\")))\n```\n\nThis approach:\n- Makes your code more readable and concise\n- Provides better type safety\n- Works seamlessly with both UIKit and SwiftUI\n- Maintains the type-safe benefits of your localization enums\n\n## Requirements\n\n- Swift 5.9 or later\n- Xcode 15.0 or later\n- iOS 13.0 / macOS 10.15 / tvOS 13.0 / watchOS 6.0 or later\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelemtobi%2Fswift-localization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelemtobi%2Fswift-localization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelemtobi%2Fswift-localization/lists"}