All Projects → Decybel07 → L10n Swift

Decybel07 / L10n Swift

Licence: mit
Localization of the application with ability to change language "on the fly" and support for plural form in any language.

Programming Languages

swift
15916 projects
language
365 projects

Projects that are alternatives of or similar to L10n Swift

Fontblaster
Programmatically load custom fonts into your iOS and tvOS app.
Stars: ✭ 1,000 (+464.97%)
Mutual labels:  plist, tvos, cocoapods, carthage, swift-package-manager
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-25.42%)
Mutual labels:  swift-framework, tvos, watchos, cocoapods, carthage
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (+262.15%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (+66.67%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Xcglogger
A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.
Stars: ✭ 3,710 (+1996.05%)
Mutual labels:  swift-framework, tvos, watchos, cocoapods, carthage
Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+5948.59%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+587.01%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (+70.62%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-10.73%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (+197.74%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-22.03%)
Mutual labels:  tvos, watchos, cocoapods, carthage, swift-package-manager
Swiftlyext
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀
Stars: ✭ 31 (-82.49%)
Mutual labels:  swift-framework, cocoapods, carthage, swift-package-manager
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+444.63%)
Mutual labels:  tvos, watchos, carthage, swift-package-manager
Sqift
Powerful Swift wrapper for SQLite
Stars: ✭ 119 (-32.77%)
Mutual labels:  tvos, watchos, cocoapods, carthage
Sica
🦌 Simple Interface Core Animation. Run type-safe animation sequencially or parallelly
Stars: ✭ 980 (+453.67%)
Mutual labels:  tvos, cocoapods, carthage, swift-package-manager
Randomkit
Random data generation in Swift
Stars: ✭ 1,458 (+723.73%)
Mutual labels:  watchos, cocoapods, carthage, swift-package-manager
Sablurimageview
You can use blur effect and it's animation easily to call only two methods.
Stars: ✭ 538 (+203.95%)
Mutual labels:  tvos, cocoapods, carthage, swift-package-manager
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+566.67%)
Mutual labels:  swift-framework, cocoapods, carthage, swift-package-manager
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-25.42%)
Mutual labels:  watchos, cocoapods, carthage, swift-package-manager
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (+148.59%)
Mutual labels:  tvos, watchos, localization, strings

L10n-swift

Build Status CocoaPods Version Language Swift4 CocoaPods Platform 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.

Overview

Change language Simple translator Plurals

🌟 Features

  • [x] Change the language of your apps "on the fly".
  • [x] IBInspectable for Xcode Interface Builder (Cocoa - coming soon).
  • [x] Support for user-defined Localizable file names.
  • [x] Support for formats: *.plist, *.json, *.stringsdict, *.strings.
  • [x] Support for grouping localization keys.
  • [x] Support for plural forms in any language with multiple arguments.
  • [x] Support for pseudo-languages: NonLocalized, DoubleLength, Accented, Bounded, ForcedRightToLeft.
  • [x] Use .l10n() to localize any string, date and numbers.
  • [x] Use more than one language at the same time.
  • [x] 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 ✔️ ✔️

CocoaPods

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

Carthage

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

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:

"hello.world".l10n()

Get localized number

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

12.l10n()
24.l10n(minIntegerDigits: 4)
1.61803.l10n()
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()

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

Get plural

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

"numberOfApples".l10nPlural(2)

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.

NotificationCenter.default.addObserver(
    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

L10n.shared.language

Get locale for current language

L10n.shared.locale

Get list of supported languages

L10n.supportedLanguages

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

Get preferred language

L10n.preferredLanguage

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.

.json

Sample .json file

More about .json format you can read on wiki.

.strings

Sample .strings file

More about .strings format you can read on wiki.

📙 FAQ

🤓 Author

Adrian Bobrowski (Decybel07), [email protected]

🔑 License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].