Swiftpack.co - Decybel07/L10n-swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Decybel07/L10n-swift 5.9.0
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
⭐️ 215
πŸ•“ 21 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/Decybel07/L10n-swift.git", from: "5.9.0")


Build Status CocoaPods Version Language Swift4 CocoaPods License Pod method Compatible Mentioned in Awesome-swift

L10n-swift is a simple framework that improves localization in swift app, providing cleaner syntax and in-app language switching.


Change language Simple translator Plurals

🌟 Features

  • β˜‘ Change the language of your apps "on the fly".
  • β˜‘ IBInspectable for Xcode Interface Builder (Cocoa - coming soon).
  • β˜‘ Support for user-defined Localizable file names.
  • β˜‘ Support for formats: *.plist, *.json, *.stringsdict, *.strings.
  • β˜‘ Support for grouping localization keys.
  • β˜‘ Support for plural forms in any language with multiple arguments.
  • β˜‘ Support for pseudo-languages: NonLocalized, DoubleLength, Accented, Bounded, ForcedRightToLeft.
  • β˜‘ Use .l10n() to localize any string, date and numbers.
  • β˜‘ Use more than one language at the same time.
  • β˜‘ About 25 times faster than a native solution.

πŸ’» Demo

pod try L10n-swift

⚠️ Requirements

  • iOS 9.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+
  • Swift 3.0+

πŸ‘₯ Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

πŸ“— Installation

Core Extension IBInspectable
L10n-swift βœ”οΈ βœ”οΈ βœ”οΈ
L10n-swift/Core βœ”οΈ
L10n-swift/Extension βœ”οΈ βœ”οΈ
L10n-swift/IBInspectable βœ”οΈ βœ”οΈ


pod 'L10n-swift', '~> 5.9'


github "Decybel07/L10n-swift", ~> 5.9

Swift Package Manager

.Package(url: "https://github.com/Decybel07/L10n-swift.git", majorVersion: 5)

πŸ“˜ Usage

Import L10n_swift at the top of each Swift file that will use framework.

import L10n_swift

Get localized text

Add .l10() following any String object you want localized:


Get localized number

Add .l10() following number you want localized. Using the number format for the current language:

24.l10n(minIntegerDigits: 4)
2.71828.l10n(fractionDigits: 2)

3.14.l10n { formatter in
    formatter.numberStyle = .currency

Get localized date

Add .l10() following any Date object you want localized using the date format for the current language:


Date().l10n { formatter in
    formatter.dateStyle = .medium

Get plural

Add .l10nPlural(CVarArg...) following any String object you want translated with plurals:


More about plurals, you can read on wiki

Observe language changed

Add observer for notification L10nLanguageChanged. This notification is called when language has been changed.

    self, selector: #selector(self.yourFunction), name: .L10nLanguageChanged, object: nil

Set language

L10n.shared.language = "en"
L10n.shared.language = "en-GB"

At runtime, you can switch the language at any time by setting the language property.

Get current language


Get locale for current language


Get list of supported languages


A list of all the languages contained in the main bundle.

Get preferred language


A preferred language contained in the main bundle.

Supported formats

.plist, .stringsdict

Sample .plist and .stringsdict file

More about .plist format you can read on wiki.

More about .stringsdict format you can read on wiki.


Sample .json file

More about .json format you can read on wiki.


Sample .strings file

More about .strings format you can read on wiki.

πŸ“™ FAQ

πŸ€“ Author

Adrian Bobrowski (Decybel07), adrian071993@gmail.com

πŸ”‘ License

L10n-swift is available under the MIT license. See the LICENSE file for more info.


Stars: 215
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Release 5.9.0
21 weeks ago
  • Bugfix - calling wrong function when using String.l10n() without parameters

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics