GithubHelp home page GithubHelp logo

ironman-i / ios-customlocalisator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from micazeve/ios-customlocalisator

0.0 1.0 0.0 325 KB

A custom localisator class which allows to change the app language without having to restart it.

License: MIT License

Objective-C 55.48% Swift 44.52%

ios-customlocalisator's Introduction

README

Localisator is a small class you can use in order to change languages from within your iOS app, without having to restart it. It’s compatible with the localizable.strings file, so you don’t have to duplicate all your localized strings.

Examples project are provided for both objective-C and Swift versions.

LocalisatorLocalisator

###Licence:

Localisator is under MIT Licence so you can use/modify it as you wish. Any feedback will be appreciated. I do not own any of the images in the example project : they are used only as examples. If you own any of these images and have some issues about me using your images, let me know and I will change it quickly.

###How to use it:

If you want your interface to change when the language is changed, all your graphical classes (UIViewController for ex) must subscribe to the kNotificationLanguageChanged notification which is fired when the language is changed.

This class is compatible with both old .lproj folder (ex : English) and new .lproj folder (ex : en).

Objective-C:

Add Localisator.h and Localisator.m in your project. Localisator uses ARC, if your project doesn’t use ARC, don’t forget the « -fobjc-arc » flag in your build compile phase.

Replace the NSLocalizedString(key, comment) call by [[Localisator sharedInstance] localizedStringForKey:key] in your code. You can also use the LOCALIZATION() macro.

The language must be set using [[Localisator sharedInstance] SetLanguage(...)

Swift:

Add Localisator.swift in your project. Call Localization(...) instead of NSLocalizedString(...). The language must be set using SetLanguage(...).

Any comments are welcomed

@micazeve [email protected]

ios-customlocalisator's People

Contributors

micazeve avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.