Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Change language in the app. Simple approach to localize strings/images. Written in Swift.

License

NotificationsYou must be signed in to change notification settings

romansorochak/Localizable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

  • Simple approach to localize strings/images.
  • Change app language in the app.

Demo

Contents

Requirements

  • iOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation

All logic is inLocalizable.swift file.Just copy thisfile to your project.

Usage

Localize your project

  1. Create Localizable.strings file

  1. In Localizable.strings file tap Localize button and select english language.

  1. In project file add supported languages.

  1. Recommendation: do not localize storyboards or xibs. Make it simpler. Put all your localized strings in Localizable.strings file.

  1. Reproduce step 2 for needed languages.

Localization

  1. Recommendation: do not localize storyboards/xibs. Always set strings from code.

  2. Extend enum Language with appropriate languages used in the project

enumLanguage:String{case english="en"case arabic="ar"case ukrainian="uk"    //...

Get appropriate localized string

"main_page_language".localized

Get appropriate localized image

"flag".localizedImage

Change language in the app

To change language just set Language case to Language.language static property.It will change app language and semantic if need.To enable changes it will restart the app within instantiating initial view controller from Main storyboard.

  • Important: use appropriate properties described above.
Language.language=Language.english

Author

Roman Sorochak - iOS developer -roman.sorochak@gmail.com

License

Localizable is released under the MIT license. SeeLICENSE for details.

About

Change language in the app. Simple approach to localize strings/images. Written in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp