Realtime Dynamic localization translation delivery system for iOS and Mac OSX in Swift. Create and update texts from localization.com without needing to recompile or redeploy. Cocapod for iOS devices (iPad, iPhone, iPod Touch and Mac)

Overview

alt text

LocalizationKit

Version License Platform

Localization kit is a powerful to localize texts and translation management tool. I am a developer and invariably I get the questions 'Can you just change this text?' or 'Can you add another language?' I have designed this framework so you can manage these translations and texts without having to recompile, resubmit and without the need to use developers. Essentially take out all of the pain.

alt text

How does it work

Localization Kit quickly and easily integrates into your app using Cocoapods. Then it connects to services from LocalizationKit.com which are free to use and manage. Then as you create items in your iOS app the text keys become available instantly in the online web UI. From there you can change the text and it is reflected within app in realtime (as you type any key).

Installation

Using Cocoapods

LocalizationKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LocalizationKit" "~>4.0.3" # Swift 4
pod "LocalizationKit" "~>3.0.12" # Swift 3.2

Using Carthage

github "willpowell8/LocalizationKit_iOS" ~> 4.0.3 // Swift 4
github "willpowell8/LocalizationKit_iOS" ~> 3.0.13 // Swift 3.2

Setup

Then go to https://www.localizationkit.com/app/ and create a new app on the left handside using your name. Then take the code generated currently in the url after #/app/...KEY HERE...

Then put the following into your app delegate:

At the top:

import LocalizationKit

and in the didFinishLaunchingWithOptions the following with your key:

Localization.start(appKey: "[[KEY]]")

Enabling Live Update

One of the most powerful features of LocalizationKit is the capability to edit the text in realtime on the device. You can start the live service in the following ways:

At Initialization

Localization.start(appKey: "bed920eb-9802-4a2c-a8c0-69194729d69d", live: true)

From within Settings Bundle

Make sure you create a settings bundle with boolean object named live_localization

Localization.start(appKey: "bed920eb-9802-4a2c-a8c0-69194729d69d", useSettings: true)

Toggle it within app

Localization.liveEnabled = true

Enabling Inline Edits

As part of the application you can enable the inline editing of the localizations using long press on fields. alt text Elements supporting Inline Edit: UILabel, UIButton

Toggle it within app

Localization.allowInlineEdit = true

Using Interface Builder

Localization kit has support for Xcode UI development. The process is as simple as:

  • install the cocoapod
  • open storyboard or xib file
  • select component eg UILabel or drag on standard component UILabel
  • open attribute selector
  • set a Localize Key
  • run app and the key will be available online

alt text

Supported Components

  • UILabel
  • UINavigatioNitem
  • String
  • UIBarItem
  • UIBarButtonItem
  • UITextField
  • UIButton
  • DateFormatter

Using from Code

There are several ways of using the localization system from code without using storyboard or interface builder. The first is from any string you can call the .localize to call the localized string for it. This does not give you the live updates of the text but provides you with the text at the moment you call it.

let localizedGreeting = "Hello".localize

This will create a localization key of String.Your String (which has dots replacing the spaces). For example 'Select Languages' would become String.Select.Languages. These texts will similarly be made available for you to localize within the web UI.

let resultText = Localization.get("Localization.Key", alternate: "default label text")

Localization Keys

Localization Keys are the unique identifiers that allow you to assign localization to the correct part within your app. You can use any string as a device identifier, however the application has some features to make live easier if you use dot separation methodology: ie. Product.Details.Label

Caching

LocalizationKit internalizes the caching of the localizations and translations that you have translated. Currently once a languages is loaded from the server it is stored locally for offline and subsequent use. It is updated everytime the app is reopened where by the local version is first loaded and then replaced by the server version.

TO DO - add a build phase script that can pull first version of the

Other Functions

Set language

Localization.setLanguage("de")

Get Available Languages

Localization.availableLanguages { (languages) in
// Languages is an array of [Language] which has properties localizedName and key
}

Reset to device language

Localization.resetToDeviceLanguage()

Show debug Strings

Localization.ifEmptyShowKey = true

Set Default Language

The default language is the language that you have built the application in and will be used for passing to the backend for showing strings and data.

Localization.defaultLanguageCode = "en"

Events

If you enable the live update process then you will be able to listen to localization events. These events are:

  • LocalizationEvent - this is when a text is updated.
Localization.localizationEvent(localizationKey: String)
  • Highlight Event - this is when a user has clicked the highlight button in the web UI.
Localization.highlightEvent(localizationKey: String)

Example Listening To An Event

NotificationCenter.default.addObserver(self, selector: #selector(localizationHighlight), name: Localization.highlightEvent(localizationKey: LocalizeKey!), object: nil)

Example Date Formatter

Date format as it is a single call it does adhere to the live updates. Note the dateFormat String must be set before the Localization Key

let d = DateFormatter()
d.dateFormat = "dd MMM yyyy"
d.LocalizeKey = "General.DateFormatter"
let dStr = d.string(from: Date())
print(dStr)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Author

Will Powell - LinkedIn | Blog

License

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

Comments
  • Changing language after UI is loaded, won't refresh the labels in tableview

    Changing language after UI is loaded, won't refresh the labels in tableview

    Hello, i am using LocalizationKit for a personal project and i implemented my app around it. Now i want to implement some kind of instant app language changer.. so i use

    Localization.setLanguage("rm") and Localization.setLanguage("en")

    but the strings are not updated. i tried with a tableview and tabbar controller

    also, why don't you use the standard code languages? Romanian should be RO instead of RM

    Thanks

    opened by rursache 5
  • LocalizationKit translation bugs

    LocalizationKit translation bugs

    The website is very buggy, i once sat and translated over 100 keys in one go, and it only saved 30 or so, and some of them were not saved fully so some translations would be saved with missing characters.

    e.g "Full amount" was once saved as "Full a", it's like it saved before i have finished entering the full translation.

    opened by steelzeh 4
  • Carthage support

    Carthage support

    opened by TofPlay 4
  • Documentation mistake

    Documentation mistake

    The pod file statements are missing commas.

    pod "LocalizationKit" "~>4.0.3" // Swift 4
    pod "LocalizationKit" "~>3.0.12" // Swift 3.2
    

    Should be:

    pod "LocalizationKit", "~>4.0.3" # Swift 4
    pod "LocalizationKit", "~>3.0.12" # Swift 3.2
    
    opened by ManjitBedi 2
  • No Region (Default for Language)

    No Region (Default for Language)

    Whenever I try to add Language on web it gives me "No Region (Default for Language)" As seen in attached image.

    And selecting tis option does not add language in our admin panel.

    screen shot 2018-03-14 at 5 54 10 pm

    opened by AliTariqQuantum 2
  • Language.localizedName not working as expected.

    Language.localizedName not working as expected.

    I tested the attribute for English, Spanish and Portuguese. Spanish and Portuguese return language keys instead of the localized name when calling this attribute, and I believe many other languages have the same behavior. I understand some of the languages might not be localized yet, but I believe it would be better to default to the English names in these cases, instead of language codes.

    opened by Felizolinha 2
  • Offline

    Offline

    Hi

    how is your library dealing with offline capabilities. For example when a mobile client is not connected to the internet but had already once a successful connection to the localization backend?

    How about when the client never had a connection?

    thanks for feedback

    opened by DonBaronFactory 2
  • Missing function Localization.availableLanguages

    Missing function Localization.availableLanguages

    Thanks for your great project. I immediately loved it. ;-)

    You mentioned Localization.availableLanguages in your Readme file. But in Xcode this is not available. Is there a problem on my end or do others have this as well?

    opened by sidetrax 2
  • How safe is this? What's the privacy policy?

    How safe is this? What's the privacy policy?

    Can't find info on this anywhere so posting here. This looks amazing and I want to use it, only concern is privacy and how data is handled? What if the dashboard is hacked -- doesn't this put the content of every app at risk if someone were to change the strings, etc?

    opened by etherwatch 1
  • Live update does not work

    Live update does not work

    Hi, Very good job, keep working on it!

    I would liked to try the live update feature, but it does not work. I tried to debug the problem (just wrote a few "print(...)" line into socket.on functions), but seems to the problem is on the server side. The device writes "connected" message, but nothing else. No data available on the other "channels/rooms".

    Can you check it? Thanks, Gergo

    opened by hunasdf 1
  • Web UI does not allow newlines

    Web UI does not allow newlines

    In the web UI, newlines are not shown and cannot be added. This is a severe limitation at the moment, the only way is through the live edit function in the app right now.

    opened by dankrad 1
  • Unable to load translation page.

    Unable to load translation page.

    Annotation 2020-03-08 132102

    Hi. I was wondering if you could help with this. I'm seeing a blank screen when I tried to load translations page and I've attached a screenshot of the error thrown from chrome.

    opened by zackrockz 0
  • are APIs down on the website?

    are APIs down on the website?

    I can't add or remove users. I can invite users but the link sent via email does nothing.

    This is really blocking , can we have this fixed server side?

    opened by vx8 0
  • Website down

    Website down

    I added many strings on the server but now once I open the translations page, the view is blank and won't load on both safari and chrome. Does this happens also to you?

    opened by MarcoCarnevali 0
  • Some Strings don't reach iOS

    Some Strings don't reach iOS

    Hi there, I am using LocalizationKit for quiet a while now and everything worked well but today a problem appeared. Some keys will return empty Strings.

    For example Localization.get("Admin", alternate: "Admin") returns ""

    On localizationkit.com there appears to be a bug with these keys. They appear to be empty (although not appearing in "Missing" Tab). When I type something in they keep the value for a short time and then go back to "".

    As the two keys affected by this are titles for UIBarButtonItems these buttons aren't appearing at all which makes the complete admin & editor area of my app unreachable! This app is already in use by my customer...

    opened by LucasZL 2
  • Methods renamed in Swift 4.2

    Methods renamed in Swift 4.2

    The current version 4.0.5 shows error like

    • UIKeyboardWillShow' has been renamed to 'UIResponder.keyboardWillShowNotification
    • UIKeyboardFrameEndUserInfoKey' has been renamed to 'UIResponder.keyboardFrameEndUserInfoKey'
    • UIKeyboardAnimationDurationUserInfoKey' has been renamed to 'UIResponder.keyboardAnimationDurationUserInfoKey
    • UIKeyboardAnimationCurveUserInfoKey' has been renamed to 'UIResponder.keyboardAnimationCurveUserInfoKey'
    • UIViewAnimationOptions' has been renamed to 'UIView.AnimationOptions'
    • UIViewAnimationOptions' has been renamed to 'UIView.AnimationOptions
    opened by eexe1 0
Owner
Will Powell
I work in technology innovation working with the latest technologies including VR, AR, mobile (iOS and Android)
Will Powell
iOS localization swift code generation project

code-gen-library - localization-swift module code-gen-library - localization-swift module with Python bash script execute to localization swift files(

umut boz 0 Oct 26, 2021
Swift friendly localization and i18n with in-app language switching

Localize-Swift Localize-Swift is a simple framework that improves i18n and localization in Swift iOS apps - providing cleaner syntax and in-app langua

Roy Marmelstein 2.9k Nov 13, 2022
transai is a localization tool on Android and iOS.

transai transai is a command line tool to help you do Android and iOS translation management. You can extract string files to csv format, or generate

Jintin 56 Nov 12, 2022
Localization of the application with ability to change language "on the fly" and support for plural form in any language.

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

Adrian Bobrowski 284 Nov 16, 2022
A CLI tool for localization resource management on Xcode. Built with Google Translator.

Supported by Jetbrains Open Source License Program Automatically translate and synchronize '.strings' files from the defined base language The basic c

gitmerge 164 May 4, 2022
Localizations is an OS X app that manages your Xcode project localization files (.strings)

Localizations 0.2 Localizations is an OS X app that manages your Xcode project localization files (.strings). It focuses on keeping .strings files in

Arnaud Thiercelin 129 Jul 19, 2022
Localize iOS apps in a smarter way using JSON files. Swift framework.

Swifternalization Swift library that helps in localizing apps in a different, better, simpler, more powerful way than system localization does. It use

Tomasz Szulc 575 Nov 3, 2022
Demo project of Swift language crash using Release build on iOS 14

Demo project of Swift language crash using Release build on iOS 14 Repro steps O

Daohan Chong 0 Mar 24, 2022
Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings.

Localize Localize is a framework written in swift to help you localize and pluralize your projects. It supports both storyboards and strings. Features

Andres Silva 277 Oct 12, 2022
NoOptionalInterpolation gets rid of "Optional(...)" and "nil" in Swift's string interpolation

NoOptionalInterpolation gets rid of "Optional(...)" and "nil" in Swift's string interpolation

Thanh Pham 48 Jun 5, 2022
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs!

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Nov 15, 2022
Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using native Android/iOS.

AgilityFitTodayApp Android/iOS Apps created to practice with different iOS/Android Tech. These apps were built to have similar feature sets using nati

Lauren Yew 1 Feb 25, 2022
Crowdin iOS SDK delivers all new translations from Crowdin project to the application immediately

Crowdin iOS SDK Crowdin iOS SDK delivers all new translations from Crowdin project to the application immediately. So there is no need to update this

Crowdin 97 Nov 10, 2022
Simple solution to localize your iOS App.

Hodor is a simple solution to localize your iOS App quickly, allow you to change language of project in-app without quiting the app, Just like WeChat.

Aufree 544 Sep 22, 2022
Check Localizable.strings files of iOS Apps

Rubustrings Check the format and consistency of the Localizable.strings files of iOS Apps with multi-language support Rubustrings is also available fo

David Cordero 110 Nov 12, 2022
iOS implementation of the Catrobat language

Catty Catty, also known as Pocket Code for iOS, is an on-device visual programming system for iPhones. Catrobat is a visual programming language and s

null 73 Nov 15, 2022
A tool for finding missing and unused NSLocalizedStrings

nslocalizer This is a command line tool that is used for discovering missing and unused localization strings in Xcode projects. Contributing and Code

Samantha Demi 155 Sep 17, 2022
Semi-automated Text Translator for Websites and Apps

macOS/Ubuntu/Windows: attranslate is a semi-automated tool for "synchronizing" translation-files. attranslate is optimized for fast and smooth rollout

Felix Kirchengast 269 Nov 10, 2022
This projects shows how we can server-side add/update "ANY" custom font in a live iOS App without needing to update the app.

Server-side-Dynamic-Fonts This projects shows how we can server-side add/update "ANY" custom font in a live iOS App without needing to update the app.

null 2 Mar 26, 2022
CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device!

CodeBucket Description CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad device! Keep

Dillon Buchanan 195 Nov 17, 2022