Latest 0.2.0
License MIT
Platforms ios 8.0

CI Status

SwiftLocalization is a Swift library that can be used to handle localization in
iOS apps. It is currently limited to the functionality I need in my own apps. I
will extend it as those apps become more sophisticated over time.

Getting started

I have currently not had time to setup a demo that shows how you build a custom
tutorial on top of this library. For now, have a look at the code.

Global convenience functions

SwiftLocalization contains two global (and really simple) convenience functions:

  • translate(...) – translates a language key from Localizable.strings
  • translationExists(...) – checks if a certain language key is localized

These functions can be used instead of having to use NSLocalizedString(…) and
check for equality to determine whether or not a translation exists.

Localization services

SwiftLocalization contains a LocalizationService protocol and also provides a
default implementation. Using this protocol gives you a lot more flexibility in
how texts are translated and locales handled.

The default implementation – LocalizationServiceDefault – can translate texts.
It can also change the current locale of an app in real-time, without having to
restart the app.

IMPORTANT! For LocalizationServiceDefault to work, each Localizable.strings
file in the app must have a language key that indicates its locale, e.g.:

"locale": "en";

The name of this language key can be anything you like, but every file must use
the same name and use it when creating an instance of LocalizationServiceDefault.


To run the demo project, clone the repo, and run pod install from the Example
directory before running the app. This project is currently empty and only used
to verify that the pod will compile properly.


SwiftLocalization requires iOS 8 or later.


SwiftLocalization is available via CocoaPods. To add it
to your project, simply add the following line to your Podfile:

pod "SwiftLocalization"


Daniel Saidi, [email protected]


SwiftLocalization is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SwiftLocalization",
    "version": "0.2.0",
    "summary": "SwiftLocalization contains localization functionality for iOS.",
    "description": "SwiftLocalization is a Swift library that contains localization functionality for iOS.nIt contains a set of global convenience functions and a localization service that canntranslate language keys as well as change app locale without having to reboot the app.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Daniel Saidi": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source_files": "SwiftLocalization/Classes/**/*"

Pin It on Pinterest

Share This