{"id":1326,"url":"https://github.com/Decybel07/L10n-swift","last_synced_at":"2025-08-06T14:31:07.887Z","repository":{"id":56918080,"uuid":"90995627","full_name":"Decybel07/L10n-swift","owner":"Decybel07","description":"Localization of the application with ability to change language \"on the fly\" and support for plural form in any language.","archived":false,"fork":false,"pushed_at":"2024-07-13T10:29:12.000Z","size":11123,"stargazers_count":314,"open_issues_count":1,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-14T22:15:41.700Z","etag":null,"topics":["carthage","change-language","cocoapods","ios","l10n","language","language-detection","localization","localized","macos","plist","plural-form","pluralization","plurals","strings","stringsdict","swift-framework","swift-package-manager","tvos","watchos"],"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/Decybel07.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-05-11T15:35:52.000Z","updated_at":"2024-07-15T19:49:14.000Z","dependencies_parsed_at":"2022-08-20T19:50:29.268Z","dependency_job_id":null,"html_url":"https://github.com/Decybel07/L10n-swift","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decybel07%2FL10n-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decybel07%2FL10n-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decybel07%2FL10n-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decybel07%2FL10n-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decybel07","download_url":"https://codeload.github.com/Decybel07/L10n-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215780271,"owners_count":15929791,"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":["carthage","change-language","cocoapods","ios","l10n","language","language-detection","localization","localized","macos","plist","plural-form","pluralization","plurals","strings","stringsdict","swift-framework","swift-package-manager","tvos","watchos"],"created_at":"2024-01-05T20:15:43.887Z","updated_at":"2024-08-17T16:31:03.162Z","avatar_url":"https://github.com/Decybel07.png","language":"Swift","funding_links":[],"categories":["Localization","Libs","Swift","Localization [🔝](#readme)"],"sub_categories":["Other Hardware","Localization","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg width=\"75%\" src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/Logo.png\" alt=\"L10n-swift\"/\u003e\n\u003c/p\u003e\n\n\n[![Build Status](https://travis-ci.org/Decybel07/L10n-swift.svg?branch=master\u0026style=flat)](https://travis-ci.org/Decybel07/L10n-swift)\n[![CocoaPods Version](https://img.shields.io/cocoapods/v/L10n-swift.svg?style=flat\u0026label=version)](http://cocoapods.org/pods/L10n-swift)\n[![Language Swift4](https://img.shields.io/badge/languages-Swift%204.0+-FFAC45.svg?style=flat)](https://developer.apple.com/swift/) \n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FDecybel07%2FL10n-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Decybel07/L10n-swift)\n[![CocoaPods License](https://img.shields.io/cocoapods/l/L10n-swift.svg?style=flat\u0026label=license)](https://github.com/Decybel07/L10n-swift/blob/master/LICENSE)\n[![Pod method Compatible](https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20Swift%20Package%20Manager-green.svg?style=flat)](#-installation)\n[![Mentioned in Awesome-swift](https://awesome.re/mentioned-badge.svg)](https://github.com/matteocrippa/awesome-swift#localization)\n\n\u003c!--[![Docs percent](https://img.shields.io/cocoapods/metrics/doc-percent/L10n-swift.svg)](http://cocoadocs.org/docsets/L10n-swift/)--\u003e\n\u003c!--[![codecov](https://codecov.io/gh/Decybel07/L10n-swift/branch/master/graph/badge.svg)](https://codecov.io/gh/Decybel07/L10n-swift)--\u003e\n\u003c!--[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3063467ecae74021b7666787333eac54)](https://www.codacy.com/app/Decybel07/L10n-swift/dashboard)--\u003e\n\u003c!--[![codebeat badge](https://codebeat.co/badges/5f83f891-8cd6-4b12-9340-562a74c51442)](https://codebeat.co/projects/github-com-decybel07-l10n-swift-master)--\u003e\n\n\nL10n-swift is a simple framework that improves localization in swift app, providing cleaner syntax and in-app language switching.\n\n##  Overview\n\n\u003cp align=\"center\"\u003e\n\u003ctable\u003e\u003ctr\u003e\n \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/language720.gif\" alt=\"Change language\"/\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/translator720.gif\" alt=\"Simple translator\"/\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/plurals720.gif\" alt=\"Plurals\"/\u003e\u003c/td\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\u003c/p\u003e\n\n## 🌟 Features\n\n- [x] Change the language of your apps \"on the fly\".\n- [x] IBInspectable for Xcode Interface Builder (Cocoa - coming soon).\n- [x] Support for user-defined `Localizable` file names.\n- [x] Support for formats: [`*.plist`](https://github.com/Decybel07/L10n-swift/wiki/*.plist), [`*.json`](https://github.com/Decybel07/L10n-swift/wiki/*.json), [`*.stringsdict`](https://github.com/Decybel07/L10n-swift/wiki/*.stringsdict), [`*.strings`](https://github.com/Decybel07/L10n-swift/wiki/*.strings).\n- [x] Support for grouping localization keys.\n- [x] Support for [**plural**](https://github.com/Decybel07/L10n-swift/wiki/Plural) forms in any language with multiple arguments.\n- [x] Support for pseudo-languages: `NonLocalized`, `DoubleLength`, `Accented`, `Bounded`, `ForcedRightToLeft`.\n- [x] Use `.l10n()` to localize any string, date and numbers.\n- [x] Use more than one language at the same time.\n- [x] About 25 times faster than a native solution.\n\n## 💻 Demo\n\n```ruby\npod try L10n-swift\n```\n\n## ⚠️ Requirements\n \n - iOS 9.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+\n - Swift 4.0+\n\n## 👥 Communication\n\n - If you **found a bug**, open an issue.\n - If you **have a feature request**, open an issue.\n - If you **want to contribute**, submit a pull request.\n\n## 📗 Installation\n\n|                          | Core | Extension | IBInspectable |\n|--------------------------|:----:|:---------:|:-------------:|\n| L10n-swift               |  ✔️  |     ✔️    |       ✔️     |\n| L10n-swift/Core          |  ✔️  |           |               |\n| L10n-swift/Extension     |  ✔️  |     ✔️    |               |\n| L10n-swift/IBInspectable |  ✔️  |           |       ✔️      |\n\n### [CocoaPods](http://cocoapods.org)\n \n ```ruby\n pod 'L10n-swift', '~\u003e 5.10'\n ```\n \n### [Carthage](https://github.com/Carthage/Carthage)\n\n```ogdl\ngithub \"Decybel07/L10n-swift\", ~\u003e 5.10\n```\n\n### [Swift Package Manager](https://swift.org/package-manager/)\n\n```swift\n.Package(url: \"https://github.com/Decybel07/L10n-swift.git\", majorVersion: 5)\n```\n\n## 📘 [Usage](http://cocoadocs.org/docsets/L10n-swift/)\n\n Import L10n_swift at the top of each Swift file that will use framework.\n ```swift\n import L10n_swift\n ```\n \n### Get localized text\n\n Add `.l10()` following any `String` object you want localized:\n ```swift\n \"hello.world\".l10n()\n ```\n \n### Get localized number\n\n Add `.l10()` following number you want localized. Using the number format for the current language:\n ```swift\n 12.l10n()\n 24.l10n(minIntegerDigits: 4)\n 1.61803.l10n()\n 2.71828.l10n(fractionDigits: 2)\n \n 3.14.l10n { formatter in\n     formatter.numberStyle = .currency\n }\n ```\n \n ### Get localized date\n \n Add `.l10()` following any `Date`  object you want localized using the date format for the current language:\n ```swift\n Date().l10n()\n \n Date().l10n { formatter in\n     formatter.dateStyle = .medium\n }\n ```\n \n### Get plural\n\nAdd `.l10nPlural(CVarArg...)` following any `String` object you want translated with plurals:\n ```swift\n \"numberOfApples\".l10nPlural(2)\n ```\n More about plurals, you can read on [**wiki**](https://github.com/Decybel07/L10n-swift/wiki/Plural)\n \n### Observe language changed\n\n Add observer for notification `L10nLanguageChanged`. This notification is called when language has been changed.\n ```swift\n NotificationCenter.default.addObserver(\n     self, selector: #selector(self.yourFunction), name: .L10nLanguageChanged, object: nil\n )\n ```\n\n### Set language\n\n ```swift\n L10n.shared.language = \"en\"\n L10n.shared.language = \"en-GB\"\n ```\n At runtime, you can switch the language at any time by setting the language property.\n \n### Get current language\n\n ```swift\n L10n.shared.language\n ```\n \n### Get locale for current language\n\n ```swift\n L10n.shared.locale\n ```\n\n### Get list of supported languages\n\n ```swift\n L10n.supportedLanguages\n ```\n A list of all the languages contained in the main bundle.\n\n### Get preferred language\n\n ```swift\n L10n.preferredLanguage\n ```\n A preferred language contained in the main bundle.\n\n### Supported formats\n#### .plist, .stringsdict\n\u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/sample_plist_file.png\" alt=\"Sample .plist and .stringsdict file\" width=\"597\" style=\"max-width:100%;\"/\u003e\n\n More about **.plist** format you can read on [**wiki**](https://github.com/Decybel07/L10n-swift/wiki/*.plist).\n \n More about **.stringsdict** format you can read on [**wiki**](https://github.com/Decybel07/L10n-swift/wiki/*.stringsdict).\n \n #### .json\n \u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/sample_json_file.png\" alt=\"Sample .json file\" width=\"554\" style=\"max-width:100%;\"/\u003e\n \n More about **.json** format you can read on [**wiki**](https://github.com/Decybel07/L10n-swift/wiki/*.json).\n \n #### .strings\n \u003cimg src=\"https://raw.githubusercontent.com/Decybel07/L10n-swift/master/Images/sample_strings_file.png\" alt=\"Sample .strings file\" width=\"544\" style=\"max-width:100%;\"/\u003e\n \n More about **.strings** format you can read on [**wiki**](https://github.com/Decybel07/L10n-swift/wiki/*.strings).\n\n## 📙 [FAQ](https://github.com/Decybel07/L10n-swift/wiki/FAQ)\n\n## 🤓 Author\n\nAdrian Bobrowski ([Decybel07](https://github.com/Decybel07)), adrian071993@gmail.com\n\n## 🔑 License\n\nL10n-swift is available under the MIT license. See the [LICENSE](https://github.com/Decybel07/L10n-swift/blob/master/LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDecybel07%2FL10n-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDecybel07%2FL10n-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDecybel07%2FL10n-swift/lists"}