[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7006":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},7006,"Localize-Swift","marmelroy\u002FLocalize-Swift","marmelroy","Swift friendly localization and i18n with in-app language switching","",null,"Swift",3128,328,38,62,0,59.55,"MIT License",false,"master",true,[],"2026-06-12 04:00:31","[![Platform](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FLocalize-Swift.svg?maxAge=2592000)](http:\u002F\u002Fcocoapods.org\u002F?q=Localize-Swift)\n[![Version](http:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FLocalize-Swift.svg)](http:\u002F\u002Fcocoapods.org\u002F?q=Localize-Swift)\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Fmarmelroy\u002FLocalize-Swift.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Fmarmelroy\u002FLocalize-Swift)\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n\n# Localize-Swift\nLocalize-Swift is a simple framework that improves i18n and localization in Swift iOS apps - providing cleaner syntax and in-app language switching.\n\n\u003Cp align=\"center\">\u003Cimg src=\"http:\u002F\u002Fi.imgur.com\u002FvsrpqBt.gif\" width=\"242\" height=\"425\"\u002F>\u003C\u002Fp>\n\n## Features\n\n- Keep the Localizable.strings file your app already uses.\n- Allow your users to change the app's language without changing their device language.\n- Use .localized() instead of NSLocalizedString(key,comment) - a more Swifty syntax.\n- Generate your strings with a new genstrings swift\u002Fpython script that recognises .localized().\n\n## Usage\n\nImport Localize at the top of each Swift file that will contain localized text.\n\nIf CocoaPods -\n```swift\nimport Localize_Swift\n```\n\nAdd `.localized()` following any `String` object you want translated:\n```swift\ntextLabel.text = \"Hello World\".localized()\n```\n\nTo get an array of available localizations:\n```swift\nLocalize.availableLanguages()\n```\n\nTo change the current language:\n```swift\nLocalize.setCurrentLanguage(\"fr\")\n```\n\nTo update the UI in the view controller where a language change can take place, observe LCLLanguageChangeNotification:\n```swift\nNotificationCenter.default.addObserver(self, selector: #selector(setText), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil)\n```\n\nTo reset back to the default app language:\n```swift\nLocalize.resetCurrentLanguageToDefault()\n```\n\n## genstrings\n\nTo support this new i18n syntax, Localize-Swift includes custom genstrings swift script.\n\nCopy the genstrings.swift file into your project's root folder and run with\n\n```bash\n.\u002Fgenstrings.swift\n```\n\nThis will print the collected strings in the terminal. Select and copy to your default Localizable.strings.\n\nThe script includes the ability to specify excluded directories and files (by editing the script).\n\n### [Preferrred] Setting up with [Swift Package Manager](https:\u002F\u002Fswiftpm.co\u002F?query=Localize-Swift)\n\nThe [Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) is now the preferred tool for distributing Localize-Swift. \n\nFrom Xcode 11+ :\n\n1. Select File > Swift Packages > Add Package Dependency. Enter `https:\u002F\u002Fgithub.com\u002Fmarmelroy\u002FLocalize-Swift.git` in the \"Choose Package Repository\" dialog.\n2. In the next page, specify the version resolving rule as \"Up to Next Major\" with \"3.2.0\".\n3. After Xcode checked out the source and resolving the version, you can choose the \"Localize-Swift\" library and add it to your app target.\n\nFor more info, read [Adding Package Dependencies to Your App](https:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fxcode\u002Fadding_package_dependencies_to_your_app) from Apple.\n\nAlternatively, you can also add Localize-Swift to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https:\u002F\u002Fgithub.com\u002Fmarmelroy\u002FLocalize-Swift.git\", .upToNextMajor(from: \"3.2.0\"))\n]\n```\n\n### Setting up with Carthage\n\n[Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.\n\nYou can install Carthage with [Homebrew](http:\u002F\u002Fbrew.sh\u002F) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Localize-Swift into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"marmelroy\u002FLocalize-Swift\"\n```\n\n### Setting up with [CocoaPods](http:\u002F\u002Fcocoapods.org\u002F?q=Localize-Swift)\n```ruby\nsource 'https:\u002F\u002Fgithub.com\u002FCocoaPods\u002FSpecs.git'\npod 'Localize-Swift', '~> 3.2'\n```\n","Localize-Swift 是一个旨在提升Swift iOS应用国际化和本地化体验的框架，支持应用内语言切换。其核心功能包括保持使用现有的Localizable.strings文件、允许用户在不更改设备语言的情况下切换应用语言，并采用更简洁的.localized()语法代替NSLocalizedString(key,comment)。此外，它还提供了一个新的genstrings脚本来生成字符串资源。该框架适用于需要实现多语言支持且希望为用户提供便捷的语言切换选项的应用场景。通过监听特定的通知来响应语言变更事件，开发者可以轻松地更新UI以适应新的语言设置。",2,"2026-06-11 03:10:04","top_language"]