Skip to content

Switch Language help you to easily translate your iOS or tvOS app

License

Notifications You must be signed in to change notification settings

NicolasPoincet/SwitchLanguage

Repository files navigation

Switch Language

Travis CI Swift Version SwitchLanguage version SwitchLanguage Platform Readme Score codecov License: MIT

Switch Language help you to easily translate your iOS app.

CocoaPods Setup

pod 'SwitchLanguage, '~> 1.0'

Usage

First, you must import Language on each Swift file that will contain text to translate.

import SwitchLanguage

Then, you can add .localized() after any String object you want to translate.

textLabel.text = "Hello".localized()

Next, add the String key in each Localizable.string file with its translation.

"Hello" = "Bonjour";

Enjoy ! :)

Features

To set the table name:

Language.setTableName("TranslationFile")

To get the table name:

Language.getTableName()

To get all available languages:

Language.getAllLanguages()

To reset language to default:

Language.resetCurrentLanguageToDefault()

To set current language:

Language.setCurrentLanguage("fr")

To get current language:

Language.getCurrentLanguage()

To get default language:

Language.getDefaultLanguage()

UI

alt text

Authors

  • Bérangère LA TOUCHE
  • Hoang-Nam NGUYEN
  • Nicolas POINCET

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Switch Language help you to easily translate your iOS or tvOS app

Resources

License

Stars

Watchers

Forks

Packages